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/esm/Schema.js
CHANGED
|
@@ -2380,7 +2380,7 @@ export const parseNumber = self => transformOrFail(self, Number$, {
|
|
|
2380
2380
|
*
|
|
2381
2381
|
* The following special string values are supported: "NaN", "Infinity", "-Infinity".
|
|
2382
2382
|
*
|
|
2383
|
-
* @category number
|
|
2383
|
+
* @category number transformations
|
|
2384
2384
|
* @since 3.10.0
|
|
2385
2385
|
*/
|
|
2386
2386
|
export class NumberFromString extends /*#__PURE__*/parseNumber(String$.annotations({
|
|
@@ -4331,6 +4331,7 @@ const orElseTitleAnnotation = (schema, title) => {
|
|
|
4331
4331
|
return schema;
|
|
4332
4332
|
};
|
|
4333
4333
|
const getDisableValidationMakeOption = options => Predicate.isBoolean(options) ? options : options?.disableValidation ?? false;
|
|
4334
|
+
const astCache = /*#__PURE__*/globalValue("effect/Schema/astCache", () => new WeakMap());
|
|
4334
4335
|
const makeClass = ({
|
|
4335
4336
|
Base,
|
|
4336
4337
|
annotations,
|
|
@@ -4364,6 +4365,9 @@ const makeClass = ({
|
|
|
4364
4365
|
// ----------------
|
|
4365
4366
|
static [TypeId] = variance;
|
|
4366
4367
|
static get ast() {
|
|
4368
|
+
if (astCache.has(this)) {
|
|
4369
|
+
return astCache.get(this);
|
|
4370
|
+
}
|
|
4367
4371
|
const declaration = declare([typeSide], {
|
|
4368
4372
|
decode: () => (input, _, ast) => input instanceof this || fallbackInstanceOf(input) ? ParseResult.succeed(input) : ParseResult.fail(new ParseResult.Type(ast, input)),
|
|
4369
4373
|
encode: () => (input, options) => input instanceof this ? ParseResult.succeed(input) : ParseResult.map(ParseResult.encodeUnknown(typeSide)(input, options), props => new this(props, true))
|
|
@@ -4385,6 +4389,7 @@ const makeClass = ({
|
|
|
4385
4389
|
}).annotations({
|
|
4386
4390
|
[AST.SurrogateAnnotationId]: schema.ast
|
|
4387
4391
|
});
|
|
4392
|
+
astCache.set(this, transformation.ast);
|
|
4388
4393
|
return transformation.ast;
|
|
4389
4394
|
}
|
|
4390
4395
|
static pipe() {
|