edfcore 0.3.11 → 0.3.12
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/CHANGELOG.md +18 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -0
- package/dist/errors.js.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +1 -1
- package/src/errors.ts +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,24 @@ alone does not tell you whether you were affected.
|
|
|
6
6
|
edfcore is pre-1.0. Patch releases have carried behaviour changes where the old behaviour was a
|
|
7
7
|
defect; those are called out below.
|
|
8
8
|
|
|
9
|
+
## 0.3.12
|
|
10
|
+
|
|
11
|
+
- **Fixed** `error.name` becoming a mangled identifier in any minified consumer bundle. Every
|
|
12
|
+
edfcore error took its name from `new.target.name`, which reads `Function.prototype.name` — and
|
|
13
|
+
a minifier rewrites `class EdfFormatError` to `class t`, so the name follows it. Bundled with
|
|
14
|
+
`esbuild --minify`, `new EdfFormatError(...).name` came out as `"t"`.
|
|
15
|
+
- That is exactly the build where it matters. `error.name` is what a consumer branches on in a
|
|
16
|
+
browser, `api-errors.md` states the value, and the package's own test asserts it — but the suite
|
|
17
|
+
runs against unminified source, so it could not see this. Each class now assigns its name as a
|
|
18
|
+
string literal.
|
|
19
|
+
- The guard renames the class binding with `Object.defineProperty(cls, 'name', …)` before
|
|
20
|
+
constructing, which is an exact simulation of the rewrite: `Function.prototype.name` is the one
|
|
21
|
+
property `new.target.name` reads. Verified separately against a real `esbuild --minify` bundle
|
|
22
|
+
of `dist/`; the test needs no bundler, and edfcore keeps its five dev dependencies.
|
|
23
|
+
- `new.target.name` remains in the abstract base as the fallback for a consumer who subclasses
|
|
24
|
+
`EdfError` themselves. Nothing else changed: `edfErrorKind` is still the supported discriminator,
|
|
25
|
+
because `instanceof` is false across a realm boundary and a name is not a type.
|
|
26
|
+
|
|
9
27
|
## 0.3.11
|
|
10
28
|
|
|
11
29
|
- **Changed** `formatHeader` to stop calling the declared coverage the "duration" on a file that
|
package/dist/constants.d.ts
CHANGED
|
@@ -109,5 +109,5 @@ export declare const SIGNAL_FIELD_BLOCK_OFFSETS: {
|
|
|
109
109
|
readonly reserved: 224;
|
|
110
110
|
};
|
|
111
111
|
/** Published package version. Kept in sync with package.json by a test. */
|
|
112
|
-
export declare const VERSION = "0.3.
|
|
112
|
+
export declare const VERSION = "0.3.12";
|
|
113
113
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5F,8BAAsB,QAAS,SAAQ,KAAK;IAC1C,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBAEjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5F,8BAAsB,QAAS,SAAQ,KAAK;IAC1C,QAAQ,CAAC,QAAQ,CAAC,Y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AAQ,CAAU;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAG,qBAAqB,CAAU;gBAGnD,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAOxE;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,QAAQ;IACpD,QAAQ,CAAC,YAAY,EAAG,SAAS,CAAU;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;gBAG1C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAO/E;AAED,qBAAa,uBAAwB,SAAQ,QAAQ;IACnD,QAAQ,CAAC,YAAY,EAAG,SAAS,CAAU;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;gBAG1C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAO3F"}
|
package/dist/errors.js
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
export class EdfError extends Error {
|
|
12
12
|
constructor(message, options) {
|
|
13
13
|
super(message, options);
|
|
14
|
+
// `new.target.name` is the FALLBACK, for a consumer who subclasses `EdfError` themselves.
|
|
15
|
+
// Every class in this file overwrites it with a literal in its own constructor, because
|
|
16
|
+
// `new.target.name` reads `Function.prototype.name` — which a minifier rewrites. Bundled
|
|
17
|
+
// with esbuild --minify, `new EdfFormatError(...).name` came out as `"t"`, in exactly the
|
|
18
|
+
// browser build where `error.name` is what a consumer branches on (fixed in 0.3.12).
|
|
14
19
|
this.name = new.target.name;
|
|
15
20
|
}
|
|
16
21
|
}
|
|
@@ -45,6 +50,7 @@ export class EdfFormatError extends EdfError {
|
|
|
45
50
|
recordIndex;
|
|
46
51
|
constructor(message, init) {
|
|
47
52
|
super(message, { cause: init.cause });
|
|
53
|
+
this.name = 'EdfFormatError';
|
|
48
54
|
this.code = init.code;
|
|
49
55
|
this.diagnostic = init.diagnostic;
|
|
50
56
|
this.field = init.field ?? init.diagnostic?.field;
|
|
@@ -64,6 +70,7 @@ export class EdfScalingError extends EdfError {
|
|
|
64
70
|
label;
|
|
65
71
|
constructor(message, init) {
|
|
66
72
|
super(message, { cause: init.cause });
|
|
73
|
+
this.name = 'EdfScalingError';
|
|
67
74
|
this.code = init.code;
|
|
68
75
|
this.signalIndex = init.signalIndex;
|
|
69
76
|
this.label = init.label;
|
|
@@ -76,6 +83,7 @@ export class EdfRangeError extends EdfError {
|
|
|
76
83
|
available;
|
|
77
84
|
constructor(message, init) {
|
|
78
85
|
super(message, { cause: init.cause });
|
|
86
|
+
this.name = 'EdfRangeError';
|
|
79
87
|
this.requested = init.requested;
|
|
80
88
|
this.available = init.available;
|
|
81
89
|
}
|
|
@@ -88,6 +96,7 @@ export class EdfSourceError extends EdfError {
|
|
|
88
96
|
receivedLength;
|
|
89
97
|
constructor(message, init) {
|
|
90
98
|
super(message, { cause: init.cause });
|
|
99
|
+
this.name = 'EdfSourceError';
|
|
91
100
|
this.offset = init.offset;
|
|
92
101
|
this.requestedLength = init.requestedLength;
|
|
93
102
|
this.receivedLength = init.receivedLength;
|
|
@@ -104,6 +113,7 @@ export class EdfBudgetError extends EdfError {
|
|
|
104
113
|
optionName = 'maxMaterializeBytes';
|
|
105
114
|
constructor(message, init) {
|
|
106
115
|
super(message, { cause: init.cause });
|
|
116
|
+
this.name = 'EdfBudgetError';
|
|
107
117
|
this.requiredBytes = init.requiredBytes;
|
|
108
118
|
this.budgetBytes = init.budgetBytes;
|
|
109
119
|
}
|
|
@@ -118,6 +128,7 @@ export class EdfAmbiguousChannelError extends EdfError {
|
|
|
118
128
|
matchingIndices;
|
|
119
129
|
constructor(message, init) {
|
|
120
130
|
super(message, { cause: init.cause });
|
|
131
|
+
this.name = 'EdfAmbiguousChannelError';
|
|
121
132
|
this.label = init.label;
|
|
122
133
|
this.matchingIndices = init.matchingIndices;
|
|
123
134
|
}
|
|
@@ -128,6 +139,7 @@ export class EdfChannelNotFoundError extends EdfError {
|
|
|
128
139
|
availableLabels;
|
|
129
140
|
constructor(message, init) {
|
|
130
141
|
super(message, { cause: init.cause });
|
|
142
|
+
this.name = 'EdfChannelNotFoundError';
|
|
131
143
|
this.selector = init.selector;
|
|
132
144
|
this.availableLabels = init.availableLabels;
|
|
133
145
|
}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,OAAgB,QAAS,SAAQ,KAAK;IAG1C,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAmC,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAmBD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAAoC,CAAC,YAAY,KAAK,QAAQ,CACvE,CAAC;AACJ,CAAC;AAYD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAQ;IACjC,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gB,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACtC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,QAAQ;IAC3C,YAAY,GAAG,SAAkB,CAAC;IAClC,KAAK,CAAS;IACd,eAAe,CAAoB;IAE5C,YACE,OAAe,EACf,IAA4E;QAE5E,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;IAC9C,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,QAAQ;IAC1C,YAAY,GAAG,SAAkB,CAAC;IAClC,QAAQ,CAAkB;IAC1B,eAAe,CAAoB;IAE5C,YACE,OAAe,EACf,IAAwF;QAExF,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;IAC9C,CAAC;CACF"}
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/errors.ts
CHANGED
|
@@ -18,6 +18,11 @@ export abstract class EdfError extends Error {
|
|
|
18
18
|
|
|
19
19
|
constructor(message: string, options?: { cause?: unknown }) {
|
|
20
20
|
super(message, options as ErrorOptions | undefined);
|
|
21
|
+
// `new.target.name` is the FALLBACK, for a consumer who subclasses `EdfError` themselves.
|
|
22
|
+
// Every class in this file overwrites it with a literal in its own constructor, because
|
|
23
|
+
// `new.target.name` reads `Function.prototype.name` — which a minifier rewrites. Bundled
|
|
24
|
+
// with esbuild --minify, `new EdfFormatError(...).name` came out as `"t"`, in exactly the
|
|
25
|
+
// browser build where `error.name` is what a consumer branches on (fixed in 0.3.12).
|
|
21
26
|
this.name = new.target.name;
|
|
22
27
|
}
|
|
23
28
|
}
|
|
@@ -84,6 +89,7 @@ export class EdfFormatError extends EdfError {
|
|
|
84
89
|
|
|
85
90
|
constructor(message: string, init: EdfFormatErrorInit) {
|
|
86
91
|
super(message, { cause: init.cause });
|
|
92
|
+
this.name = 'EdfFormatError';
|
|
87
93
|
this.code = init.code;
|
|
88
94
|
this.diagnostic = init.diagnostic;
|
|
89
95
|
this.field = init.field ?? init.diagnostic?.field;
|
|
@@ -108,6 +114,7 @@ export class EdfScalingError extends EdfError {
|
|
|
108
114
|
init: { code: EdfDiagnosticCode; signalIndex: number; label: string; cause?: unknown },
|
|
109
115
|
) {
|
|
110
116
|
super(message, { cause: init.cause });
|
|
117
|
+
this.name = 'EdfScalingError';
|
|
111
118
|
this.code = init.code;
|
|
112
119
|
this.signalIndex = init.signalIndex;
|
|
113
120
|
this.label = init.label;
|
|
@@ -125,6 +132,7 @@ export class EdfRangeError extends EdfError {
|
|
|
125
132
|
init: { requested: RecordRange; available: RecordRange; cause?: unknown },
|
|
126
133
|
) {
|
|
127
134
|
super(message, { cause: init.cause });
|
|
135
|
+
this.name = 'EdfRangeError';
|
|
128
136
|
this.requested = init.requested;
|
|
129
137
|
this.available = init.available;
|
|
130
138
|
}
|
|
@@ -147,6 +155,7 @@ export class EdfSourceError extends EdfError {
|
|
|
147
155
|
},
|
|
148
156
|
) {
|
|
149
157
|
super(message, { cause: init.cause });
|
|
158
|
+
this.name = 'EdfSourceError';
|
|
150
159
|
this.offset = init.offset;
|
|
151
160
|
this.requestedLength = init.requestedLength;
|
|
152
161
|
this.receivedLength = init.receivedLength;
|
|
@@ -168,6 +177,7 @@ export class EdfBudgetError extends EdfError {
|
|
|
168
177
|
init: { requiredBytes: number; budgetBytes: number; cause?: unknown },
|
|
169
178
|
) {
|
|
170
179
|
super(message, { cause: init.cause });
|
|
180
|
+
this.name = 'EdfBudgetError';
|
|
171
181
|
this.requiredBytes = init.requiredBytes;
|
|
172
182
|
this.budgetBytes = init.budgetBytes;
|
|
173
183
|
}
|
|
@@ -187,6 +197,7 @@ export class EdfAmbiguousChannelError extends EdfError {
|
|
|
187
197
|
init: { label: string; matchingIndices: readonly number[]; cause?: unknown },
|
|
188
198
|
) {
|
|
189
199
|
super(message, { cause: init.cause });
|
|
200
|
+
this.name = 'EdfAmbiguousChannelError';
|
|
190
201
|
this.label = init.label;
|
|
191
202
|
this.matchingIndices = init.matchingIndices;
|
|
192
203
|
}
|
|
@@ -202,6 +213,7 @@ export class EdfChannelNotFoundError extends EdfError {
|
|
|
202
213
|
init: { selector: string | number; availableLabels: readonly string[]; cause?: unknown },
|
|
203
214
|
) {
|
|
204
215
|
super(message, { cause: init.cause });
|
|
216
|
+
this.name = 'EdfChannelNotFoundError';
|
|
205
217
|
this.selector = init.selector;
|
|
206
218
|
this.availableLabels = init.availableLabels;
|
|
207
219
|
}
|