@rhombus-toolkit/type-guards 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.heft/build-cache/heft-jest-data.json +7 -0
- package/.rush/temp/package-deps_build.json +24 -0
- package/.rush/temp/shrinkwrap-deps.json +873 -0
- package/config/rig.json +6 -0
- package/lib/assert-never.d.ts +2 -0
- package/lib/assert-never.d.ts.map +1 -0
- package/lib/assert-never.js +4 -0
- package/lib/assert-never.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/is-array.d.ts +2 -0
- package/lib/is-array.d.ts.map +1 -0
- package/lib/is-array.js +4 -0
- package/lib/is-array.js.map +1 -0
- package/lib/is-defined.d.ts +3 -0
- package/lib/is-defined.d.ts.map +1 -0
- package/lib/is-defined.js +7 -0
- package/lib/is-defined.js.map +1 -0
- package/lib/is-function.d.ts +2 -0
- package/lib/is-function.d.ts.map +1 -0
- package/lib/is-function.js +4 -0
- package/lib/is-function.js.map +1 -0
- package/lib/is-promise.d.ts +2 -0
- package/lib/is-promise.d.ts.map +1 -0
- package/lib/is-promise.js +7 -0
- package/lib/is-promise.js.map +1 -0
- package/lib/is-url.d.ts +2 -0
- package/lib/is-url.d.ts.map +1 -0
- package/lib/is-url.js +4 -0
- package/lib/is-url.js.map +1 -0
- package/lib/iterables/_isIterator.d.ts +2 -0
- package/lib/iterables/_isIterator.d.ts.map +1 -0
- package/lib/iterables/_isIterator.js +9 -0
- package/lib/iterables/_isIterator.js.map +1 -0
- package/lib/iterables/index.d.ts +7 -0
- package/lib/iterables/index.d.ts.map +1 -0
- package/lib/iterables/index.js +7 -0
- package/lib/iterables/index.js.map +1 -0
- package/lib/iterables/is-async-generator.d.ts +2 -0
- package/lib/iterables/is-async-generator.d.ts.map +1 -0
- package/lib/iterables/is-async-generator.js +10 -0
- package/lib/iterables/is-async-generator.js.map +1 -0
- package/lib/iterables/is-async-iterable.d.ts +2 -0
- package/lib/iterables/is-async-iterable.d.ts.map +1 -0
- package/lib/iterables/is-async-iterable.js +4 -0
- package/lib/iterables/is-async-iterable.js.map +1 -0
- package/lib/iterables/is-async-iterator.d.ts +2 -0
- package/lib/iterables/is-async-iterator.d.ts.map +1 -0
- package/lib/iterables/is-async-iterator.js +6 -0
- package/lib/iterables/is-async-iterator.js.map +1 -0
- package/lib/iterables/is-generator.d.ts +2 -0
- package/lib/iterables/is-generator.d.ts.map +1 -0
- package/lib/iterables/is-generator.js +10 -0
- package/lib/iterables/is-generator.js.map +1 -0
- package/lib/iterables/is-iterable.d.ts +2 -0
- package/lib/iterables/is-iterable.d.ts.map +1 -0
- package/lib/iterables/is-iterable.js +4 -0
- package/lib/iterables/is-iterable.js.map +1 -0
- package/lib/iterables/is-iterator.d.ts +2 -0
- package/lib/iterables/is-iterator.d.ts.map +1 -0
- package/lib/iterables/is-iterator.js +6 -0
- package/lib/iterables/is-iterator.js.map +1 -0
- package/lib-commonjs/assert-never.js +8 -0
- package/lib-commonjs/assert-never.js.map +1 -0
- package/lib-commonjs/index.js +11 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/is-array.js +8 -0
- package/lib-commonjs/is-array.js.map +1 -0
- package/lib-commonjs/is-defined.js +12 -0
- package/lib-commonjs/is-defined.js.map +1 -0
- package/lib-commonjs/is-function.js +8 -0
- package/lib-commonjs/is-function.js.map +1 -0
- package/lib-commonjs/is-promise.js +11 -0
- package/lib-commonjs/is-promise.js.map +1 -0
- package/lib-commonjs/is-url.js +8 -0
- package/lib-commonjs/is-url.js.map +1 -0
- package/lib-commonjs/iterables/_isIterator.js +13 -0
- package/lib-commonjs/iterables/_isIterator.js.map +1 -0
- package/lib-commonjs/iterables/index.js +10 -0
- package/lib-commonjs/iterables/index.js.map +1 -0
- package/lib-commonjs/iterables/is-async-generator.js +14 -0
- package/lib-commonjs/iterables/is-async-generator.js.map +1 -0
- package/lib-commonjs/iterables/is-async-iterable.js +8 -0
- package/lib-commonjs/iterables/is-async-iterable.js.map +1 -0
- package/lib-commonjs/iterables/is-async-iterator.js +10 -0
- package/lib-commonjs/iterables/is-async-iterator.js.map +1 -0
- package/lib-commonjs/iterables/is-generator.js +14 -0
- package/lib-commonjs/iterables/is-generator.js.map +1 -0
- package/lib-commonjs/iterables/is-iterable.js +8 -0
- package/lib-commonjs/iterables/is-iterable.js.map +1 -0
- package/lib-commonjs/iterables/is-iterator.js +10 -0
- package/lib-commonjs/iterables/is-iterator.js.map +1 -0
- package/package.json +27 -0
- package/src/assert-never.ts +3 -0
- package/src/index.ts +7 -0
- package/src/is-array.ts +3 -0
- package/src/is-defined.ts +8 -0
- package/src/is-function.ts +3 -0
- package/src/is-promise.ts +7 -0
- package/src/is-url.ts +4 -0
- package/src/iterables/_isIterator.ts +11 -0
- package/src/iterables/index.ts +6 -0
- package/src/iterables/is-async-generator.ts +10 -0
- package/src/iterables/is-async-iterable.ts +4 -0
- package/src/iterables/is-async-iterator.ts +6 -0
- package/src/iterables/is-generator.ts +10 -0
- package/src/iterables/is-iterable.ts +3 -0
- package/src/iterables/is-iterator.ts +6 -0
- package/tsconfig.json +4 -0
- package/type-guards.build.log +21 -0
package/config/rig.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-never.d.ts","sourceRoot":"","sources":["../src/assert-never.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAE3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-never.js","sourceRoot":"","sources":["../src/assert-never.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,CAAQ;IAChC,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["export function assertNever(x: never): never {\n throw new Error(\"Unexpected object: \" + x);\n}\n"]}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC","sourcesContent":["export * from './assert-never';\nexport * from './is-array';\nexport * from './is-defined';\nexport * from './is-function';\nexport * from './is-promise';\nexport * from './is-url';\nexport * from './iterables';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../src/is-array.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,CAEvD"}
|
package/lib/is-array.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-array.js","sourceRoot":"","sources":["../src/is-array.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,KAAU;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC","sourcesContent":["export function isArray(value: any): value is Array<any>{\n return Array.isArray(value);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-defined.d.ts","sourceRoot":"","sources":["../src/is-defined.ts"],"names":[],"mappings":"AACA,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,IAAI,CAAC,CAE5D;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,IAAI,SAAS,GAAG,IAAI,CAE5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-defined.js","sourceRoot":"","sources":["../src/is-defined.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CAAI,CAAuB;IAClD,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAI,CAAuB;IACnD,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC","sourcesContent":["\nexport function isDefined<T>(p: T | null | undefined): p is T {\n return p !== undefined && p !== null;\n}\n\nexport function isNotDefined<T>(p: T | null | undefined): p is undefined | null {\n return p === undefined || p === null;\n }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-function.d.ts","sourceRoot":"","sources":["../src/is-function.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,EAAC,GAAG,EAAE,KAAG,GAAG,CAEpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-function.js","sourceRoot":"","sources":["../src/is-function.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,KAAU;IACjC,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC;AACzC,CAAC","sourcesContent":["export function isFunction(value: any): value is (...args:any[])=>any {\n return typeof (value) === 'function';\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-promise.d.ts","sourceRoot":"","sources":["../src/is-promise.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAAC,GAAG,CAAC,CAInE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { isFunction } from './is-function';
|
|
2
|
+
export function isPromiseLike(value) {
|
|
3
|
+
return value instanceof Promise
|
|
4
|
+
|| /\bPromise\b/.test(Object.prototype.toString.call(value))
|
|
5
|
+
|| 'then' in value && isFunction(value?.then);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=is-promise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-promise.js","sourceRoot":"","sources":["../src/is-promise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,UAAU,aAAa,CAAC,KAAU;IACtC,OAAO,KAAK,YAAY,OAAO;WAC1B,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;WACzD,MAAM,IAAI,KAAK,IAAI,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import { isFunction } from './is-function';\n\nexport function isPromiseLike(value: any): value is PromiseLike<any> {\n return value instanceof Promise\n || /\\bPromise\\b/.test(Object.prototype.toString.call(value))\n || 'then' in value && isFunction(value?.then);\n}\n"]}
|
package/lib/is-url.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-url.d.ts","sourceRoot":"","sources":["../src/is-url.ts"],"names":[],"mappings":"AACA,wBAAgB,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,GAAG,CAE1C"}
|
package/lib/is-url.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-url.js","sourceRoot":"","sources":["../src/is-url.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,KAAK,CAAC,GAAQ;IAC5B,OAAO,GAAG,YAAY,GAAG,CAAC;AAC5B,CAAC","sourcesContent":["\nexport function isUrl(url: any): url is URL {\n return url instanceof URL;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_isIterator.d.ts","sourceRoot":"","sources":["../../src/iterables/_isIterator.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC,CAQ9D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { isFunction } from '../is-function';
|
|
2
|
+
export function _isIterator(value) {
|
|
3
|
+
if (value?.[Symbol.toStringTag]?.split(/\s+/)?.includes('Iterator'))
|
|
4
|
+
return true;
|
|
5
|
+
if (/\bIterator\b/.test(Object.prototype.toString.call(value)))
|
|
6
|
+
return true;
|
|
7
|
+
return isFunction(value?.next);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=_isIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_isIterator.js","sourceRoot":"","sources":["../../src/iterables/_isIterator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,UAAU,WAAW,CAAC,KAAU;IACpC,IAAI,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;QACjE,OAAO,IAAI,CAAC;IAEd,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IAEd,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import { isFunction } from '../is-function';\n\nexport function _isIterator(value: any): value is Iterator<any> {\n if (value?.[Symbol.toStringTag]?.split(/\\s+/)?.includes('Iterator'))\n return true;\n\n if (/\\bIterator\\b/.test(Object.prototype.toString.call(value)))\n return true;\n\n return isFunction(value?.next);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/iterables/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/iterables/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC","sourcesContent":["export * from './is-async-generator';\nexport * from './is-async-iterable';\nexport * from './is-async-iterator';\nexport * from './is-generator';\nexport * from './is-iterable';\nexport * from './is-iterator';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-generator.d.ts","sourceRoot":"","sources":["../../src/iterables/is-async-generator.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAMnF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isAsyncIterator } from "./is-async-iterator";
|
|
2
|
+
const AsyncGeneratorFunction = (async function* () { }()).constructor;
|
|
3
|
+
export function isAsyncGenerator(value) {
|
|
4
|
+
if (value?.constructor === AsyncGeneratorFunction)
|
|
5
|
+
return true;
|
|
6
|
+
if (/\bAsyncGenerator\b/.test(Object.prototype.toString.call(value)))
|
|
7
|
+
return true;
|
|
8
|
+
return isAsyncIterator(value) && value?.next?.length === 1;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=is-async-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-generator.js","sourceRoot":"","sources":["../../src/iterables/is-async-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,sBAAsB,GAAG,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAqC,CAAC;AAChG,MAAM,UAAU,gBAAgB,CAAC,KAAU;IACzC,IAAI,KAAK,EAAE,WAAW,KAAK,sBAAsB;QAC/C,OAAO,IAAI,CAAC;IACd,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { isAsyncIterator } from \"./is-async-iterator\";\n\nconst AsyncGeneratorFunction = (async function* () { }()).constructor as AsyncGeneratorFunction;\nexport function isAsyncGenerator(value: any): value is AsyncGenerator<any, any, any> {\n if (value?.constructor === AsyncGeneratorFunction)\n return true;\n if (/\\bAsyncGenerator\\b/.test(Object.prototype.toString.call(value)))\n return true;\n return isAsyncIterator(value) && value?.next?.length === 1;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-iterable.d.ts","sourceRoot":"","sources":["../../src/iterables/is-async-iterable.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,CAEvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-iterable.js","sourceRoot":"","sources":["../../src/iterables/is-async-iterable.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAAC,KAAU;IACxC,OAAO,MAAM,CAAC,aAAa,IAAI,KAAK,CAAC;AACvC,CAAC","sourcesContent":["export function isAsyncIterable(value: any): value is AsyncIterable<any> {\n return Symbol.asyncIterator in value;\n}\n\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-iterator.d.ts","sourceRoot":"","sources":["../../src/iterables/is-async-iterator.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,qBAAqB,CAAC,GAAG,CAAC,CAE/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-iterator.js","sourceRoot":"","sources":["../../src/iterables/is-async-iterator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,UAAU,eAAe,CAAC,KAAU;IACxC,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import { _isIterator } from './_isIterator';\nimport { isAsyncIterable } from \"./is-async-iterable\";\n\nexport function isAsyncIterator(value: any): value is AsyncIterableIterator<any> {\n return isAsyncIterable(value) && _isIterator(value);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-generator.d.ts","sourceRoot":"","sources":["../../src/iterables/is-generator.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAMzE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isIterator } from "./is-iterator";
|
|
2
|
+
const GeneratorFunction = (function* () { }()).constructor;
|
|
3
|
+
export function isGenerator(value) {
|
|
4
|
+
if (value?.constructor === GeneratorFunction)
|
|
5
|
+
return true;
|
|
6
|
+
if (/\bGenerator\b/.test(Object.prototype.toString.call(value)))
|
|
7
|
+
return true;
|
|
8
|
+
return isIterator(value) && value?.next?.length === 1;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=is-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-generator.js","sourceRoot":"","sources":["../../src/iterables/is-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,MAAM,iBAAiB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAgC,CAAC;AAEhF,MAAM,UAAU,WAAW,CAAC,KAAU;IACpC,IAAI,KAAK,EAAE,WAAW,KAAK,iBAAiB;QAC1C,OAAO,IAAI,CAAC;IACd,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import { isIterator } from \"./is-iterator\";\nconst GeneratorFunction = (function* () { }()).constructor as GeneratorFunction;\n\nexport function isGenerator(value: any): value is Generator<any, any, any> {\n if (value?.constructor === GeneratorFunction)\n return true;\n if (/\\bGenerator\\b/.test(Object.prototype.toString.call(value)))\n return true;\n return isIterator(value) && value?.next?.length === 1;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-iterable.d.ts","sourceRoot":"","sources":["../../src/iterables/is-iterable.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC,CAE7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-iterable.js","sourceRoot":"","sources":["../../src/iterables/is-iterable.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,KAAU;IACnC,OAAO,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC;AAClC,CAAC","sourcesContent":["export function isIterable(value: any): value is Iterable<any> {\n return Symbol.iterator in value;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-iterator.d.ts","sourceRoot":"","sources":["../../src/iterables/is-iterator.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAErE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-iterator.js","sourceRoot":"","sources":["../../src/iterables/is-iterator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,UAAU,UAAU,CAAC,KAAU;IACnC,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import { isIterable } from './is-iterable';\nimport { _isIterator } from './_isIterator';\n\nexport function isIterator(value: any): value is IterableIterator<any> {\n return isIterable(value) && _isIterator(value);\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertNever = void 0;
|
|
4
|
+
function assertNever(x) {
|
|
5
|
+
throw new Error("Unexpected object: " + x);
|
|
6
|
+
}
|
|
7
|
+
exports.assertNever = assertNever;
|
|
8
|
+
//# sourceMappingURL=assert-never.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-never.js","sourceRoot":"","sources":["../src/assert-never.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,CAAQ;IAChC,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAFD,kCAEC","sourcesContent":["export function assertNever(x: never): never {\n throw new Error(\"Unexpected object: \" + x);\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./assert-never"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./is-array"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./is-defined"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./is-function"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./is-promise"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./is-url"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./iterables"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,qDAA2B;AAC3B,uDAA6B;AAC7B,wDAA8B;AAC9B,uDAA6B;AAC7B,mDAAyB;AACzB,sDAA4B","sourcesContent":["export * from './assert-never';\nexport * from './is-array';\nexport * from './is-defined';\nexport * from './is-function';\nexport * from './is-promise';\nexport * from './is-url';\nexport * from './iterables';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-array.js","sourceRoot":"","sources":["../src/is-array.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,KAAU;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAFD,0BAEC","sourcesContent":["export function isArray(value: any): value is Array<any>{\n return Array.isArray(value);\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNotDefined = exports.isDefined = void 0;
|
|
4
|
+
function isDefined(p) {
|
|
5
|
+
return p !== undefined && p !== null;
|
|
6
|
+
}
|
|
7
|
+
exports.isDefined = isDefined;
|
|
8
|
+
function isNotDefined(p) {
|
|
9
|
+
return p === undefined || p === null;
|
|
10
|
+
}
|
|
11
|
+
exports.isNotDefined = isNotDefined;
|
|
12
|
+
//# sourceMappingURL=is-defined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-defined.js","sourceRoot":"","sources":["../src/is-defined.ts"],"names":[],"mappings":";;;AACA,SAAgB,SAAS,CAAI,CAAuB;IAClD,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAFD,8BAEC;AAED,SAAgB,YAAY,CAAI,CAAuB;IACnD,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAFH,oCAEG","sourcesContent":["\nexport function isDefined<T>(p: T | null | undefined): p is T {\n return p !== undefined && p !== null;\n}\n\nexport function isNotDefined<T>(p: T | null | undefined): p is undefined | null {\n return p === undefined || p === null;\n }\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-function.js","sourceRoot":"","sources":["../src/is-function.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,KAAU;IACjC,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC;AACzC,CAAC;AAFD,gCAEC","sourcesContent":["export function isFunction(value: any): value is (...args:any[])=>any {\n return typeof (value) === 'function';\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPromiseLike = void 0;
|
|
4
|
+
const is_function_1 = require("./is-function");
|
|
5
|
+
function isPromiseLike(value) {
|
|
6
|
+
return value instanceof Promise
|
|
7
|
+
|| /\bPromise\b/.test(Object.prototype.toString.call(value))
|
|
8
|
+
|| 'then' in value && (0, is_function_1.isFunction)(value?.then);
|
|
9
|
+
}
|
|
10
|
+
exports.isPromiseLike = isPromiseLike;
|
|
11
|
+
//# sourceMappingURL=is-promise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-promise.js","sourceRoot":"","sources":["../src/is-promise.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,SAAgB,aAAa,CAAC,KAAU;IACtC,OAAO,KAAK,YAAY,OAAO;WAC1B,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;WACzD,MAAM,IAAI,KAAK,IAAI,IAAA,wBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC;AAJD,sCAIC","sourcesContent":["import { isFunction } from './is-function';\n\nexport function isPromiseLike(value: any): value is PromiseLike<any> {\n return value instanceof Promise\n || /\\bPromise\\b/.test(Object.prototype.toString.call(value))\n || 'then' in value && isFunction(value?.then);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-url.js","sourceRoot":"","sources":["../src/is-url.ts"],"names":[],"mappings":";;;AACA,SAAgB,KAAK,CAAC,GAAQ;IAC5B,OAAO,GAAG,YAAY,GAAG,CAAC;AAC5B,CAAC;AAFD,sBAEC","sourcesContent":["\nexport function isUrl(url: any): url is URL {\n return url instanceof URL;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._isIterator = void 0;
|
|
4
|
+
const is_function_1 = require("../is-function");
|
|
5
|
+
function _isIterator(value) {
|
|
6
|
+
if (value?.[Symbol.toStringTag]?.split(/\s+/)?.includes('Iterator'))
|
|
7
|
+
return true;
|
|
8
|
+
if (/\bIterator\b/.test(Object.prototype.toString.call(value)))
|
|
9
|
+
return true;
|
|
10
|
+
return (0, is_function_1.isFunction)(value?.next);
|
|
11
|
+
}
|
|
12
|
+
exports._isIterator = _isIterator;
|
|
13
|
+
//# sourceMappingURL=_isIterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_isIterator.js","sourceRoot":"","sources":["../../src/iterables/_isIterator.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,SAAgB,WAAW,CAAC,KAAU;IACpC,IAAI,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;QACjE,OAAO,IAAI,CAAC;IAEd,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IAEd,OAAO,IAAA,wBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC;AARD,kCAQC","sourcesContent":["import { isFunction } from '../is-function';\n\nexport function _isIterator(value: any): value is Iterator<any> {\n if (value?.[Symbol.toStringTag]?.split(/\\s+/)?.includes('Iterator'))\n return true;\n\n if (/\\bIterator\\b/.test(Object.prototype.toString.call(value)))\n return true;\n\n return isFunction(value?.next);\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./is-async-generator"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./is-async-iterable"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./is-async-iterator"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./is-generator"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./is-iterable"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./is-iterator"), exports);
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/iterables/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,8DAAoC;AACpC,8DAAoC;AACpC,yDAA+B;AAC/B,wDAA8B;AAC9B,wDAA8B","sourcesContent":["export * from './is-async-generator';\nexport * from './is-async-iterable';\nexport * from './is-async-iterator';\nexport * from './is-generator';\nexport * from './is-iterable';\nexport * from './is-iterator';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAsyncGenerator = void 0;
|
|
4
|
+
const is_async_iterator_1 = require("./is-async-iterator");
|
|
5
|
+
const AsyncGeneratorFunction = (async function* () { }()).constructor;
|
|
6
|
+
function isAsyncGenerator(value) {
|
|
7
|
+
if (value?.constructor === AsyncGeneratorFunction)
|
|
8
|
+
return true;
|
|
9
|
+
if (/\bAsyncGenerator\b/.test(Object.prototype.toString.call(value)))
|
|
10
|
+
return true;
|
|
11
|
+
return (0, is_async_iterator_1.isAsyncIterator)(value) && value?.next?.length === 1;
|
|
12
|
+
}
|
|
13
|
+
exports.isAsyncGenerator = isAsyncGenerator;
|
|
14
|
+
//# sourceMappingURL=is-async-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-generator.js","sourceRoot":"","sources":["../../src/iterables/is-async-generator.ts"],"names":[],"mappings":";;;AAAA,2DAAsD;AAEtD,MAAM,sBAAsB,GAAG,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAqC,CAAC;AAChG,SAAgB,gBAAgB,CAAC,KAAU;IACzC,IAAI,KAAK,EAAE,WAAW,KAAK,sBAAsB;QAC/C,OAAO,IAAI,CAAC;IACd,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,OAAO,IAAA,mCAAe,EAAC,KAAK,CAAC,IAAI,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;AAC7D,CAAC;AAND,4CAMC","sourcesContent":["import { isAsyncIterator } from \"./is-async-iterator\";\n\nconst AsyncGeneratorFunction = (async function* () { }()).constructor as AsyncGeneratorFunction;\nexport function isAsyncGenerator(value: any): value is AsyncGenerator<any, any, any> {\n if (value?.constructor === AsyncGeneratorFunction)\n return true;\n if (/\\bAsyncGenerator\\b/.test(Object.prototype.toString.call(value)))\n return true;\n return isAsyncIterator(value) && value?.next?.length === 1;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAsyncIterable = void 0;
|
|
4
|
+
function isAsyncIterable(value) {
|
|
5
|
+
return Symbol.asyncIterator in value;
|
|
6
|
+
}
|
|
7
|
+
exports.isAsyncIterable = isAsyncIterable;
|
|
8
|
+
//# sourceMappingURL=is-async-iterable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-iterable.js","sourceRoot":"","sources":["../../src/iterables/is-async-iterable.ts"],"names":[],"mappings":";;;AAAA,SAAgB,eAAe,CAAC,KAAU;IACxC,OAAO,MAAM,CAAC,aAAa,IAAI,KAAK,CAAC;AACvC,CAAC;AAFD,0CAEC","sourcesContent":["export function isAsyncIterable(value: any): value is AsyncIterable<any> {\n return Symbol.asyncIterator in value;\n}\n\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAsyncIterator = void 0;
|
|
4
|
+
const _isIterator_1 = require("./_isIterator");
|
|
5
|
+
const is_async_iterable_1 = require("./is-async-iterable");
|
|
6
|
+
function isAsyncIterator(value) {
|
|
7
|
+
return (0, is_async_iterable_1.isAsyncIterable)(value) && (0, _isIterator_1._isIterator)(value);
|
|
8
|
+
}
|
|
9
|
+
exports.isAsyncIterator = isAsyncIterator;
|
|
10
|
+
//# sourceMappingURL=is-async-iterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-async-iterator.js","sourceRoot":"","sources":["../../src/iterables/is-async-iterator.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,2DAAsD;AAEtD,SAAgB,eAAe,CAAC,KAAU;IACxC,OAAO,IAAA,mCAAe,EAAC,KAAK,CAAC,IAAI,IAAA,yBAAW,EAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AAFD,0CAEC","sourcesContent":["import { _isIterator } from './_isIterator';\nimport { isAsyncIterable } from \"./is-async-iterable\";\n\nexport function isAsyncIterator(value: any): value is AsyncIterableIterator<any> {\n return isAsyncIterable(value) && _isIterator(value);\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isGenerator = void 0;
|
|
4
|
+
const is_iterator_1 = require("./is-iterator");
|
|
5
|
+
const GeneratorFunction = (function* () { }()).constructor;
|
|
6
|
+
function isGenerator(value) {
|
|
7
|
+
if (value?.constructor === GeneratorFunction)
|
|
8
|
+
return true;
|
|
9
|
+
if (/\bGenerator\b/.test(Object.prototype.toString.call(value)))
|
|
10
|
+
return true;
|
|
11
|
+
return (0, is_iterator_1.isIterator)(value) && value?.next?.length === 1;
|
|
12
|
+
}
|
|
13
|
+
exports.isGenerator = isGenerator;
|
|
14
|
+
//# sourceMappingURL=is-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-generator.js","sourceRoot":"","sources":["../../src/iterables/is-generator.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,MAAM,iBAAiB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAgC,CAAC;AAEhF,SAAgB,WAAW,CAAC,KAAU;IACpC,IAAI,KAAK,EAAE,WAAW,KAAK,iBAAiB;QAC1C,OAAO,IAAI,CAAC;IACd,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,OAAO,IAAA,wBAAU,EAAC,KAAK,CAAC,IAAI,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;AACxD,CAAC;AAND,kCAMC","sourcesContent":["import { isIterator } from \"./is-iterator\";\nconst GeneratorFunction = (function* () { }()).constructor as GeneratorFunction;\n\nexport function isGenerator(value: any): value is Generator<any, any, any> {\n if (value?.constructor === GeneratorFunction)\n return true;\n if (/\\bGenerator\\b/.test(Object.prototype.toString.call(value)))\n return true;\n return isIterator(value) && value?.next?.length === 1;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-iterable.js","sourceRoot":"","sources":["../../src/iterables/is-iterable.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC;AAClC,CAAC;AAFD,gCAEC","sourcesContent":["export function isIterable(value: any): value is Iterable<any> {\n return Symbol.iterator in value;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isIterator = void 0;
|
|
4
|
+
const is_iterable_1 = require("./is-iterable");
|
|
5
|
+
const _isIterator_1 = require("./_isIterator");
|
|
6
|
+
function isIterator(value) {
|
|
7
|
+
return (0, is_iterable_1.isIterable)(value) && (0, _isIterator_1._isIterator)(value);
|
|
8
|
+
}
|
|
9
|
+
exports.isIterator = isIterator;
|
|
10
|
+
//# sourceMappingURL=is-iterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-iterator.js","sourceRoot":"","sources":["../../src/iterables/is-iterator.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,+CAA4C;AAE5C,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,IAAA,wBAAU,EAAC,KAAK,CAAC,IAAI,IAAA,yBAAW,EAAC,KAAK,CAAC,CAAC;AACjD,CAAC;AAFD,gCAEC","sourcesContent":["import { isIterable } from './is-iterable';\nimport { _isIterator } from './_isIterator';\n\nexport function isIterator(value: any): value is IterableIterator<any> {\n return isIterable(value) && _isIterator(value);\n}\n"]}
|