effect 3.10.10 → 3.10.11
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/cjs/Schema.js +6 -1
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Schema.d.ts +1 -1
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/esm/Schema.js +6 -1
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Schema.ts +8 -2
- package/src/internal/version.ts +1 -1
package/dist/cjs/Schema.js
CHANGED
|
@@ -2501,7 +2501,7 @@ const parseNumber = self => transformOrFail(self, Number$, {
|
|
|
2501
2501
|
*
|
|
2502
2502
|
* The following special string values are supported: "NaN", "Infinity", "-Infinity".
|
|
2503
2503
|
*
|
|
2504
|
-
* @category number
|
|
2504
|
+
* @category number transformations
|
|
2505
2505
|
* @since 3.10.0
|
|
2506
2506
|
*/
|
|
2507
2507
|
exports.parseNumber = parseNumber;
|
|
@@ -4506,6 +4506,7 @@ const orElseTitleAnnotation = (schema, title) => {
|
|
|
4506
4506
|
return schema;
|
|
4507
4507
|
};
|
|
4508
4508
|
const getDisableValidationMakeOption = options => Predicate.isBoolean(options) ? options : options?.disableValidation ?? false;
|
|
4509
|
+
const astCache = /*#__PURE__*/(0, _GlobalValue.globalValue)("effect/Schema/astCache", () => new WeakMap());
|
|
4509
4510
|
const makeClass = ({
|
|
4510
4511
|
Base,
|
|
4511
4512
|
annotations,
|
|
@@ -4539,6 +4540,9 @@ const makeClass = ({
|
|
|
4539
4540
|
// ----------------
|
|
4540
4541
|
static [TypeId] = variance;
|
|
4541
4542
|
static get ast() {
|
|
4543
|
+
if (astCache.has(this)) {
|
|
4544
|
+
return astCache.get(this);
|
|
4545
|
+
}
|
|
4542
4546
|
const declaration = declare([typeSide], {
|
|
4543
4547
|
decode: () => (input, _, ast) => input instanceof this || fallbackInstanceOf(input) ? ParseResult.succeed(input) : ParseResult.fail(new ParseResult.Type(ast, input)),
|
|
4544
4548
|
encode: () => (input, options) => input instanceof this ? ParseResult.succeed(input) : ParseResult.map(ParseResult.encodeUnknown(typeSide)(input, options), props => new this(props, true))
|
|
@@ -4560,6 +4564,7 @@ const makeClass = ({
|
|
|
4560
4564
|
}).annotations({
|
|
4561
4565
|
[AST.SurrogateAnnotationId]: schema.ast
|
|
4562
4566
|
});
|
|
4567
|
+
astCache.set(this, transformation.ast);
|
|
4563
4568
|
return transformation.ast;
|
|
4564
4569
|
}
|
|
4565
4570
|
static pipe() {
|