decoders 2.12.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -6
- package/dist/index.js +5 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -371,7 +371,6 @@ ${formatted}`);
|
|
|
371
371
|
return formatted;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
var _standard = /* @__PURE__ */ new WeakMap();
|
|
375
374
|
var DecoderImpl = class {
|
|
376
375
|
/**
|
|
377
376
|
* Verifies the untrusted/unknown input and either accepts or rejects it.
|
|
@@ -395,6 +394,10 @@ var DecoderImpl = class {
|
|
|
395
394
|
* error message.
|
|
396
395
|
*/
|
|
397
396
|
|
|
397
|
+
/**
|
|
398
|
+
* Memoized `~standard` props, built on first access.
|
|
399
|
+
*/
|
|
400
|
+
#standard;
|
|
398
401
|
constructor(fn) {
|
|
399
402
|
const decode = (blob) => {
|
|
400
403
|
const makeFlexErr = (msg) => err(isAnnotation(msg) ? msg : public_annotate(blob, msg));
|
|
@@ -512,10 +515,8 @@ var DecoderImpl = class {
|
|
|
512
515
|
* The Standard Schema interface for this decoder.
|
|
513
516
|
*/
|
|
514
517
|
get "~standard"() {
|
|
515
|
-
const memo = _standard.get(this);
|
|
516
|
-
if (memo !== void 0) return memo;
|
|
517
518
|
const decode = this.decode;
|
|
518
|
-
|
|
519
|
+
return this.#standard ??= {
|
|
519
520
|
version: 1,
|
|
520
521
|
vendor: "decoders",
|
|
521
522
|
validate: (blob) => {
|
|
@@ -528,8 +529,6 @@ var DecoderImpl = class {
|
|
|
528
529
|
}
|
|
529
530
|
}
|
|
530
531
|
};
|
|
531
|
-
_standard.set(this, props);
|
|
532
|
-
return props;
|
|
533
532
|
}
|
|
534
533
|
};
|
|
535
534
|
Object.defineProperty(DecoderImpl, "name", { value: "Decoder" });
|
package/dist/index.js
CHANGED
|
@@ -371,7 +371,6 @@ ${formatted}`);
|
|
|
371
371
|
return formatted;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
var _standard = /* @__PURE__ */ new WeakMap();
|
|
375
374
|
var DecoderImpl = class {
|
|
376
375
|
/**
|
|
377
376
|
* Verifies the untrusted/unknown input and either accepts or rejects it.
|
|
@@ -395,6 +394,10 @@ var DecoderImpl = class {
|
|
|
395
394
|
* error message.
|
|
396
395
|
*/
|
|
397
396
|
value;
|
|
397
|
+
/**
|
|
398
|
+
* Memoized `~standard` props, built on first access.
|
|
399
|
+
*/
|
|
400
|
+
#standard;
|
|
398
401
|
constructor(fn) {
|
|
399
402
|
const decode = (blob) => {
|
|
400
403
|
const makeFlexErr = (msg) => err(isAnnotation(msg) ? msg : public_annotate(blob, msg));
|
|
@@ -512,10 +515,8 @@ var DecoderImpl = class {
|
|
|
512
515
|
* The Standard Schema interface for this decoder.
|
|
513
516
|
*/
|
|
514
517
|
get "~standard"() {
|
|
515
|
-
const memo = _standard.get(this);
|
|
516
|
-
if (memo !== void 0) return memo;
|
|
517
518
|
const decode = this.decode;
|
|
518
|
-
|
|
519
|
+
return this.#standard ??= {
|
|
519
520
|
version: 1,
|
|
520
521
|
vendor: "decoders",
|
|
521
522
|
validate: (blob) => {
|
|
@@ -528,8 +529,6 @@ var DecoderImpl = class {
|
|
|
528
529
|
}
|
|
529
530
|
}
|
|
530
531
|
};
|
|
531
|
-
_standard.set(this, props);
|
|
532
|
-
return props;
|
|
533
532
|
}
|
|
534
533
|
};
|
|
535
534
|
Object.defineProperty(DecoderImpl, "name", { value: "Decoder" });
|