This repository was archived by the owner on Apr 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 },
4545 "dependencies" : {
4646 "@google-cloud/common" : " ^3.0.0" ,
47- "@sindresorhus/is" : " ^1.0.0" ,
4847 "acorn" : " ^7.0.0" ,
4948 "coffeescript" : " ^2.0.0" ,
5049 "console-log-level" : " ^1.4.0" ,
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import is from '@sindresorhus/is' ;
1615import * as assert from 'assert' ;
1716import * as consoleLogLevel from 'console-log-level' ;
1817import * as crypto from 'crypto' ;
@@ -546,7 +545,7 @@ export class Debuglet extends EventEmitter {
546545
547546 if ( serviceContext ) {
548547 if (
549- is . string ( serviceContext . service ) &&
548+ typeof serviceContext . service === 'string' &&
550549 serviceContext . service !== 'default'
551550 ) {
552551 // As per app-engine-ids, the module label is not reported
@@ -555,12 +554,12 @@ export class Debuglet extends EventEmitter {
555554 desc += ' module:' + serviceContext . service ;
556555 }
557556
558- if ( is . string ( serviceContext . version ) ) {
557+ if ( typeof serviceContext . version === 'string' ) {
559558 labels . version = serviceContext . version ;
560559 desc += ' version:' + serviceContext . version ;
561560 }
562561
563- if ( is . string ( serviceContext . minorVersion_ ) ) {
562+ if ( typeof serviceContext . minorVersion_ === 'string' ) {
564563 // v--- intentional lowercase
565564 labels . minorversion = serviceContext . minorVersion_ ;
566565 }
Original file line number Diff line number Diff line change 1414
1515// TODO: Unify some common code with state.ts in future PRs.
1616
17- import is from '@sindresorhus/is' ;
1817import * as inspector from 'inspector' ;
1918import * as util from 'util' ;
2019
@@ -387,7 +386,7 @@ class StateResolver {
387386 } else {
388387 locals = this . resolveLocalsList_ ( frame ) ;
389388
390- if ( is . emptyArray ( locals ) ) {
389+ if ( Array . isArray ( locals ) && locals . length === 0 ) {
391390 locals = [ ] ;
392391 }
393392 }
@@ -453,7 +452,13 @@ class StateResolver {
453452 objectId : frame . scopeChain [ i ] . object . objectId as string ,
454453 } ) ;
455454 // TODO: Handle when result.error exists.
456- if ( result . response && ! is . emptyArray ( result . response . result ) ) {
455+ if (
456+ result . response &&
457+ ! (
458+ Array . isArray ( result . response . result ) &&
459+ result . response . result . length === 0
460+ )
461+ ) {
457462 for ( let j = 0 ; j < result . response . result . length ; ++ j ) {
458463 if ( ! usedNames [ result . response . result [ j ] . name ] ) {
459464 // It's a valid variable that belongs in the locals list
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import is from '@sindresorhus/is' ;
1615import * as util from 'util' ;
1716import * as vm from 'vm' ;
1817
@@ -366,7 +365,7 @@ class StateResolver {
366365 // in locals which will include any applicable arguments from the
367366 // invocation.
368367 locals = this . resolveLocalsList_ ( frame ) ;
369- if ( is . emptyArray ( locals ) ) {
368+ if ( Array . isArray ( locals ) && locals . length === 0 ) {
370369 locals = [ ] ;
371370 }
372371 }
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import is from '@sindresorhus/is' ;
1615import * as inspector from 'inspector' ;
1716import * as path from 'path' ;
1817import * as semver from 'semver' ;
@@ -65,7 +64,7 @@ export function findScripts(
6564 // (path: string, knownFiles: string[], resolved: string[]) => string[]
6665 const resolved = resolveScripts ( scriptPath , config , fileStats ) ;
6766 if ( config . pathResolver ) {
68- if ( ! is . function_ ( config . pathResolver ) ) {
67+ if ( typeof config . pathResolver !== 'function' ) {
6968 logger . warn (
7069 `The 'pathResolver' config must be a function. Continuing ` +
7170 `with the agent's default behavior.`
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import is from '@sindresorhus/is' ;
16-
1715import { PackageInfo } from './client/stackdriver/debug' ;
1816import { StatusMessage } from './client/stackdriver/status-message' ;
1917
@@ -83,13 +81,13 @@ export class Debuggee {
8381
8482 properties = properties || { } ;
8583
86- if ( ! is . string ( properties . project ) ) {
84+ if ( typeof properties . project !== 'string' ) {
8785 throw new Error ( 'properties.project must be a string' ) ;
8886 }
89- if ( ! is . string ( properties . uniquifier ) ) {
87+ if ( typeof properties . uniquifier !== 'string' ) {
9088 throw new Error ( 'properties.uniquifier must be a string' ) ;
9189 }
92- if ( ! is . string ( properties . description ) ) {
90+ if ( typeof properties . description !== 'string' ) {
9391 throw new Error ( 'properties.description must be a string' ) ;
9492 }
9593
You can’t perform that action at this time.
0 commit comments