@rhombus-toolkit/type-guards 1.1.0 → 1.2.2

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.
Files changed (121) hide show
  1. package/.rush/temp/24b38ca5a2048acddbd6a7f3792ac5aa7b4be2d6.log +10 -0
  2. package/.rush/temp/2b7adeffb7e5e639816c4011e6733a69e9a4df19.log +30 -0
  3. package/.rush/temp/a28d2e2f3b4ea22cf01422daf930997569ddb8e3.log +10 -0
  4. package/.rush/temp/operation/build/all.log +12 -0
  5. package/.rush/temp/operation/build/state.json +3 -0
  6. package/.rush/temp/package-deps_build.json +7 -17
  7. package/.rush/temp/shrinkwrap-deps.json +339 -434
  8. package/CHANGELOG.json +56 -0
  9. package/CHANGELOG.md +25 -0
  10. package/lib/index.d.ts +1 -6
  11. package/lib/index.d.ts.map +1 -1
  12. package/lib/index.js +1 -6
  13. package/lib/index.js.map +1 -1
  14. package/lib/is.d.ts +19 -0
  15. package/lib/is.d.ts.map +1 -0
  16. package/lib/is.js +70 -0
  17. package/lib/is.js.map +1 -0
  18. package/lib-commonjs/index.js +1 -6
  19. package/lib-commonjs/index.js.map +1 -1
  20. package/lib-commonjs/is.js +89 -0
  21. package/lib-commonjs/is.js.map +1 -0
  22. package/package.json +11 -11
  23. package/rush-logs/type-guards.build.cache.log +3 -0
  24. package/rush-logs/type-guards.build.log +13 -0
  25. package/src/index.ts +1 -6
  26. package/src/is.ts +84 -0
  27. package/temp/build.typescript/ts_VRykbCrU.json +1 -0
  28. package/tsconfig.json +7 -1
  29. package/.heft/build-cache/heft-jest-data.json +0 -7
  30. package/lib/is-array.d.ts +0 -2
  31. package/lib/is-array.d.ts.map +0 -1
  32. package/lib/is-array.js +0 -4
  33. package/lib/is-array.js.map +0 -1
  34. package/lib/is-defined.d.ts +0 -3
  35. package/lib/is-defined.d.ts.map +0 -1
  36. package/lib/is-defined.js +0 -7
  37. package/lib/is-defined.js.map +0 -1
  38. package/lib/is-function.d.ts +0 -2
  39. package/lib/is-function.d.ts.map +0 -1
  40. package/lib/is-function.js +0 -4
  41. package/lib/is-function.js.map +0 -1
  42. package/lib/is-promise.d.ts +0 -2
  43. package/lib/is-promise.d.ts.map +0 -1
  44. package/lib/is-promise.js +0 -7
  45. package/lib/is-promise.js.map +0 -1
  46. package/lib/is-url.d.ts +0 -2
  47. package/lib/is-url.d.ts.map +0 -1
  48. package/lib/is-url.js +0 -4
  49. package/lib/is-url.js.map +0 -1
  50. package/lib/iterables/_isIterator.d.ts +0 -2
  51. package/lib/iterables/_isIterator.d.ts.map +0 -1
  52. package/lib/iterables/_isIterator.js +0 -9
  53. package/lib/iterables/_isIterator.js.map +0 -1
  54. package/lib/iterables/index.d.ts +0 -7
  55. package/lib/iterables/index.d.ts.map +0 -1
  56. package/lib/iterables/index.js +0 -7
  57. package/lib/iterables/index.js.map +0 -1
  58. package/lib/iterables/is-async-generator.d.ts +0 -2
  59. package/lib/iterables/is-async-generator.d.ts.map +0 -1
  60. package/lib/iterables/is-async-generator.js +0 -10
  61. package/lib/iterables/is-async-generator.js.map +0 -1
  62. package/lib/iterables/is-async-iterable.d.ts +0 -2
  63. package/lib/iterables/is-async-iterable.d.ts.map +0 -1
  64. package/lib/iterables/is-async-iterable.js +0 -4
  65. package/lib/iterables/is-async-iterable.js.map +0 -1
  66. package/lib/iterables/is-async-iterator.d.ts +0 -2
  67. package/lib/iterables/is-async-iterator.d.ts.map +0 -1
  68. package/lib/iterables/is-async-iterator.js +0 -6
  69. package/lib/iterables/is-async-iterator.js.map +0 -1
  70. package/lib/iterables/is-generator.d.ts +0 -2
  71. package/lib/iterables/is-generator.d.ts.map +0 -1
  72. package/lib/iterables/is-generator.js +0 -10
  73. package/lib/iterables/is-generator.js.map +0 -1
  74. package/lib/iterables/is-iterable.d.ts +0 -2
  75. package/lib/iterables/is-iterable.d.ts.map +0 -1
  76. package/lib/iterables/is-iterable.js +0 -4
  77. package/lib/iterables/is-iterable.js.map +0 -1
  78. package/lib/iterables/is-iterator.d.ts +0 -2
  79. package/lib/iterables/is-iterator.d.ts.map +0 -1
  80. package/lib/iterables/is-iterator.js +0 -6
  81. package/lib/iterables/is-iterator.js.map +0 -1
  82. package/lib-commonjs/is-array.js +0 -8
  83. package/lib-commonjs/is-array.js.map +0 -1
  84. package/lib-commonjs/is-defined.js +0 -12
  85. package/lib-commonjs/is-defined.js.map +0 -1
  86. package/lib-commonjs/is-function.js +0 -8
  87. package/lib-commonjs/is-function.js.map +0 -1
  88. package/lib-commonjs/is-promise.js +0 -11
  89. package/lib-commonjs/is-promise.js.map +0 -1
  90. package/lib-commonjs/is-url.js +0 -8
  91. package/lib-commonjs/is-url.js.map +0 -1
  92. package/lib-commonjs/iterables/_isIterator.js +0 -13
  93. package/lib-commonjs/iterables/_isIterator.js.map +0 -1
  94. package/lib-commonjs/iterables/index.js +0 -10
  95. package/lib-commonjs/iterables/index.js.map +0 -1
  96. package/lib-commonjs/iterables/is-async-generator.js +0 -14
  97. package/lib-commonjs/iterables/is-async-generator.js.map +0 -1
  98. package/lib-commonjs/iterables/is-async-iterable.js +0 -8
  99. package/lib-commonjs/iterables/is-async-iterable.js.map +0 -1
  100. package/lib-commonjs/iterables/is-async-iterator.js +0 -10
  101. package/lib-commonjs/iterables/is-async-iterator.js.map +0 -1
  102. package/lib-commonjs/iterables/is-generator.js +0 -14
  103. package/lib-commonjs/iterables/is-generator.js.map +0 -1
  104. package/lib-commonjs/iterables/is-iterable.js +0 -8
  105. package/lib-commonjs/iterables/is-iterable.js.map +0 -1
  106. package/lib-commonjs/iterables/is-iterator.js +0 -10
  107. package/lib-commonjs/iterables/is-iterator.js.map +0 -1
  108. package/src/is-array.ts +0 -3
  109. package/src/is-defined.ts +0 -8
  110. package/src/is-function.ts +0 -3
  111. package/src/is-promise.ts +0 -7
  112. package/src/is-url.ts +0 -4
  113. package/src/iterables/_isIterator.ts +0 -11
  114. package/src/iterables/index.ts +0 -6
  115. package/src/iterables/is-async-generator.ts +0 -10
  116. package/src/iterables/is-async-iterable.ts +0 -4
  117. package/src/iterables/is-async-iterator.ts +0 -6
  118. package/src/iterables/is-generator.ts +0 -10
  119. package/src/iterables/is-iterable.ts +0 -3
  120. package/src/iterables/is-iterator.ts +0 -6
  121. package/type-guards.build.log +0 -21
package/CHANGELOG.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@rhombus-toolkit/type-guards",
3
+ "entries": [
4
+ {
5
+ "version": "1.2.2",
6
+ "tag": "@rhombus-toolkit/type-guards_v1.2.2",
7
+ "date": "Fri, 23 Jun 2023 09:27:29 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "god freakin damn rush publish"
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@rhombus-toolkit/func\" from `1.2.1` to `1.2.2`"
17
+ }
18
+ ]
19
+ }
20
+ },
21
+ {
22
+ "version": "1.2.1",
23
+ "tag": "@rhombus-toolkit/type-guards_v1.2.1",
24
+ "date": "Fri, 23 Jun 2023 08:16:55 GMT",
25
+ "comments": {
26
+ "patch": [
27
+ {
28
+ "comment": "tooling upgrades (no functional change)"
29
+ }
30
+ ],
31
+ "dependency": [
32
+ {
33
+ "comment": "Updating dependency \"@rhombus-toolkit/func\" from `1.2.0` to `1.2.1`"
34
+ }
35
+ ]
36
+ }
37
+ },
38
+ {
39
+ "version": "1.2.0",
40
+ "tag": "@rhombus-toolkit/type-guards_v1.2.0",
41
+ "date": "Mon, 25 Jul 2022 05:38:56 GMT",
42
+ "comments": {
43
+ "minor": [
44
+ {
45
+ "comment": "init"
46
+ }
47
+ ],
48
+ "dependency": [
49
+ {
50
+ "comment": "Updating dependency \"@rhombus-toolkit/func\" from `1.1.0` to `1.2.0`"
51
+ }
52
+ ]
53
+ }
54
+ }
55
+ ]
56
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Change Log - @rhombus-toolkit/type-guards
2
+
3
+ This log was last generated on Fri, 23 Jun 2023 09:27:29 GMT and should not be manually modified.
4
+
5
+ ## 1.2.2
6
+ Fri, 23 Jun 2023 09:27:29 GMT
7
+
8
+ ### Patches
9
+
10
+ - god freakin damn rush publish
11
+
12
+ ## 1.2.1
13
+ Fri, 23 Jun 2023 08:16:55 GMT
14
+
15
+ ### Patches
16
+
17
+ - tooling upgrades (no functional change)
18
+
19
+ ## 1.2.0
20
+ Mon, 25 Jul 2022 05:38:56 GMT
21
+
22
+ ### Minor changes
23
+
24
+ - init
25
+
package/lib/index.d.ts CHANGED
@@ -1,8 +1,3 @@
1
1
  export * from './assert-never';
2
- export * from './is-array';
3
- export * from './is-defined';
4
- export * from './is-function';
5
- export * from './is-promise';
6
- export * from './is-url';
7
- export * from './iterables';
2
+ export * from './is';
8
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC"}
package/lib/index.js CHANGED
@@ -1,8 +1,3 @@
1
1
  export * from './assert-never';
2
- export * from './is-array';
3
- export * from './is-defined';
4
- export * from './is-function';
5
- export * from './is-promise';
6
- export * from './is-url';
7
- export * from './iterables';
2
+ export * from './is';
8
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC","sourcesContent":["export * from './assert-never';\nexport * from './is';\n"]}
package/lib/is.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ export declare function isArray(value: any): value is Array<any>;
2
+ export declare function isDefined<T>(p: T | undefined | null): p is T | null;
3
+ export declare function hasValue<T>(p: T | null | undefined): p is T;
4
+ export declare function isFunction(value: any): value is (...args: any[]) => any;
5
+ export declare function isPromise(value: any): value is PromiseLike<any>;
6
+ export declare function isPromiseLike(value: any): value is PromiseLike<any>;
7
+ export declare function isUrl(url: any): url is URL;
8
+ export declare function _isIterator(value: any): value is Iterator<any>;
9
+ export declare function isIterator(value: any): value is IterableIterator<any>;
10
+ export declare function isAsyncIterator(value: any): value is AsyncIterableIterator<any>;
11
+ export declare function isIterable(value: any): value is Iterable<any>;
12
+ export declare function isAsyncIterable(value: any): value is AsyncIterable<any>;
13
+ export declare const GeneratorFunction: GeneratorFunction;
14
+ export declare const AsyncGeneratorFunction: AsyncGeneratorFunction;
15
+ export declare function isGeneratorFunction(value: any): value is GeneratorFunction;
16
+ export declare function isGenerator(value: any): value is Generator<any, any, any>;
17
+ export declare function isAsyncGeneratorFunction(value: any): value is AsyncGeneratorFunction;
18
+ export declare function isAsyncGenerator(value: any): value is AsyncGenerator<any, any, any>;
19
+ //# sourceMappingURL=is.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../src/is.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAA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K1F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,iBAAiB,CAE1E;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAEzE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,sBAAsB,CAEpF;AACD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAEnF"}
package/lib/is.js ADDED
@@ -0,0 +1,70 @@
1
+ export function isArray(value) {
2
+ return Array.isArray(value);
3
+ }
4
+ export function isDefined(p) {
5
+ return p !== undefined;
6
+ }
7
+ export function hasValue(p) {
8
+ return isDefined(p) && p !== null;
9
+ }
10
+ export function isFunction(value) {
11
+ return typeof (value) === 'function';
12
+ }
13
+ export function isPromise(value) {
14
+ return value instanceof Promise;
15
+ }
16
+ export function isPromiseLike(value) {
17
+ return isPromise(value) ||
18
+ getTypeName(value).includes('Promise') ||
19
+ isFunction(value?.then);
20
+ }
21
+ export function isUrl(url) {
22
+ return url instanceof URL;
23
+ }
24
+ function getTypeName(obj) {
25
+ return obj?.[Symbol.toStringTag]
26
+ ?? Object.prototype.toString.call(obj).replace(/^\[object (.+)]$/, '$1')
27
+ ?? obj?.constructor?.name;
28
+ }
29
+ export function _isIterator(value) {
30
+ return getTypeName(value).includes('Iterator') || isFunction(value?.next);
31
+ }
32
+ export function isIterator(value) {
33
+ return isIterable(value) && _isIterator(value);
34
+ }
35
+ export function isAsyncIterator(value) {
36
+ return isAsyncIterable(value) && _isIterator(value);
37
+ }
38
+ export function isIterable(value) {
39
+ return Symbol.iterator in value;
40
+ }
41
+ export function isAsyncIterable(value) {
42
+ return Symbol.asyncIterator in value;
43
+ }
44
+ const genExamp = function* () { };
45
+ const asyncGenExamp = async function* () { };
46
+ export const GeneratorFunction = genExamp.constructor;
47
+ export const AsyncGeneratorFunction = asyncGenExamp.constructor;
48
+ const asyncGeneratorProto = getProtoSquared(asyncGenExamp);
49
+ const generatorProto = getProtoSquared(genExamp);
50
+ export function isGeneratorFunction(value) {
51
+ return value instanceof GeneratorFunction;
52
+ }
53
+ export function isGenerator(value) {
54
+ return getProtoSquared(value) == generatorProto;
55
+ }
56
+ export function isAsyncGeneratorFunction(value) {
57
+ return value instanceof AsyncGeneratorFunction;
58
+ }
59
+ export function isAsyncGenerator(value) {
60
+ return getProtoSquared(value) === asyncGeneratorProto;
61
+ }
62
+ function getProtoSquared(obj) {
63
+ try {
64
+ return Reflect.getPrototypeOf(Reflect.getPrototypeOf(obj));
65
+ }
66
+ catch {
67
+ return undefined;
68
+ }
69
+ }
70
+ //# sourceMappingURL=is.js.map
package/lib/is.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is.js","sourceRoot":"","sources":["../src/is.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,KAAU;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AACD,MAAM,UAAU,SAAS,CAAI,CAAuB;IAChD,OAAO,CAAC,KAAK,SAAS,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAI,CAAuB;IAC/C,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;AACtC,CAAC;AAID,MAAM,UAAU,UAAU,CAAC,KAAU;IACjC,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAU;IAChC,OAAO,KAAK,YAAY,OAAO,CAAC;AACpC,CAAC;AACD,MAAM,UAAU,aAAa,CAAC,KAAU;IACpC,OAAO,SAAS,CAAC,KAAK,CAAC;QACnB,WAAW,CAAC,KAAK,CAAC,CAAC,QAAQ,CAA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a,CAAC,WAAqC,CAAC;AAE1F,MAAM,mBAAmB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;AAC3D,MAAM,cAAc,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAEjD,MAAM,UAAU,mBAAmB,CAAC,KAAU;IAC1C,OAAO,KAAK,YAAY,iBAAiB,CAAC;AAC9C,CAAC;AACD,MAAM,UAAU,WAAW,CAAC,KAAU;IAClC,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAU;IAC/C,OAAO,KAAK,YAAY,sBAAsB,CAAC;AACnD,CAAC;AACD,MAAM,UAAU,gBAAgB,CAAC,KAAU;IACvC,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,mBAAmB,CAAC;AAC1D,CAAC;AACD,SAAS,eAAe,CAAC,GAAQ;IAC7B,IAAI;QACA,OAAO,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAE,CAAC,CAAC;KAC/D;IAAC,MAAM;QACJ,OAAO,SAAS,CAAC;KACpB;AACL,CAAC","sourcesContent":["export function isArray(value: any): value is Array<any> {\n return Array.isArray(value);\n}\nexport function isDefined<T>(p: T | undefined | null): p is T | null {\n return p !== undefined;\n}\n\nexport function hasValue<T>(p: T | null | undefined): p is T {\n return isDefined(p) && p !== null;\n}\n\n\n\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof (value) === 'function';\n}\n\nexport function isPromise(value: any): value is PromiseLike<any> {\n return value instanceof Promise;\n}\nexport function isPromiseLike(value: any): value is PromiseLike<any> {\n return isPromise(value) ||\n getTypeName(value).includes('Promise') ||\n isFunction(value?.then);\n\n}\n\n\nexport function isUrl(url: any): url is URL {\n return url instanceof URL;\n}\n\nfunction getTypeName(obj: any): string {\n return obj?.[Symbol.toStringTag]\n ?? Object.prototype.toString.call(obj).replace(/^\\[object (.+)]$/, '$1')\n ?? obj?.constructor?.name;\n}\n\nexport function _isIterator(value: any): value is Iterator<any> {\n return getTypeName(value).includes('Iterator') || isFunction(value?.next);\n}\nexport function isIterator(value: any): value is IterableIterator<any> {\n return isIterable(value) && _isIterator(value);\n}\nexport function isAsyncIterator(value: any): value is AsyncIterableIterator<any> {\n return isAsyncIterable(value) && _isIterator(value);\n}\n\nexport function isIterable(value: any): value is Iterable<any> {\n return Symbol.iterator in value;\n}\nexport function isAsyncIterable(value: any): value is AsyncIterable<any> {\n return Symbol.asyncIterator in value;\n}\n\nconst genExamp = function* () { };\nconst asyncGenExamp = async function* () { };\n\nexport const GeneratorFunction = genExamp.constructor as GeneratorFunction;\nexport const AsyncGeneratorFunction = asyncGenExamp.constructor as AsyncGeneratorFunction;\n\nconst asyncGeneratorProto = getProtoSquared(asyncGenExamp);\nconst generatorProto = getProtoSquared(genExamp);\n\nexport function isGeneratorFunction(value: any): value is GeneratorFunction {\n return value instanceof GeneratorFunction;\n}\nexport function isGenerator(value: any): value is Generator<any, any, any> {\n return getProtoSquared(value) == generatorProto;\n}\n\nexport function isAsyncGeneratorFunction(value: any): value is AsyncGeneratorFunction {\n return value instanceof AsyncGeneratorFunction;\n}\nexport function isAsyncGenerator(value: any): value is AsyncGenerator<any, any, any> {\n return getProtoSquared(value) === asyncGeneratorProto;\n}\nfunction getProtoSquared(obj: any) {\n try {\n return Reflect.getPrototypeOf(Reflect.getPrototypeOf(obj)!);\n } catch {\n return undefined;\n }\n}\n"]}
@@ -2,10 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
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);
5
+ tslib_1.__exportStar(require("./is"), exports);
11
6
  //# sourceMappingURL=index.js.map
@@ -1 +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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,+CAAqB","sourcesContent":["export * from './assert-never';\nexport * from './is';\n"]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAsyncGenerator = exports.isAsyncGeneratorFunction = exports.isGenerator = exports.isGeneratorFunction = exports.AsyncGeneratorFunction = exports.GeneratorFunction = exports.isAsyncIterable = exports.isIterable = exports.isAsyncIterator = exports.isIterator = exports._isIterator = exports.isUrl = exports.isPromiseLike = exports.isPromise = exports.isFunction = exports.hasValue = exports.isDefined = exports.isArray = void 0;
4
+ function isArray(value) {
5
+ return Array.isArray(value);
6
+ }
7
+ exports.isArray = isArray;
8
+ function isDefined(p) {
9
+ return p !== undefined;
10
+ }
11
+ exports.isDefined = isDefined;
12
+ function hasValue(p) {
13
+ return isDefined(p) && p !== null;
14
+ }
15
+ exports.hasValue = hasValue;
16
+ function isFunction(value) {
17
+ return typeof (value) === 'function';
18
+ }
19
+ exports.isFunction = isFunction;
20
+ function isPromise(value) {
21
+ return value instanceof Promise;
22
+ }
23
+ exports.isPromise = isPromise;
24
+ function isPromiseLike(value) {
25
+ return isPromise(value) ||
26
+ getTypeName(value).includes('Promise') ||
27
+ isFunction(value?.then);
28
+ }
29
+ exports.isPromiseLike = isPromiseLike;
30
+ function isUrl(url) {
31
+ return url instanceof URL;
32
+ }
33
+ exports.isUrl = isUrl;
34
+ function getTypeName(obj) {
35
+ return obj?.[Symbol.toStringTag]
36
+ ?? Object.prototype.toString.call(obj).replace(/^\[object (.+)]$/, '$1')
37
+ ?? obj?.constructor?.name;
38
+ }
39
+ function _isIterator(value) {
40
+ return getTypeName(value).includes('Iterator') || isFunction(value?.next);
41
+ }
42
+ exports._isIterator = _isIterator;
43
+ function isIterator(value) {
44
+ return isIterable(value) && _isIterator(value);
45
+ }
46
+ exports.isIterator = isIterator;
47
+ function isAsyncIterator(value) {
48
+ return isAsyncIterable(value) && _isIterator(value);
49
+ }
50
+ exports.isAsyncIterator = isAsyncIterator;
51
+ function isIterable(value) {
52
+ return Symbol.iterator in value;
53
+ }
54
+ exports.isIterable = isIterable;
55
+ function isAsyncIterable(value) {
56
+ return Symbol.asyncIterator in value;
57
+ }
58
+ exports.isAsyncIterable = isAsyncIterable;
59
+ const genExamp = function* () { };
60
+ const asyncGenExamp = async function* () { };
61
+ exports.GeneratorFunction = genExamp.constructor;
62
+ exports.AsyncGeneratorFunction = asyncGenExamp.constructor;
63
+ const asyncGeneratorProto = getProtoSquared(asyncGenExamp);
64
+ const generatorProto = getProtoSquared(genExamp);
65
+ function isGeneratorFunction(value) {
66
+ return value instanceof exports.GeneratorFunction;
67
+ }
68
+ exports.isGeneratorFunction = isGeneratorFunction;
69
+ function isGenerator(value) {
70
+ return getProtoSquared(value) == generatorProto;
71
+ }
72
+ exports.isGenerator = isGenerator;
73
+ function isAsyncGeneratorFunction(value) {
74
+ return value instanceof exports.AsyncGeneratorFunction;
75
+ }
76
+ exports.isAsyncGeneratorFunction = isAsyncGeneratorFunction;
77
+ function isAsyncGenerator(value) {
78
+ return getProtoSquared(value) === asyncGeneratorProto;
79
+ }
80
+ exports.isAsyncGenerator = isAsyncGenerator;
81
+ function getProtoSquared(obj) {
82
+ try {
83
+ return Reflect.getPrototypeOf(Reflect.getPrototypeOf(obj));
84
+ }
85
+ catch {
86
+ return undef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CAAC;AAFD,4DAEC;AACD,SAAgB,gBAAgB,CAAC,KAAU;IACvC,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,mBAAmB,CAAC;AAC1D,CAAC;AAFD,4CAEC;AACD,SAAS,eAAe,CAAC,GAAQ;IAC7B,IAAI;QACA,OAAO,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAE,CAAC,CAAC;KAC/D;IAAC,MAAM;QACJ,OAAO,SAAS,CAAC;KACpB;AACL,CAAC","sourcesContent":["export function isArray(value: any): value is Array<any> {\n return Array.isArray(value);\n}\nexport function isDefined<T>(p: T | undefined | null): p is T | null {\n return p !== undefined;\n}\n\nexport function hasValue<T>(p: T | null | undefined): p is T {\n return isDefined(p) && p !== null;\n}\n\n\n\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof (value) === 'function';\n}\n\nexport function isPromise(value: any): value is PromiseLike<any> {\n return value instanceof Promise;\n}\nexport function isPromiseLike(value: any): value is PromiseLike<any> {\n return isPromise(value) ||\n getTypeName(value).includes('Promise') ||\n isFunction(value?.then);\n\n}\n\n\nexport function isUrl(url: any): url is URL {\n return url instanceof URL;\n}\n\nfunction getTypeName(obj: any): string {\n return obj?.[Symbol.toStringTag]\n ?? Object.prototype.toString.call(obj).replace(/^\\[object (.+)]$/, '$1')\n ?? obj?.constructor?.name;\n}\n\nexport function _isIterator(value: any): value is Iterator<any> {\n return getTypeName(value).includes('Iterator') || isFunction(value?.next);\n}\nexport function isIterator(value: any): value is IterableIterator<any> {\n return isIterable(value) && _isIterator(value);\n}\nexport function isAsyncIterator(value: any): value is AsyncIterableIterator<any> {\n return isAsyncIterable(value) && _isIterator(value);\n}\n\nexport function isIterable(value: any): value is Iterable<any> {\n return Symbol.iterator in value;\n}\nexport function isAsyncIterable(value: any): value is AsyncIterable<any> {\n return Symbol.asyncIterator in value;\n}\n\nconst genExamp = function* () { };\nconst asyncGenExamp = async function* () { };\n\nexport const GeneratorFunction = genExamp.constructor as GeneratorFunction;\nexport const AsyncGeneratorFunction = asyncGenExamp.constructor as AsyncGeneratorFunction;\n\nconst asyncGeneratorProto = getProtoSquared(asyncGenExamp);\nconst generatorProto = getProtoSquared(genExamp);\n\nexport function isGeneratorFunction(value: any): value is GeneratorFunction {\n return value instanceof GeneratorFunction;\n}\nexport function isGenerator(value: any): value is Generator<any, any, any> {\n return getProtoSquared(value) == generatorProto;\n}\n\nexport function isAsyncGeneratorFunction(value: any): value is AsyncGeneratorFunction {\n return value instanceof AsyncGeneratorFunction;\n}\nexport function isAsyncGenerator(value: any): value is AsyncGenerator<any, any, any> {\n return getProtoSquared(value) === asyncGeneratorProto;\n}\nfunction getProtoSquared(obj: any) {\n try {\n return Reflect.getPrototypeOf(Reflect.getPrototypeOf(obj)!);\n } catch {\n return undefined;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhombus-toolkit/type-guards",
3
- "version": "1.1.0",
3
+ "version": "1.2.2",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,19 +9,19 @@
9
9
  },
10
10
  "main": "lib/index.js",
11
11
  "sideEffects": false,
12
- "scripts": {
13
- "test": "heft test --clean",
14
- "build": "heft build --clean",
15
- "build:watch": "heft build"
16
- },
17
12
  "keywords": [],
18
13
  "author": "Thomas Butler",
19
14
  "dependencies": {
20
- "@rhombus-toolkit/func": "1.1.0"
15
+ "@rhombus-toolkit/func": "1.2.2"
21
16
  },
22
17
  "devDependencies": {
23
- "@rushstack/heft-web-rig": "^0.10.24",
24
-
25
- "@rushstack/heft": "^0.46.6"
18
+ "@rushstack/heft-web-rig": "^0.18.10",
19
+ "@rushstack/heft": "^0.56.0",
20
+ "typescript": "^5.1.3"
21
+ },
22
+ "scripts": {
23
+ "test": "heft test --clean",
24
+ "build": "heft build --clean",
25
+ "build:watch": "heft build"
26
26
  }
27
- }
27
+ }
@@ -0,0 +1,3 @@
1
+ Build cache hit.
2
+ Clearing cached folders: dist, lib, lib-amd, lib-commonjs, lib-es6, temp
3
+ Successfully restored output from the build cache.
@@ -0,0 +1,13 @@
1
+ Restoring cached log file at /home/tom/src/rhombus-toolkit/libraries/type-guards/.rush/temp/operation/build/all.log
2
+ Invoking: heft build --clean
3
+ ---- lifecycle started ----
4
+ ---- build started ----
5
+ [build:clean] Deleted 0 files and 3 folders
6
+ [build:sass-typings] Generating sass typings...
7
+ [build:sass-typings] Generated sass typings
8
+ [build:typescript] The TypeScript compiler version 5.1.3 is newer than the latest version that was tested with Heft (5.0); it may not work correctly.
9
+ [build:typescript] Using TypeScript version 5.1.3
10
+ [build:webpack] No Webpack configuration found
11
+ ---- build finished (2.584s) ----
12
+ ---- lifecycle finished (2.586s) ----
13
+ -------------------- Finished (2.588s) --------------------
package/src/index.ts CHANGED
@@ -1,7 +1,2 @@
1
1
  export * from './assert-never';
2
- export * from './is-array';
3
- export * from './is-defined';
4
- export * from './is-function';
5
- export * from './is-promise';
6
- export * from './is-url';
7
- export * from './iterables';
2
+ export * from './is';
package/src/is.ts ADDED
@@ -0,0 +1,84 @@
1
+ export function isArray(value: any): value is Array<any> {
2
+ return Array.isArray(value);
3
+ }
4
+ export function isDefined<T>(p: T | undefined | null): p is T | null {
5
+ return p !== undefined;
6
+ }
7
+
8
+ export function hasValue<T>(p: T | null | undefined): p is T {
9
+ return isDefined(p) && p !== null;
10
+ }
11
+
12
+
13
+
14
+ export function isFunction(value: any): value is (...args: any[]) => any {
15
+ return typeof (value) === 'function';
16
+ }
17
+
18
+ export function isPromise(value: any): value is PromiseLike<any> {
19
+ return value instanceof Promise;
20
+ }
21
+ export function isPromiseLike(value: any): value is PromiseLike<any> {
22
+ return isPromise(value) ||
23
+ getTypeName(value).includes('Promise') ||
24
+ isFunction(value?.then);
25
+
26
+ }
27
+
28
+
29
+ export function isUrl(url: any): url is URL {
30
+ return url instanceof URL;
31
+ }
32
+
33
+ function getTypeName(obj: any): string {
34
+ return obj?.[Symbol.toStringTag]
35
+ ?? Object.prototype.toString.call(obj).replace(/^\[object (.+)]$/, '$1')
36
+ ?? obj?.constructor?.name;
37
+ }
38
+
39
+ export function _isIterator(value: any): value is Iterator<any> {
40
+ return getTypeName(value).includes('Iterator') || isFunction(value?.next);
41
+ }
42
+ export function isIterator(value: any): value is IterableIterator<any> {
43
+ return isIterable(value) && _isIterator(value);
44
+ }
45
+ export function isAsyncIterator(value: any): value is AsyncIterableIterator<any> {
46
+ return isAsyncIterable(value) && _isIterator(value);
47
+ }
48
+
49
+ export function isIterable(value: any): value is Iterable<any> {
50
+ return Symbol.iterator in value;
51
+ }
52
+ export function isAsyncIterable(value: any): value is AsyncIterable<any> {
53
+ return Symbol.asyncIterator in value;
54
+ }
55
+
56
+ const genExamp = function* () { };
57
+ const asyncGenExamp = async function* () { };
58
+
59
+ export const GeneratorFunction = genExamp.constructor as GeneratorFunction;
60
+ export const AsyncGeneratorFunction = asyncGenExamp.constructor as AsyncGeneratorFunction;
61
+
62
+ const asyncGeneratorProto = getProtoSquared(asyncGenExamp);
63
+ const generatorProto = getProtoSquared(genExamp);
64
+
65
+ export function isGeneratorFunction(value: any): value is GeneratorFunction {
66
+ return value instanceof GeneratorFunction;
67
+ }
68
+ export function isGenerator(value: any): value is Generator<any, any, any> {
69
+ return getProtoSquared(value) == generatorProto;
70
+ }
71
+
72
+ export function isAsyncGeneratorFunction(value: any): value is AsyncGeneratorFunction {
73
+ return value instanceof AsyncGeneratorFunction;
74
+ }
75
+ export function isAsyncGenerator(value: any): value is AsyncGenerator<any, any, any> {
76
+ return getProtoSquared(value) === asyncGeneratorProto;
77
+ }
78
+ function getProtoSquared(obj: any) {
79
+ try {
80
+ return Reflect.getPrototypeOf(Reflect.getPrototypeOf(obj)!);
81
+ } catch {
82
+ return undefined;
83
+ }
84
+ }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es5.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.esnext.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.dom.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/assert-never.ts","../../src/is.ts","../../src/index.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"930b0e15811f84e203d3c23508674d5ded88266df4b10abee7b31b2ac77632d2","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"4166dead50f6e842380ea09c3c06eba469fcf9dfa85869f242081c96b594c579","signature":"d2e3a4f4548e94f2177a0eaabcc4ac2295cbe55f55ab8bc5b24cfffddd473aa9"},{"version":"d62d6fc3f23885822d57d4dff0dffb316a447e66e127e9943be942e0cd0b5dc3","signature":"b252a9a572b28318bb13ceabb429b368065515bbd2a6e404e8d958234a3a1497"},"10bcaaacc7fe02ca41130aa61385e1aa4595311bdfe25544addc45cd6da6dafb"],"root":[[61,63]],"options":{"allowUnreachableCode":false,"declaration":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"jsx":2,"module":99,"noEmitOnError":false,"outDir":"../../lib","rootDir":"../../src","sourceMap":true,"strict":true,"target":99,"tsBuildInfoFile":"./ts_VRykbCrU.json","useUnknownInCatchVariables":false},"fileIdsList":[[61,62]],"referencedMap":[[63,1]],"exportedModulesMap":[[63,1]],"semanticDiagnosticsPerFile":[59,60,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,10,1,11,58,61,63,62]},"version":"5.1.3"}
package/tsconfig.json CHANGED
@@ -1,4 +1,10 @@
1
1
  {
2
2
  "extends": "@rushstack/heft-web-rig/profiles/library/tsconfig-base.json",
3
- "compilerOptions": { "target": "ESNext", "lib": ["ESNext", "DOM"] }
3
+ "compilerOptions": {
4
+ "target": "ESNext",
5
+ "lib": [
6
+ "ESNext", "DOM"
7
+ ],
8
+ "types": []
9
+ }
4
10
  }
@@ -1,7 +0,0 @@
1
- // THIS DATA FILE IS INTERNAL TO HEFT; DO NOT MODIFY IT OR RELY ON ITS CONTENTS
2
- {
3
- "emitFolderNameForTests": "lib-commonjs",
4
- "extensionForTests": ".js",
5
- "skipTimestampCheck": true,
6
- "isTypeScriptProject": true
7
- }
package/lib/is-array.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function isArray(value: any): value is Array<any>;
2
- //# sourceMappingURL=is-array.d.ts.map
@@ -1 +0,0 @@
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 DELETED
@@ -1,4 +0,0 @@
1
- export function isArray(value) {
2
- return Array.isArray(value);
3
- }
4
- //# sourceMappingURL=is-array.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,3 +0,0 @@
1
- export declare function isDefined<T>(p: T | null | undefined): p is T;
2
- export declare function isNotDefined<T>(p: T | null | undefined): p is undefined | null;
3
- //# sourceMappingURL=is-defined.d.ts.map
@@ -1 +0,0 @@
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"}
package/lib/is-defined.js DELETED
@@ -1,7 +0,0 @@
1
- export function isDefined(p) {
2
- return p !== undefined && p !== null;
3
- }
4
- export function isNotDefined(p) {
5
- return p === undefined || p === null;
6
- }
7
- //# sourceMappingURL=is-defined.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,2 +0,0 @@
1
- export declare function isFunction(value: any): value is (...args: any[]) => any;
2
- //# sourceMappingURL=is-function.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,4 +0,0 @@
1
- export function isFunction(value) {
2
- return typeof (value) === 'function';
3
- }
4
- //# sourceMappingURL=is-function.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,2 +0,0 @@
1
- export declare function isPromiseLike(value: any): value is PromiseLike<any>;
2
- //# sourceMappingURL=is-promise.d.ts.map
@@ -1 +0,0 @@
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"}