MCPcopy Index your code
hub / github.com/nodejs/node / isArrayLikeType

Function isArrayLikeType

test/fixtures/snapshot/typescript.js:67417–67421  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

67415 return isArrayType(type) ? getTypeArguments(type)[0] : undefined;
67416 }
67417 function isArrayLikeType(type) {
67418 // A type is array-like if it is a reference to the global Array or global ReadonlyArray type,
67419 // or if it is not the undefined or null type and if it is assignable to ReadonlyArray<any>
67420 return isArrayType(type) || !(type.flags & 98304 /* TypeFlags.Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);
67421 }
67422 function getSingleBaseForNonAugmentingSubtype(type) {
67423 if (!(ts.getObjectFlags(type) & 4 /* ObjectFlags.Reference */) || !(ts.getObjectFlags(type.target) & 3 /* ObjectFlags.ClassOrInterface */)) {
67424 return undefined;

Calls 2

isArrayTypeFunction · 0.85
isTypeAssignableToFunction · 0.85

Tested by

no test coverage detected