@rhombus-toolkit/type-guards 1.3.3 → 2.0.1
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/LICENSE +21 -0
- package/dist/bundle/index.d.ts +46 -0
- package/dist/bundle/index.js +114 -0
- package/package.json +22 -10
- package/.rush/temp/07fbf11b07b6f1116afc0020a3ced18a67701679.log +0 -10
- package/.rush/temp/1b7043255c0cb82312fe06aea1e4f980a585dca8.log +0 -30
- package/.rush/temp/22fc11d6cfe8433096a20796f50cfc5a7e686750.log +0 -30
- package/.rush/temp/24b38ca5a2048acddbd6a7f3792ac5aa7b4be2d6.log +0 -10
- package/.rush/temp/2b7adeffb7e5e639816c4011e6733a69e9a4df19.log +0 -30
- package/.rush/temp/444be081f1907e835388474c4e294ead64669196.log +0 -10
- package/.rush/temp/491c97b9b94d3bf81cb21df01fb87ce043198629.log +0 -30
- package/.rush/temp/4b3179751f77c172006323a6945176be854b227f.log +0 -10
- package/.rush/temp/4d53306a8221ecad2c12406c210e6d53d5fce718.log +0 -30
- package/.rush/temp/4f79644f150b0fc10b9732e6c6eca10b6274f9c8.log +0 -30
- package/.rush/temp/5346ebe924d38207ec5f7799bb3245612921e340.log +0 -30
- package/.rush/temp/53d326ec8c3ccb0f1ed2aaaa468824e7e0ad2616.log +0 -30
- package/.rush/temp/555ff49f011b1164f0a29b3c841a139273145ea0.log +0 -10
- package/.rush/temp/6413579a90996a66fb4514640a826e46453fa7c6.log +0 -10
- package/.rush/temp/6850e1738e6992b1bda8e9264b8bd84454ac2403.log +0 -30
- package/.rush/temp/6b31c9d0985de3e1bf6c2f61f4659029d2869e94.log +0 -30
- package/.rush/temp/6c702a94179fe45bfc4dbe7cb0ea532f8f2ff643.log +0 -10
- package/.rush/temp/7986cb9e1b8a00a00c9b58ecfbc6ab0d5d3f0d4d.log +0 -10
- package/.rush/temp/79faa669fde4198bd109034fb72c6bc1f75440b6.log +0 -30
- package/.rush/temp/801bc682faef5ceaadd914a4a9ba0c1274345eef.log +0 -30
- package/.rush/temp/83985e8ed7ec7c1ac0b0710e034b74f3be829694.log +0 -30
- package/.rush/temp/8f06b47e2b379717f8baadc42ed6b0d147d75e9f.log +0 -30
- package/.rush/temp/9281bc3ee58188f07b1f0284fe26086047403b41.log +0 -30
- package/.rush/temp/9409e86a876625b894f48711da774dcaa4c4810c.log +0 -30
- package/.rush/temp/9c91aeb894c1b6af3d7b805b3d60d518330ca5f8.log +0 -10
- package/.rush/temp/a14953ebabab8e22a2d792cc0608b3adec497f8c.log +0 -30
- package/.rush/temp/a28d2e2f3b4ea22cf01422daf930997569ddb8e3.log +0 -10
- package/.rush/temp/a51813339808da8d19a44091db328b84c23e90a0.log +0 -10
- package/.rush/temp/a8436c4655e781b8bf5cd2862edf5afe3abeedec.log +0 -30
- package/.rush/temp/adcf6a3ca84d17fbf5b045055bda39a9164f33ce.log +0 -30
- package/.rush/temp/af2e2d3c89ff2a4302a1939f0bdb203d9229df59.log +0 -30
- package/.rush/temp/b04a4fe1b60d7a087249d3aaacd620f4be3d220e.log +0 -30
- package/.rush/temp/b4432fb3e2c34ec64b7211da07dd68b1617f60c7.log +0 -30
- package/.rush/temp/b49c8226f64cb0eed1864e56e173226dd00beb1d.log +0 -10
- package/.rush/temp/b7a45db22cf25abcdec7cfa7fe8e413c6fb53506.log +0 -30
- package/.rush/temp/bd4e192c789a002310ca3648682beece38729daf.log +0 -30
- package/.rush/temp/c8625c04a6ad6079e617c9eded6f396c5f37de34.log +0 -30
- package/.rush/temp/d52ff6fb886f69b59fee2a755bd9d9dfe5f13531.log +0 -30
- package/.rush/temp/d8f6345ffb8b1e1552e29a5baf4b1bb386b81096.log +0 -30
- package/.rush/temp/d97519a714fed69cb25a7b063ab78a448cd6cba7.log +0 -30
- package/.rush/temp/d97ff8c26f757ad346315b35228427d233b962e9.log +0 -10
- package/.rush/temp/e78ae62e171e6f4b1be159d6025ea6c8f8e61cfc.log +0 -30
- package/.rush/temp/ea90769d0e414c8493ab5b2b2cf05ba7305d946d.log +0 -10
- package/.rush/temp/f53b9c96b74a46dc51eaf6d82d3e3453309082a7.log +0 -30
- package/.rush/temp/operation/build/all.log +0 -13
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/package-deps_build.json +0 -14
- package/.rush/temp/shrinkwrap-deps.json +0 -68
- package/CHANGELOG.json +0 -172
- package/CHANGELOG.md +0 -73
- package/config/rig.json +0 -6
- package/lib/assert-never.d.ts +0 -2
- package/lib/assert-never.d.ts.map +0 -1
- package/lib/assert-never.js +0 -4
- package/lib/assert-never.js.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/lib/is.d.ts +0 -19
- package/lib/is.d.ts.map +0 -1
- package/lib/is.js +0 -70
- package/lib/is.js.map +0 -1
- package/lib-commonjs/assert-never.js +0 -8
- package/lib-commonjs/assert-never.js.map +0 -1
- package/lib-commonjs/index.js +0 -19
- package/lib-commonjs/index.js.map +0 -1
- package/lib-commonjs/is.js +0 -89
- package/lib-commonjs/is.js.map +0 -1
- package/rush-logs/type-guards.build.cache.log +0 -3
- package/rush-logs/type-guards.build.log +0 -13
- package/src/assert-never.ts +0 -3
- package/src/index.ts +0 -2
- package/src/is.ts +0 -84
- package/temp/build.typescript/ts_VRykbCrU.json +0 -1
- package/tsconfig.json +0 -3
package/lib-commonjs/is.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
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 undefined;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=is.js.map
|
package/lib-commonjs/is.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is.js","sourceRoot":"","sources":["../src/is.ts"],"names":[],"mappings":";;;A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D,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"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Invoking: heft build --clean
|
|
2
|
-
---- lifecycle started ----
|
|
3
|
-
---- build started ----
|
|
4
|
-
[build:clean] Deleted 19 files and 0 folders
|
|
5
|
-
[build:sass-typings] Generating sass typings...
|
|
6
|
-
[build:sass-typings] Generated sass typings
|
|
7
|
-
[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.
|
|
8
|
-
[build:typescript] Using TypeScript version 5.1.3
|
|
9
|
-
[build:typescript] Asynchronously transpiling /home/tom/src/rhombus-toolkit/libraries/type-guards/tsconfig.json
|
|
10
|
-
[build:webpack] No Webpack configuration found
|
|
11
|
-
---- build finished (3.391s) ----
|
|
12
|
-
---- lifecycle finished (3.396s) ----
|
|
13
|
-
-------------------- Finished (3.398s) --------------------
|
package/src/assert-never.ts
DELETED
package/src/index.ts
DELETED
package/src/is.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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.scripthost.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":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","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":[[62,64]],"options":{"allowUnreachableCode":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":false,"importHelpers":false,"inlineSources":true,"jsx":2,"module":99,"noEmitOnError":false,"outDir":"../../lib","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"tsBuildInfoFile":"./ts_VRykbCrU.json","useUnknownInCatchVariables":true},"fileIdsList":[[62,63]],"referencedMap":[[64,1]],"exportedModulesMap":[[64,1]],"semanticDiagnosticsPerFile":[60,61,12,15,14,2,16,17,18,19,20,21,22,23,3,4,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,58,10,1,11,59,13,62,64,63]},"version":"5.1.3"}
|
package/tsconfig.json
DELETED