@dxos/invariant 0.8.3 → 0.8.4-main.05e74ebcff
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 +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/assert.d.ts +1 -1
- package/dist/types/src/assert.d.ts.map +1 -1
- package/dist/types/src/invariant.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/src/assert.ts +4 -3
- package/dist/lib/node/index.cjs +0 -106
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -18,4 +18,4 @@ pnpm i @dxos/invariant
|
|
|
18
18
|
|
|
19
19
|
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
20
20
|
|
|
21
|
-
License: [
|
|
21
|
+
License: [FSL-1.1-Apache-2.0](./LICENSE) Copyright 2022 © DXOS
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// src/invariant.ts
|
|
2
2
|
var invariant = (condition, message, meta) => {
|
|
3
3
|
if (condition) {
|
|
4
4
|
return;
|
|
@@ -52,10 +52,10 @@ var failedInvariant = (message1, message2, meta) => {
|
|
|
52
52
|
throw new InvariantViolation(errorMessage);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
//
|
|
56
|
-
var assertArgument = (condition, message) => {
|
|
55
|
+
// src/assert.ts
|
|
56
|
+
var assertArgument = (condition, argumentName, message) => {
|
|
57
57
|
if (!condition) {
|
|
58
|
-
const error = new TypeError(message);
|
|
58
|
+
const error = new TypeError(`Invalid argument \`${argumentName}\`` + (message ? `: ${message}` : ""));
|
|
59
59
|
Error.captureStackTrace(error, assertArgument);
|
|
60
60
|
throw error;
|
|
61
61
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/invariant.ts", "../../../src/assert.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CallMetadata } from './meta';\n\nexport type InvariantFn = (condition: unknown, message?: string, meta?: CallMetadata) => asserts condition;\n\n/**\n * Asserts that the condition is true.\n *\n * @param message Optional message. If it starts with \"BUG\" then the program will break if this invariant fails if the debugger is attached.\n */\nexport const invariant: InvariantFn = (\n condition: unknown,\n message?: string,\n meta?: CallMetadata,\n): asserts condition => {\n if (condition) {\n return;\n }\n\n if (message?.startsWith('BUG')) {\n // This invariant is a debug bug-check: break if the debugger is attached.\n // eslint-disable-next-line no-debugger\n debugger;\n }\n\n let errorMessage = 'invariant violation';\n\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n const error = new InvariantViolation(errorMessage);\n\n // Do not include the invariant function in the stack trace.\n Error.captureStackTrace(error, invariant);\n\n throw error;\n};\n\nexport class InvariantViolation extends Error {\n constructor(message: string) {\n super(message);\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nconst getRelativeFilename = (filename: string) => {\n // TODO(burdon): Hack uses \"packages\" as an anchor (pre-parse NX?)\n // Including `packages/` part of the path so that excluded paths (e.g. from dist) are clickable in vscode.\n const match = filename.match(/.+\\/(packages\\/.+\\/.+)/);\n if (match) {\n const [, filePath] = match;\n return filePath;\n }\n\n return filename;\n};\n\nexport const failedInvariant = (message1?: unknown, message2?: string, meta?: CallMetadata): never => {\n let errorMessage = 'invariant violation';\n\n const message = [message1, message2].filter((str) => typeof str === 'string').join(' ');\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n throw new InvariantViolation(errorMessage);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Use this to assert the arguments of a function.\n *\n * @example\n * ```ts\n * function foo(arg: string) {\n * assertArgument(typeof arg === 'string', 'arg must be a string');\n * }\n * ```\n */\n// TODO(dmaretskyi): Rename assertParameter.\nexport const assertArgument: (condition: unknown,
|
|
5
|
-
"mappings": ";AAaO,IAAMA,YAAyB,CACpCC,WACAC,SACAC,SAAAA;AAEA,MAAIF,WAAW;AACb;EACF;AAEA,MAAIC,SAASE,WAAW,KAAA,GAAQ;AAG9B;EACF;AAEA,MAAIC,eAAe;AAEnB,MAAIH,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAMC,QAAQ,IAAIC,mBAAmBN,YAAAA;AAGrCO,QAAMC,kBAAkBH,OAAOV,SAAAA;AAE/B,QAAMU;AACR;AAEO,IAAMC,qBAAN,cAAiCC,MAAAA;EACtC,YAAYV,SAAiB;AAC3B,UAAMA,OAAAA;AAENY,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAEA,IAAMR,sBAAsB,CAACS,aAAAA;AAG3B,QAAMC,QAAQD,SAASC,MAAM,wBAAA;AAC7B,MAAIA,OAAO;AACT,UAAM,CAAA,EAAGC,QAAAA,IAAYD;AACrB,WAAOC;EACT;AAEA,SAAOF;AACT;AAEO,IAAMG,kBAAkB,CAACC,UAAoBC,UAAmBnB,SAAAA;AACrE,MAAIE,eAAe;AAEnB,QAAMH,UAAU;IAACmB;IAAUC;IAAUC,OAAO,CAACC,QAAQ,OAAOA,QAAQ,QAAA,EAAUC,KAAK,GAAA;AACnF,MAAIvB,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAM,IAAIE,mBAAmBN,YAAAA;AAC/B;;;ACxEO,IAAMqB,
|
|
6
|
-
"names": ["invariant", "condition", "message", "meta", "startsWith", "errorMessage", "A", "F", "getRelativeFilename", "L", "error", "InvariantViolation", "Error", "captureStackTrace", "Object", "setPrototypeOf", "prototype", "filename", "match", "filePath", "failedInvariant", "message1", "message2", "filter", "str", "join", "assertArgument", "condition", "message", "error", "TypeError", "Error", "captureStackTrace", "assertState", "InvalidStateError"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CallMetadata } from './meta';\n\nexport type InvariantFn = (condition: unknown, message?: string, meta?: CallMetadata) => asserts condition;\n\n/**\n * Asserts that the condition is true.\n *\n * @param message Optional message. If it starts with \"BUG\" then the program will break if this invariant fails if the debugger is attached.\n */\nexport const invariant: InvariantFn = (\n condition: unknown,\n message?: string,\n meta?: CallMetadata,\n): asserts condition => {\n if (condition) {\n return;\n }\n\n if (message?.startsWith('BUG')) {\n // This invariant is a debug bug-check: break if the debugger is attached.\n // eslint-disable-next-line no-debugger\n debugger;\n }\n\n let errorMessage = 'invariant violation';\n\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n const error = new InvariantViolation(errorMessage);\n\n // Do not include the invariant function in the stack trace.\n Error.captureStackTrace(error, invariant);\n\n throw error;\n};\n\nexport class InvariantViolation extends Error {\n constructor(message: string) {\n super(message);\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nconst getRelativeFilename = (filename: string) => {\n // TODO(burdon): Hack uses \"packages\" as an anchor (pre-parse NX?)\n // Including `packages/` part of the path so that excluded paths (e.g. from dist) are clickable in vscode.\n const match = filename.match(/.+\\/(packages\\/.+\\/.+)/);\n if (match) {\n const [, filePath] = match;\n return filePath;\n }\n\n return filename;\n};\n\nexport const failedInvariant = (message1?: unknown, message2?: string, meta?: CallMetadata): never => {\n let errorMessage = 'invariant violation';\n\n const message = [message1, message2].filter((str) => typeof str === 'string').join(' ');\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n throw new InvariantViolation(errorMessage);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Use this to assert the arguments of a function.\n *\n * @example\n * ```ts\n * function foo(arg: string) {\n * assertArgument(typeof arg === 'string', 'arg must be a string');\n * }\n * ```\n */\n// TODO(dmaretskyi): Rename assertParameter.\nexport const assertArgument: (condition: unknown, argumentName: string, message?: string) => asserts condition = (\n condition: unknown,\n argumentName: string,\n message?: string,\n): asserts condition => {\n if (!condition) {\n const error = new TypeError(`Invalid argument \\`${argumentName}\\`` + (message ? `: ${message}` : ''));\n Error.captureStackTrace(error, assertArgument);\n throw error;\n }\n};\n\n/**\n * Use this to assert the state of an object.\n *\n * @example\n * ```ts\n * class Foo {\n * private _bar: boolean;\n *\n * public get bar() {\n * assertState(this._bar, 'bar must be true');\n * return this._bar;\n * }\n * }\n *\n * const foo = new Foo();\n * foo.bar = false; // This will throw an InvalidStateError\n * ```\n */\nexport const assertState: (condition: unknown, message: string) => asserts condition = (\n condition: unknown,\n message: string,\n): asserts condition => {\n if (!condition) {\n const error = new InvalidStateError(message);\n Error.captureStackTrace(error, assertState);\n throw error;\n }\n};\n\n// TODO(dmaretskyi): Consider how this correlates to effect errors. Intuitively, this should be a defect, not a checked error.\nexport class InvalidStateError extends Error {}\n"],
|
|
5
|
+
"mappings": ";AAaO,IAAMA,YAAyB,CACpCC,WACAC,SACAC,SAAAA;AAEA,MAAIF,WAAW;AACb;EACF;AAEA,MAAIC,SAASE,WAAW,KAAA,GAAQ;AAG9B;EACF;AAEA,MAAIC,eAAe;AAEnB,MAAIH,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAMC,QAAQ,IAAIC,mBAAmBN,YAAAA;AAGrCO,QAAMC,kBAAkBH,OAAOV,SAAAA;AAE/B,QAAMU;AACR;AAEO,IAAMC,qBAAN,cAAiCC,MAAAA;EACtC,YAAYV,SAAiB;AAC3B,UAAMA,OAAAA;AAENY,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAEA,IAAMR,sBAAsB,CAACS,aAAAA;AAG3B,QAAMC,QAAQD,SAASC,MAAM,wBAAA;AAC7B,MAAIA,OAAO;AACT,UAAM,CAAA,EAAGC,QAAAA,IAAYD;AACrB,WAAOC;EACT;AAEA,SAAOF;AACT;AAEO,IAAMG,kBAAkB,CAACC,UAAoBC,UAAmBnB,SAAAA;AACrE,MAAIE,eAAe;AAEnB,QAAMH,UAAU;IAACmB;IAAUC;IAAUC,OAAO,CAACC,QAAQ,OAAOA,QAAQ,QAAA,EAAUC,KAAK,GAAA;AACnF,MAAIvB,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAM,IAAIE,mBAAmBN,YAAAA;AAC/B;;;ACxEO,IAAMqB,iBAAoG,CAC/GC,WACAC,cACAC,YAAAA;AAEA,MAAI,CAACF,WAAW;AACd,UAAMG,QAAQ,IAAIC,UAAU,sBAAsBH,YAAAA,QAAoBC,UAAU,KAAKA,OAAAA,KAAY,GAAC;AAClGG,UAAMC,kBAAkBH,OAAOJ,cAAAA;AAC/B,UAAMI;EACR;AACF;AAoBO,IAAMI,cAA0E,CACrFP,WACAE,YAAAA;AAEA,MAAI,CAACF,WAAW;AACd,UAAMG,QAAQ,IAAIK,kBAAkBN,OAAAA;AACpCG,UAAMC,kBAAkBH,OAAOI,WAAAA;AAC/B,UAAMJ;EACR;AACF;AAGO,IAAMK,oBAAN,cAAgCH,MAAAA;AAAO;",
|
|
6
|
+
"names": ["invariant", "condition", "message", "meta", "startsWith", "errorMessage", "A", "F", "getRelativeFilename", "L", "error", "InvariantViolation", "Error", "captureStackTrace", "Object", "setPrototypeOf", "prototype", "filename", "match", "filePath", "failedInvariant", "message1", "message2", "filter", "str", "join", "assertArgument", "condition", "argumentName", "message", "error", "TypeError", "Error", "captureStackTrace", "assertState", "InvalidStateError"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"
|
|
1
|
+
{"inputs":{"src/invariant.ts":{"bytes":7562,"imports":[],"format":"esm"},"src/assert.ts":{"bytes":4370,"imports":[],"format":"esm"},"src/index.ts":{"bytes":463,"imports":[{"path":"src/invariant.ts","kind":"import-statement","original":"./invariant"},{"path":"src/assert.ts","kind":"import-statement","original":"./assert"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5989},"dist/lib/browser/index.mjs":{"imports":[],"exports":["InvalidStateError","InvariantViolation","assertArgument","assertState","failedInvariant","invariant"],"entryPoint":"src/index.ts","inputs":{"src/invariant.ts":{"bytesInOutput":1308},"src/index.ts":{"bytesInOutput":0},"src/assert.ts":{"bytesInOutput":500}},"bytes":2000}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// src/invariant.ts
|
|
4
4
|
var invariant = (condition, message, meta) => {
|
|
5
5
|
if (condition) {
|
|
6
6
|
return;
|
|
@@ -54,10 +54,10 @@ var failedInvariant = (message1, message2, meta) => {
|
|
|
54
54
|
throw new InvariantViolation(errorMessage);
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
//
|
|
58
|
-
var assertArgument = (condition, message) => {
|
|
57
|
+
// src/assert.ts
|
|
58
|
+
var assertArgument = (condition, argumentName, message) => {
|
|
59
59
|
if (!condition) {
|
|
60
|
-
const error = new TypeError(message);
|
|
60
|
+
const error = new TypeError(`Invalid argument \`${argumentName}\`` + (message ? `: ${message}` : ""));
|
|
61
61
|
Error.captureStackTrace(error, assertArgument);
|
|
62
62
|
throw error;
|
|
63
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/invariant.ts", "../../../src/assert.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CallMetadata } from './meta';\n\nexport type InvariantFn = (condition: unknown, message?: string, meta?: CallMetadata) => asserts condition;\n\n/**\n * Asserts that the condition is true.\n *\n * @param message Optional message. If it starts with \"BUG\" then the program will break if this invariant fails if the debugger is attached.\n */\nexport const invariant: InvariantFn = (\n condition: unknown,\n message?: string,\n meta?: CallMetadata,\n): asserts condition => {\n if (condition) {\n return;\n }\n\n if (message?.startsWith('BUG')) {\n // This invariant is a debug bug-check: break if the debugger is attached.\n // eslint-disable-next-line no-debugger\n debugger;\n }\n\n let errorMessage = 'invariant violation';\n\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n const error = new InvariantViolation(errorMessage);\n\n // Do not include the invariant function in the stack trace.\n Error.captureStackTrace(error, invariant);\n\n throw error;\n};\n\nexport class InvariantViolation extends Error {\n constructor(message: string) {\n super(message);\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nconst getRelativeFilename = (filename: string) => {\n // TODO(burdon): Hack uses \"packages\" as an anchor (pre-parse NX?)\n // Including `packages/` part of the path so that excluded paths (e.g. from dist) are clickable in vscode.\n const match = filename.match(/.+\\/(packages\\/.+\\/.+)/);\n if (match) {\n const [, filePath] = match;\n return filePath;\n }\n\n return filename;\n};\n\nexport const failedInvariant = (message1?: unknown, message2?: string, meta?: CallMetadata): never => {\n let errorMessage = 'invariant violation';\n\n const message = [message1, message2].filter((str) => typeof str === 'string').join(' ');\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n throw new InvariantViolation(errorMessage);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Use this to assert the arguments of a function.\n *\n * @example\n * ```ts\n * function foo(arg: string) {\n * assertArgument(typeof arg === 'string', 'arg must be a string');\n * }\n * ```\n */\n// TODO(dmaretskyi): Rename assertParameter.\nexport const assertArgument: (condition: unknown,
|
|
5
|
-
"mappings": ";;;AAaO,IAAMA,YAAyB,CACpCC,WACAC,SACAC,SAAAA;AAEA,MAAIF,WAAW;AACb;EACF;AAEA,MAAIC,SAASE,WAAW,KAAA,GAAQ;AAG9B;EACF;AAEA,MAAIC,eAAe;AAEnB,MAAIH,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAMC,QAAQ,IAAIC,mBAAmBN,YAAAA;AAGrCO,QAAMC,kBAAkBH,OAAOV,SAAAA;AAE/B,QAAMU;AACR;AAEO,IAAMC,qBAAN,cAAiCC,MAAAA;EACtC,YAAYV,SAAiB;AAC3B,UAAMA,OAAAA;AAENY,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAEA,IAAMR,sBAAsB,CAACS,aAAAA;AAG3B,QAAMC,QAAQD,SAASC,MAAM,wBAAA;AAC7B,MAAIA,OAAO;AACT,UAAM,CAAA,EAAGC,QAAAA,IAAYD;AACrB,WAAOC;EACT;AAEA,SAAOF;AACT;AAEO,IAAMG,kBAAkB,CAACC,UAAoBC,UAAmBnB,SAAAA;AACrE,MAAIE,eAAe;AAEnB,QAAMH,UAAU;IAACmB;IAAUC;IAAUC,OAAO,CAACC,QAAQ,OAAOA,QAAQ,QAAA,EAAUC,KAAK,GAAA;AACnF,MAAIvB,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAM,IAAIE,mBAAmBN,YAAAA;AAC/B;;;ACxEO,IAAMqB,
|
|
6
|
-
"names": ["invariant", "condition", "message", "meta", "startsWith", "errorMessage", "A", "F", "getRelativeFilename", "L", "error", "InvariantViolation", "Error", "captureStackTrace", "Object", "setPrototypeOf", "prototype", "filename", "match", "filePath", "failedInvariant", "message1", "message2", "filter", "str", "join", "assertArgument", "condition", "message", "error", "TypeError", "Error", "captureStackTrace", "assertState", "InvalidStateError"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CallMetadata } from './meta';\n\nexport type InvariantFn = (condition: unknown, message?: string, meta?: CallMetadata) => asserts condition;\n\n/**\n * Asserts that the condition is true.\n *\n * @param message Optional message. If it starts with \"BUG\" then the program will break if this invariant fails if the debugger is attached.\n */\nexport const invariant: InvariantFn = (\n condition: unknown,\n message?: string,\n meta?: CallMetadata,\n): asserts condition => {\n if (condition) {\n return;\n }\n\n if (message?.startsWith('BUG')) {\n // This invariant is a debug bug-check: break if the debugger is attached.\n // eslint-disable-next-line no-debugger\n debugger;\n }\n\n let errorMessage = 'invariant violation';\n\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n const error = new InvariantViolation(errorMessage);\n\n // Do not include the invariant function in the stack trace.\n Error.captureStackTrace(error, invariant);\n\n throw error;\n};\n\nexport class InvariantViolation extends Error {\n constructor(message: string) {\n super(message);\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nconst getRelativeFilename = (filename: string) => {\n // TODO(burdon): Hack uses \"packages\" as an anchor (pre-parse NX?)\n // Including `packages/` part of the path so that excluded paths (e.g. from dist) are clickable in vscode.\n const match = filename.match(/.+\\/(packages\\/.+\\/.+)/);\n if (match) {\n const [, filePath] = match;\n return filePath;\n }\n\n return filename;\n};\n\nexport const failedInvariant = (message1?: unknown, message2?: string, meta?: CallMetadata): never => {\n let errorMessage = 'invariant violation';\n\n const message = [message1, message2].filter((str) => typeof str === 'string').join(' ');\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n throw new InvariantViolation(errorMessage);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Use this to assert the arguments of a function.\n *\n * @example\n * ```ts\n * function foo(arg: string) {\n * assertArgument(typeof arg === 'string', 'arg must be a string');\n * }\n * ```\n */\n// TODO(dmaretskyi): Rename assertParameter.\nexport const assertArgument: (condition: unknown, argumentName: string, message?: string) => asserts condition = (\n condition: unknown,\n argumentName: string,\n message?: string,\n): asserts condition => {\n if (!condition) {\n const error = new TypeError(`Invalid argument \\`${argumentName}\\`` + (message ? `: ${message}` : ''));\n Error.captureStackTrace(error, assertArgument);\n throw error;\n }\n};\n\n/**\n * Use this to assert the state of an object.\n *\n * @example\n * ```ts\n * class Foo {\n * private _bar: boolean;\n *\n * public get bar() {\n * assertState(this._bar, 'bar must be true');\n * return this._bar;\n * }\n * }\n *\n * const foo = new Foo();\n * foo.bar = false; // This will throw an InvalidStateError\n * ```\n */\nexport const assertState: (condition: unknown, message: string) => asserts condition = (\n condition: unknown,\n message: string,\n): asserts condition => {\n if (!condition) {\n const error = new InvalidStateError(message);\n Error.captureStackTrace(error, assertState);\n throw error;\n }\n};\n\n// TODO(dmaretskyi): Consider how this correlates to effect errors. Intuitively, this should be a defect, not a checked error.\nexport class InvalidStateError extends Error {}\n"],
|
|
5
|
+
"mappings": ";;;AAaO,IAAMA,YAAyB,CACpCC,WACAC,SACAC,SAAAA;AAEA,MAAIF,WAAW;AACb;EACF;AAEA,MAAIC,SAASE,WAAW,KAAA,GAAQ;AAG9B;EACF;AAEA,MAAIC,eAAe;AAEnB,MAAIH,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAMC,QAAQ,IAAIC,mBAAmBN,YAAAA;AAGrCO,QAAMC,kBAAkBH,OAAOV,SAAAA;AAE/B,QAAMU;AACR;AAEO,IAAMC,qBAAN,cAAiCC,MAAAA;EACtC,YAAYV,SAAiB;AAC3B,UAAMA,OAAAA;AAENY,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAEA,IAAMR,sBAAsB,CAACS,aAAAA;AAG3B,QAAMC,QAAQD,SAASC,MAAM,wBAAA;AAC7B,MAAIA,OAAO;AACT,UAAM,CAAA,EAAGC,QAAAA,IAAYD;AACrB,WAAOC;EACT;AAEA,SAAOF;AACT;AAEO,IAAMG,kBAAkB,CAACC,UAAoBC,UAAmBnB,SAAAA;AACrE,MAAIE,eAAe;AAEnB,QAAMH,UAAU;IAACmB;IAAUC;IAAUC,OAAO,CAACC,QAAQ,OAAOA,QAAQ,QAAA,EAAUC,KAAK,GAAA;AACnF,MAAIvB,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAM,IAAIE,mBAAmBN,YAAAA;AAC/B;;;ACxEO,IAAMqB,iBAAoG,CAC/GC,WACAC,cACAC,YAAAA;AAEA,MAAI,CAACF,WAAW;AACd,UAAMG,QAAQ,IAAIC,UAAU,sBAAsBH,YAAAA,QAAoBC,UAAU,KAAKA,OAAAA,KAAY,GAAC;AAClGG,UAAMC,kBAAkBH,OAAOJ,cAAAA;AAC/B,UAAMI;EACR;AACF;AAoBO,IAAMI,cAA0E,CACrFP,WACAE,YAAAA;AAEA,MAAI,CAACF,WAAW;AACd,UAAMG,QAAQ,IAAIK,kBAAkBN,OAAAA;AACpCG,UAAMC,kBAAkBH,OAAOI,WAAAA;AAC/B,UAAMJ;EACR;AACF;AAGO,IAAMK,oBAAN,cAAgCH,MAAAA;AAAO;",
|
|
6
|
+
"names": ["invariant", "condition", "message", "meta", "startsWith", "errorMessage", "A", "F", "getRelativeFilename", "L", "error", "InvariantViolation", "Error", "captureStackTrace", "Object", "setPrototypeOf", "prototype", "filename", "match", "filePath", "failedInvariant", "message1", "message2", "filter", "str", "join", "assertArgument", "condition", "argumentName", "message", "error", "TypeError", "Error", "captureStackTrace", "assertState", "InvalidStateError"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"
|
|
1
|
+
{"inputs":{"src/invariant.ts":{"bytes":7562,"imports":[],"format":"esm"},"src/assert.ts":{"bytes":4370,"imports":[],"format":"esm"},"src/index.ts":{"bytes":463,"imports":[{"path":"src/invariant.ts","kind":"import-statement","original":"./invariant"},{"path":"src/assert.ts","kind":"import-statement","original":"./assert"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5991},"dist/lib/node-esm/index.mjs":{"imports":[],"exports":["InvalidStateError","InvariantViolation","assertArgument","assertState","failedInvariant","invariant"],"entryPoint":"src/index.ts","inputs":{"src/invariant.ts":{"bytesInOutput":1308},"src/index.ts":{"bytesInOutput":0},"src/assert.ts":{"bytesInOutput":500}},"bytes":2093}}}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* }
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
export declare const assertArgument: (condition: unknown,
|
|
11
|
+
export declare const assertArgument: (condition: unknown, argumentName: string, message?: string) => asserts condition;
|
|
12
12
|
/**
|
|
13
13
|
* Use this to assert the state of an object.
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,eAAO,MAAM,cAAc,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,eAAO,MAAM,cAAc,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,SAUpG,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,SAS1E,CAAC;AAGF,qBAAa,iBAAkB,SAAQ,KAAK;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../../src/invariant.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,SAAS,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,WAmCvB,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../../src/invariant.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,SAAS,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,WAmCvB,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAO,EAAE,MAAM,EAI1B;CACF;AAcD,eAAO,MAAM,eAAe,cAAe,OAAO,aAAa,MAAM,SAAS,YAAY,KAAG,KAiB5F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.8.3"}
|
|
1
|
+
{"version":"7.0.0-dev.20260421.2","root":[[47,50]],"fileNames":["lib.es5.d.ts","lib.es2015.d.ts","lib.es2016.d.ts","lib.es2017.d.ts","lib.es2018.d.ts","lib.es2019.d.ts","lib.es2020.d.ts","lib.dom.d.ts","lib.es2015.core.d.ts","lib.es2015.collection.d.ts","lib.es2015.generator.d.ts","lib.es2015.iterable.d.ts","lib.es2015.promise.d.ts","lib.es2015.proxy.d.ts","lib.es2015.reflect.d.ts","lib.es2015.symbol.d.ts","lib.es2015.symbol.wellknown.d.ts","lib.es2016.array.include.d.ts","lib.es2016.intl.d.ts","lib.es2017.arraybuffer.d.ts","lib.es2017.date.d.ts","lib.es2017.object.d.ts","lib.es2017.sharedmemory.d.ts","lib.es2017.string.d.ts","lib.es2017.intl.d.ts","lib.es2017.typedarrays.d.ts","lib.es2018.asyncgenerator.d.ts","lib.es2018.asynciterable.d.ts","lib.es2018.intl.d.ts","lib.es2018.promise.d.ts","lib.es2018.regexp.d.ts","lib.es2019.array.d.ts","lib.es2019.object.d.ts","lib.es2019.string.d.ts","lib.es2019.symbol.d.ts","lib.es2019.intl.d.ts","lib.es2020.bigint.d.ts","lib.es2020.date.d.ts","lib.es2020.promise.d.ts","lib.es2020.sharedmemory.d.ts","lib.es2020.string.d.ts","lib.es2020.symbol.wellknown.d.ts","lib.es2020.intl.d.ts","lib.es2020.number.d.ts","lib.decorators.d.ts","lib.decorators.legacy.d.ts","../../src/assert.ts","../../src/meta.ts","../../src/invariant.ts","../../src/index.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/disposable.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/indexable.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/iterators.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/compatibility/index.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/globals.typedarray.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/buffer.buffer.d.ts","../../../../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/header.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/readable.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/file.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/fetch.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/formdata.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/connector.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/client.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/errors.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/dispatcher.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/global-dispatcher.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/global-origin.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/pool-stats.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/pool.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/handlers.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/balanced-pool.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-interceptor.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-client.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-pool.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/mock-errors.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/proxy-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/retry-handler.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/retry-agent.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/api.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/interceptors.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/util.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/cookies.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/patch.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/websocket.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/eventsource.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/filereader.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/content-type.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/cache.d.ts","../../../../../node_modules/.pnpm/undici-types@6.20.0/node_modules/undici-types/index.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/globals.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/assert.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/assert/strict.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/async_hooks.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/buffer.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/child_process.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/cluster.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/console.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/constants.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/crypto.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dgram.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/diagnostics_channel.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dns.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dns/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/domain.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/dom-events.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/events.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/fs.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/fs/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/http.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/http2.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/https.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/inspector.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/module.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/net.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/os.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/path.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/perf_hooks.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/process.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/punycode.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/querystring.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/readline.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/readline/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/repl.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/sea.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/sqlite.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream/consumers.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/stream/web.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/string_decoder.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/test.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/timers.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/timers/promises.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/tls.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/trace_events.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/tty.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/url.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/util.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/v8.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/vm.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/wasi.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/worker_threads.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/zlib.d.ts","../../../../../node_modules/.pnpm/@types+node@22.10.2/node_modules/@types/node/index.d.ts","../../../../../node_modules/.pnpm/@types+wicg-file-system-access@2020.9.6/node_modules/@types/wicg-file-system-access/index.d.ts"],"fileInfos":[{"version":"a1aa1a5e065d48ef5c7bb99e38412f96","affectsGlobalScope":true,"impliedNodeFormat":1},"d4306fb2e47f74835e8674ffac07d76f","e437c5c1302869326c3bb93da85bbbcf","e4324975a566567b21d350615f1fc6ac","333b1b9a2a9ac3b8497dba5c63b5ba50","6cffacd662b6eb5fa7a36aa2ea366bfa","b4c34f9c23304dbef2d23698637ed638",{"version":"aae8996e8b5684814785a42cbbefcd79","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"01ac052ec4a79e87229f90466a9645f8","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"edba5df642941aa062a62f6328c6df3d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6344b55f26a4e81d9608777dbfb877dd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3c0ed28e53d3695b363e256ec1c023fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4c2761daba7f17141c25baa0821ac5da","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b87656acabd63e69379ff6ffcfe52fc7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"597469522da047a5af5222cc6989f405","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bb3a710cbcda0533bb127712927cbe37","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"55d97a8c6fbf34a30450a7b1e5f7a298","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"0ee05eb59426d33e374226d8dcfa708b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e347c14030993906efcfbb88915b6a05","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b0231263857c9b6a03641acdc9280ceb","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"3b15c4a83b598cacb4067676e6f0abed","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b417d97b7934cef63b1889abec0bbfbf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"09a6cf4032ebba60ce22a501e663f881","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7a42de379b489e8f7b647455bebfc576","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e22cc07e3f3cc242ba52fa3f8ea1fc58","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2c45da767a1bfbb220848df1bc4029e4","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b44c3e0fbaf2130cdcf6ac38b120ffa1","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b612fb5cf8e5d964b92063a75207632a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"02705151a5e1551b9162a9ed8ab763f7","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"41025e398be9215d32e4337335da8f0b","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"52684c2b1f353a5538e4f275182a54cd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"6dedb6a4f90d1df3a6fbe5693e44886c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ca3f36fe3562c07e0f0d71c2bebd3f6d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"409974d6129befbb8226ddd1c6558568","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4d9cfde2a1ae1b4925f1f9bc10848e5d","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"7e1daecc66dd564144e3bb1a0266b5fd","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a8e1d9bb35fd0637f2f9fd2b2a54f2ec","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4f168501772a6543182765bfd5f2fbfe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a19c80aad1b2162103496f5ba293a732","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"b69afa63cd5d059851c78adb2856ee09","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"ae2fc5d954e9b0f5feee3d481b953c27","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1cfd3091a071d8b6feec15277643bafe","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"692bcd75364db0f65d428801c7884466","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"a0d87491913d843139e0c993650a3235","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f64453cbf9671f28158677fa5c43967a","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"33f317af5428801f944a478d2c1e38e5","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e0d05101faab3b4d1f0a4fb2f09aa23a","signature":"159d0c0bdc5584b12cfa35822076531f","impliedNodeFormat":1},{"version":"0b07f9833c01dce1155debd3edd5d7d6","signature":"4a2d1a5603177f1dfd73ddb1afafd723","impliedNodeFormat":1},{"version":"ad42ece6c786ef1c0f9af0fd16a5a847","signature":"8ef272ba84f3b1e441573db2aa855895","impliedNodeFormat":1},{"version":"591d6d0cc82d7c027a97c9fad5277845","signature":"a175efedb8b7403ede734e96730de1eb","impliedNodeFormat":1},{"version":"90630acdc4134173bcf216f187bd3010","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f5a82824905a90c7452696b157ccbf8e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2514e9a2749c0fc18d2f478e9e1e641e","affectsGlobalScope":true,"impliedNodeFormat":1},"fe51d7a9bcdbcce1e65bbcf39b212298",{"version":"60edda1b5f28f8e7d7a6fae700faef3c","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"d81e6947fba1bc10b8eec34069255664","affectsGlobalScope":true,"impliedNodeFormat":1},"8e91e7228778516936913f666d057c19","628b774b54637325e286752c79c12432","597e516ba8427cccc7f3fe944da2f942","514fd35e5eb35bb2e5cbb908af0a0aa2","ed57ae88565308729f2327f26d684976","dcd932d6b0038f2e250e30dc10125b22","9508c917bd7e458745e222a82dd24ef0","fabf86f455f96b90538cc26320ab2765","14550b4cd9f433e0addd8b6d67614d23","3658d7d7a61e0ebff921a3292f22e90b","35fef7bac8048f583e4ce6eaa0c2a4c0","6752dc653fc7a333027249fd851fdb62","b9ad7e689b46dfba362c1bf174e69018","8b0a2930dfabdf27c69c6bb1eeabcdc8","4513b1ed15523d247040689f37fa9db2","5c0c499eed773a750903d9497beafacd","2377da227d1bac82ff7b3f2081ddf8d3","beef985b474fefeb80d27fb2c8778371","c79fc9d9f09ae598a374ae7c0b5284a4","f2caa3cebb1e6be855519004830a6be0","8ebc9f2a77c900e710801214c5cb994c","ec617a0e0577dd6a3210c3b067ecb325","1db5d06e485bd82d6d5f6e36925a8714","24b864518967840216c779b5e5f00975","8719cd8047700bfb6046798390053823","f2840afb502c94db92dab0fb8d27812f","a7e7d08b372210c203745d3eac61a411","531183cc80535e0e94226d720e5eb038","f627eb958ca52c85e42f04dce4661f86","9a43fc665bce9012a3d5fe1b574ff4dc","13f4b4da6546a34719fd6bde15fb63dd","a589216508844bfc00e62fc2d97fda45","865aea1c3209e31b076cb6fe780e769e","12e64aaf26af0f5c8f1b263dd66e3feb","928971ebbcdf5b093ef37669b33bddf6","b744265d8ad12b7d4d5c5dc35d18d44e","eff32168b8348b822afeed9cbf61afa7","9aafd1f29b4d8861c1c6c34bf83c0721",{"version":"00164cbcc1c01daff01c48524e115ebe","affectsGlobalScope":true,"impliedNodeFormat":1},"75c35382241d634380073a71ae31bc9a","7deced3ef46e082f97d49bb71622526a","71574c6791f69b167ce1ab489b2b61b2",{"version":"6df4dcd8b41052cc26a6af73c6937f86","affectsGlobalScope":true,"impliedNodeFormat":1},"cbae34574fe31d4a5ef3adee146fb6f5","4a7b1858837296766fd68ce1378e74eb",{"version":"9fc8636e70e507ea8d98a7aabd265ee5","affectsGlobalScope":true,"impliedNodeFormat":1},"c57682233d627206c477b36c1c175b7c",{"version":"5cecadfdb3e00997c9616c1d5ce6b8f4","affectsGlobalScope":true,"impliedNodeFormat":1},"c328f7ad3324dad3b014a361b567a205","12c7178deaecc79c215849791e088b34","fb3449da0f8a0403fcb36d2470b68886","57c04b416fb330a87d0a4705e6e37c2f","958d9865bfe33c94973e3d58ac66b1d0",{"version":"7ed47a7721271e796e9756b45734feaf","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"8bc6a5a95cd2df9f0392da0fa4cb03e3","affectsGlobalScope":true,"impliedNodeFormat":1},"775e118d246ffda9283d94772389bc3c","523e9bbd311f55326ac83a7c40fc29bd","fdd14f5f74212b0d9bd023f9f4f61e62","21baad704fab1c96b85de59aa92438b0","4a0ef467ec8fa0206d0e58fed7c6955d","41a388d3894be87ff371e130db43c3e4",{"version":"3f609011f15f3445c65cc543549895cc","affectsGlobalScope":true,"impliedNodeFormat":1},"dceaed506efef02de8922a129914605d","2500b39777a662899066e61fcf737a52","bdbbfddd2833453519a4c6864652469e",{"version":"311fbe00bc63e7cf2dab9d48d54d5e1e","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e6616c1a81dff896f04c18da7cf5e8a0","affectsGlobalScope":true,"impliedNodeFormat":1},"d1dfd59bf8b7e71f40ee1d3a2f1b5fcf","53c41ffbbc4356e365d72a537ffb9289","e15247d10b79191ac297212d1183ed03","dd0c03e63afe38f86d61b2d54a9ad760","20049c404ad43da435aac0c69c179cc4","9c44db35c5ff2a61538ae34208bbe504","2c7e200709d82fec821e0154eb745d9e","c626f8a955ddf43bfe6785adb1c3ca4d","c8206d568b54e5ea06131963eecd576a","cf3b2ff720e926f366519cc83c99018a",{"version":"776ec94e2f1f2ebbc5b231103a647984","affectsGlobalScope":true,"impliedNodeFormat":1},"c2e6363d164e809228f71291dcc83add",{"version":"0042ce968ec6274197843485333d3134","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bf9362f571b6cc12cc5a25da6b9a8675","affectsGlobalScope":true,"impliedNodeFormat":1},"9473140d6a11c5887d169fbdfcd0cb41","e5d364c503b63abd949a746cdc6a4066","d63b35c1a5097295f0659f5583c8fb83","3509aa3de97926c2922f378a248ddb48",{"version":"e6099c385b8384a91dc4f1e601769a6f","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1413cfdb74da5bf264ec30490f261de1","affectsGlobalScope":true,"impliedNodeFormat":1},"e5c06dabd06c35e42950e36d082ba24f","ac26345510b3b253794221bf8c7d7a1d","eb4ea93209a96f6f1a9c85b8d43816fb",{"version":"a0d07c37a8456336ed8d7dfd9522ea99","affectsGlobalScope":true,"impliedNodeFormat":1},"194b317939f5bde463fc9c0f8d27a314","a7106559a4309e79d396f27199eda706",{"version":"4d5383f23e7454f5d255ab5c08546c16","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[56,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[51,52,53,56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[54,55,56,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147],[56,66,70,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,66,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,61,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,63,66,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],[56,61,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],[56,58,59,62,65,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,66,73,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,58,64,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,66,87,88,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,62,66,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],[56,87,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],[56,60,61,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],[56,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,88,89,90,91,92,93,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,66,81,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,66,73,74,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,64,66,74,75,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,65,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,58,61,66,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,66,70,74,75,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,70,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,64,66,69,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,58,63,66,73,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[56,61,66,87,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],[47,49,56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[48,56,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148]],"options":{"allowJs":false,"composite":true,"emitDeclarationOnly":true,"declaration":true,"declarationMap":true,"experimentalDecorators":true,"jsx":3,"module":200,"noImplicitOverride":true,"noUncheckedSideEffectImports":false,"outDir":"./","rewriteRelativeImportExtensions":true,"skipLibCheck":true,"strict":true,"stripInternal":true,"sourceMap":true,"target":99,"esModuleInterop":true},"referencedMap":[[96,1],[97,2],[98,3],[56,4],[99,5],[100,6],[101,7],[51,8],[54,9],[52,8],[53,8],[102,10],[103,11],[104,12],[105,13],[106,14],[107,15],[108,16],[110,8],[109,17],[111,18],[112,19],[113,20],[95,21],[55,8],[114,22],[115,23],[116,24],[149,25],[117,26],[118,27],[119,28],[120,29],[121,30],[122,31],[123,32],[124,33],[125,34],[126,35],[127,36],[128,37],[129,38],[130,39],[131,40],[133,41],[132,42],[134,43],[135,44],[136,45],[137,46],[138,47],[139,48],[140,49],[141,50],[142,51],[143,52],[144,53],[145,54],[146,55],[147,56],[148,57],[150,8],[45,8],[46,8],[8,8],[10,8],[9,8],[2,8],[11,8],[12,8],[13,8],[14,8],[15,8],[16,8],[17,8],[18,8],[3,8],[19,8],[20,8],[4,8],[21,8],[25,8],[22,8],[23,8],[24,8],[26,8],[27,8],[28,8],[5,8],[29,8],[30,8],[31,8],[32,8],[6,8],[36,8],[33,8],[34,8],[35,8],[37,8],[7,8],[38,8],[43,8],[44,8],[39,8],[40,8],[41,8],[42,8],[1,8],[57,8],[73,58],[83,59],[72,58],[93,60],[64,61],[63,8],[92,62],[86,63],[91,61],[66,64],[80,65],[65,66],[89,67],[61,68],[60,62],[90,69],[62,70],[67,59],[68,8],[71,59],[58,8],[94,71],[84,72],[75,73],[76,74],[78,75],[74,76],[77,77],[87,62],[69,78],[70,79],[79,80],[59,8],[82,72],[81,59],[85,8],[88,81],[47,8],[50,82],[49,83],[48,8]],"latestChangedDtsFile":"./src/index.d.ts"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/invariant",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4-main.05e74ebcff",
|
|
4
4
|
"description": "Invariant assertion compatible with DXOS logger.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
-
"
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": false,
|
|
10
14
|
"type": "module",
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
17
|
+
"types": "./dist/types/src/index.d.ts",
|
|
13
18
|
"browser": "./dist/lib/browser/index.mjs",
|
|
14
19
|
"node": {
|
|
15
20
|
"require": "./dist/lib/node/index.cjs",
|
|
16
21
|
"default": "./dist/lib/node-esm/index.mjs"
|
|
17
|
-
}
|
|
18
|
-
"types": "./dist/types/src/index.d.ts"
|
|
22
|
+
}
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
"types": "dist/types/src/index.d.ts",
|
|
22
|
-
"typesVersions": {
|
|
23
|
-
"*": {}
|
|
24
|
-
},
|
|
25
26
|
"files": [
|
|
26
27
|
"dist",
|
|
27
28
|
"src"
|
package/src/assert.ts
CHANGED
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
15
|
// TODO(dmaretskyi): Rename assertParameter.
|
|
16
|
-
export const assertArgument: (condition: unknown,
|
|
16
|
+
export const assertArgument: (condition: unknown, argumentName: string, message?: string) => asserts condition = (
|
|
17
17
|
condition: unknown,
|
|
18
|
-
|
|
18
|
+
argumentName: string,
|
|
19
|
+
message?: string,
|
|
19
20
|
): asserts condition => {
|
|
20
21
|
if (!condition) {
|
|
21
|
-
const error = new TypeError(message);
|
|
22
|
+
const error = new TypeError(`Invalid argument \`${argumentName}\`` + (message ? `: ${message}` : ''));
|
|
22
23
|
Error.captureStackTrace(error, assertArgument);
|
|
23
24
|
throw error;
|
|
24
25
|
}
|
package/dist/lib/node/index.cjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var node_exports = {};
|
|
20
|
-
__export(node_exports, {
|
|
21
|
-
InvalidStateError: () => InvalidStateError,
|
|
22
|
-
InvariantViolation: () => InvariantViolation,
|
|
23
|
-
assertArgument: () => assertArgument,
|
|
24
|
-
assertState: () => assertState,
|
|
25
|
-
failedInvariant: () => failedInvariant,
|
|
26
|
-
invariant: () => invariant
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(node_exports);
|
|
29
|
-
var invariant = (condition, message, meta) => {
|
|
30
|
-
if (condition) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (message?.startsWith("BUG")) {
|
|
34
|
-
debugger;
|
|
35
|
-
}
|
|
36
|
-
let errorMessage = "invariant violation";
|
|
37
|
-
if (message) {
|
|
38
|
-
errorMessage += `: ${message}`;
|
|
39
|
-
}
|
|
40
|
-
if (meta?.A) {
|
|
41
|
-
errorMessage += ` [${meta.A[0]}]`;
|
|
42
|
-
}
|
|
43
|
-
if (meta?.F) {
|
|
44
|
-
errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;
|
|
45
|
-
}
|
|
46
|
-
const error = new InvariantViolation(errorMessage);
|
|
47
|
-
Error.captureStackTrace(error, invariant);
|
|
48
|
-
throw error;
|
|
49
|
-
};
|
|
50
|
-
var InvariantViolation = class extends Error {
|
|
51
|
-
constructor(message) {
|
|
52
|
-
super(message);
|
|
53
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var getRelativeFilename = (filename) => {
|
|
57
|
-
const match = filename.match(/.+\/(packages\/.+\/.+)/);
|
|
58
|
-
if (match) {
|
|
59
|
-
const [, filePath] = match;
|
|
60
|
-
return filePath;
|
|
61
|
-
}
|
|
62
|
-
return filename;
|
|
63
|
-
};
|
|
64
|
-
var failedInvariant = (message1, message2, meta) => {
|
|
65
|
-
let errorMessage = "invariant violation";
|
|
66
|
-
const message = [
|
|
67
|
-
message1,
|
|
68
|
-
message2
|
|
69
|
-
].filter((str) => typeof str === "string").join(" ");
|
|
70
|
-
if (message) {
|
|
71
|
-
errorMessage += `: ${message}`;
|
|
72
|
-
}
|
|
73
|
-
if (meta?.A) {
|
|
74
|
-
errorMessage += ` [${meta.A[0]}]`;
|
|
75
|
-
}
|
|
76
|
-
if (meta?.F) {
|
|
77
|
-
errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;
|
|
78
|
-
}
|
|
79
|
-
throw new InvariantViolation(errorMessage);
|
|
80
|
-
};
|
|
81
|
-
var assertArgument = (condition, message) => {
|
|
82
|
-
if (!condition) {
|
|
83
|
-
const error = new TypeError(message);
|
|
84
|
-
Error.captureStackTrace(error, assertArgument);
|
|
85
|
-
throw error;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
var assertState = (condition, message) => {
|
|
89
|
-
if (!condition) {
|
|
90
|
-
const error = new InvalidStateError(message);
|
|
91
|
-
Error.captureStackTrace(error, assertState);
|
|
92
|
-
throw error;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
var InvalidStateError = class extends Error {
|
|
96
|
-
};
|
|
97
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
-
0 && (module.exports = {
|
|
99
|
-
InvalidStateError,
|
|
100
|
-
InvariantViolation,
|
|
101
|
-
assertArgument,
|
|
102
|
-
assertState,
|
|
103
|
-
failedInvariant,
|
|
104
|
-
invariant
|
|
105
|
-
});
|
|
106
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/invariant.ts", "../../../src/assert.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type CallMetadata } from './meta';\n\nexport type InvariantFn = (condition: unknown, message?: string, meta?: CallMetadata) => asserts condition;\n\n/**\n * Asserts that the condition is true.\n *\n * @param message Optional message. If it starts with \"BUG\" then the program will break if this invariant fails if the debugger is attached.\n */\nexport const invariant: InvariantFn = (\n condition: unknown,\n message?: string,\n meta?: CallMetadata,\n): asserts condition => {\n if (condition) {\n return;\n }\n\n if (message?.startsWith('BUG')) {\n // This invariant is a debug bug-check: break if the debugger is attached.\n // eslint-disable-next-line no-debugger\n debugger;\n }\n\n let errorMessage = 'invariant violation';\n\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n const error = new InvariantViolation(errorMessage);\n\n // Do not include the invariant function in the stack trace.\n Error.captureStackTrace(error, invariant);\n\n throw error;\n};\n\nexport class InvariantViolation extends Error {\n constructor(message: string) {\n super(message);\n // NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nconst getRelativeFilename = (filename: string) => {\n // TODO(burdon): Hack uses \"packages\" as an anchor (pre-parse NX?)\n // Including `packages/` part of the path so that excluded paths (e.g. from dist) are clickable in vscode.\n const match = filename.match(/.+\\/(packages\\/.+\\/.+)/);\n if (match) {\n const [, filePath] = match;\n return filePath;\n }\n\n return filename;\n};\n\nexport const failedInvariant = (message1?: unknown, message2?: string, meta?: CallMetadata): never => {\n let errorMessage = 'invariant violation';\n\n const message = [message1, message2].filter((str) => typeof str === 'string').join(' ');\n if (message) {\n errorMessage += `: ${message}`;\n }\n\n if (meta?.A) {\n errorMessage += ` [${meta.A[0]}]`;\n }\n\n if (meta?.F) {\n errorMessage += ` at ${getRelativeFilename(meta.F)}:${meta.L}`;\n }\n\n throw new InvariantViolation(errorMessage);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Use this to assert the arguments of a function.\n *\n * @example\n * ```ts\n * function foo(arg: string) {\n * assertArgument(typeof arg === 'string', 'arg must be a string');\n * }\n * ```\n */\n// TODO(dmaretskyi): Rename assertParameter.\nexport const assertArgument: (condition: unknown, message: string) => asserts condition = (\n condition: unknown,\n message: string,\n): asserts condition => {\n if (!condition) {\n const error = new TypeError(message);\n Error.captureStackTrace(error, assertArgument);\n throw error;\n }\n};\n\n/**\n * Use this to assert the state of an object.\n *\n * @example\n * ```ts\n * class Foo {\n * private _bar: boolean;\n *\n * public get bar() {\n * assertState(this._bar, 'bar must be true');\n * return this._bar;\n * }\n * }\n *\n * const foo = new Foo();\n * foo.bar = false; // This will throw an InvalidStateError\n * ```\n */\nexport const assertState: (condition: unknown, message: string) => asserts condition = (\n condition: unknown,\n message: string,\n): asserts condition => {\n if (!condition) {\n const error = new InvalidStateError(message);\n Error.captureStackTrace(error, assertState);\n throw error;\n }\n};\n\n// TODO(dmaretskyi): Consider how this correlates to effect errors. Intuitively, this should be a defect, not a checked error.\nexport class InvalidStateError extends Error {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAMA,YAAyB,CACpCC,WACAC,SACAC,SAAAA;AAEA,MAAIF,WAAW;AACb;EACF;AAEA,MAAIC,SAASE,WAAW,KAAA,GAAQ;AAG9B;EACF;AAEA,MAAIC,eAAe;AAEnB,MAAIH,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAMC,QAAQ,IAAIC,mBAAmBN,YAAAA;AAGrCO,QAAMC,kBAAkBH,OAAOV,SAAAA;AAE/B,QAAMU;AACR;AAEO,IAAMC,qBAAN,cAAiCC,MAAAA;EACtC,YAAYV,SAAiB;AAC3B,UAAMA,OAAAA;AAENY,WAAOC,eAAe,MAAM,WAAWC,SAAS;EAClD;AACF;AAEA,IAAMR,sBAAsB,CAACS,aAAAA;AAG3B,QAAMC,QAAQD,SAASC,MAAM,wBAAA;AAC7B,MAAIA,OAAO;AACT,UAAM,CAAA,EAAGC,QAAAA,IAAYD;AACrB,WAAOC;EACT;AAEA,SAAOF;AACT;AAEO,IAAMG,kBAAkB,CAACC,UAAoBC,UAAmBnB,SAAAA;AACrE,MAAIE,eAAe;AAEnB,QAAMH,UAAU;IAACmB;IAAUC;IAAUC,OAAO,CAACC,QAAQ,OAAOA,QAAQ,QAAA,EAAUC,KAAK,GAAA;AACnF,MAAIvB,SAAS;AACXG,oBAAgB,KAAKH,OAAAA;EACvB;AAEA,MAAIC,MAAMG,GAAG;AACXD,oBAAgB,KAAKF,KAAKG,EAAE,CAAA,CAAE;EAChC;AAEA,MAAIH,MAAMI,GAAG;AACXF,oBAAgB,OAAOG,oBAAoBL,KAAKI,CAAC,CAAA,IAAKJ,KAAKM,CAAC;EAC9D;AAEA,QAAM,IAAIE,mBAAmBN,YAAAA;AAC/B;ACxEO,IAAMqB,iBAA6E,CACxFzB,WACAC,YAAAA;AAEA,MAAI,CAACD,WAAW;AACd,UAAMS,QAAQ,IAAIiB,UAAUzB,OAAAA;AAC5BU,UAAMC,kBAAkBH,OAAOgB,cAAAA;AAC/B,UAAMhB;EACR;AACF;AAoBO,IAAMkB,cAA0E,CACrF3B,WACAC,YAAAA;AAEA,MAAI,CAACD,WAAW;AACd,UAAMS,QAAQ,IAAImB,kBAAkB3B,OAAAA;AACpCU,UAAMC,kBAAkBH,OAAOkB,WAAAA;AAC/B,UAAMlB;EACR;AACF;AAGO,IAAMmB,oBAAN,cAAgCjB,MAAAA;AAAO;",
|
|
6
|
-
"names": ["invariant", "condition", "message", "meta", "startsWith", "errorMessage", "A", "F", "getRelativeFilename", "L", "error", "InvariantViolation", "Error", "captureStackTrace", "Object", "setPrototypeOf", "prototype", "filename", "match", "filePath", "failedInvariant", "message1", "message2", "filter", "str", "join", "assertArgument", "TypeError", "assertState", "InvalidStateError"]
|
|
7
|
-
}
|
package/dist/lib/node/meta.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"packages/common/invariant/src/invariant.ts":{"bytes":7655,"imports":[],"format":"esm"},"packages/common/invariant/src/assert.ts":{"bytes":4093,"imports":[],"format":"esm"},"packages/common/invariant/src/index.ts":{"bytes":552,"imports":[{"path":"packages/common/invariant/src/invariant.ts","kind":"import-statement","original":"./invariant"},{"path":"packages/common/invariant/src/assert.ts","kind":"import-statement","original":"./assert"}],"format":"esm"}},"outputs":{"packages/common/invariant/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5810},"packages/common/invariant/dist/lib/node/index.cjs":{"imports":[],"exports":["InvalidStateError","InvariantViolation","assertArgument","assertState","failedInvariant","invariant"],"entryPoint":"packages/common/invariant/src/index.ts","inputs":{"packages/common/invariant/src/invariant.ts":{"bytesInOutput":1308},"packages/common/invariant/src/index.ts":{"bytesInOutput":0},"packages/common/invariant/src/assert.ts":{"bytesInOutput":421}},"bytes":1973}}}
|