effect 3.19.2 → 3.19.3
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/Inspectable.js +86 -4
- package/dist/cjs/Inspectable.js.map +1 -1
- package/dist/cjs/ParseResult.js +1 -1
- package/dist/cjs/ParseResult.js.map +1 -1
- package/dist/cjs/Pretty.js +4 -3
- package/dist/cjs/Pretty.js.map +1 -1
- package/dist/cjs/Schema.js +15 -14
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/SchemaAST.js +4 -3
- package/dist/cjs/SchemaAST.js.map +1 -1
- package/dist/cjs/internal/config.js +10 -9
- package/dist/cjs/internal/config.js.map +1 -1
- package/dist/cjs/internal/schema/errors.js +6 -5
- package/dist/cjs/internal/schema/errors.js.map +1 -1
- package/dist/cjs/internal/schema/util.js +3 -77
- package/dist/cjs/internal/schema/util.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Inspectable.d.ts.map +1 -1
- package/dist/dts/Pretty.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/SchemaAST.d.ts.map +1 -1
- package/dist/esm/Inspectable.js +79 -2
- package/dist/esm/Inspectable.js.map +1 -1
- package/dist/esm/ParseResult.js +1 -1
- package/dist/esm/ParseResult.js.map +1 -1
- package/dist/esm/Pretty.js +4 -3
- package/dist/esm/Pretty.js.map +1 -1
- package/dist/esm/Schema.js +15 -14
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/SchemaAST.js +4 -3
- package/dist/esm/SchemaAST.js.map +1 -1
- package/dist/esm/internal/config.js +10 -9
- package/dist/esm/internal/config.js.map +1 -1
- package/dist/esm/internal/schema/errors.js +6 -5
- package/dist/esm/internal/schema/errors.js.map +1 -1
- package/dist/esm/internal/schema/util.js +2 -72
- package/dist/esm/internal/schema/util.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Inspectable.ts +115 -2
- package/src/ParseResult.ts +1 -1
- package/src/Pretty.ts +4 -3
- package/src/Schema.ts +18 -14
- package/src/SchemaAST.ts +4 -3
- package/src/internal/config.ts +15 -9
- package/src/internal/schema/errors.ts +12 -5
- package/src/internal/schema/util.ts +2 -100
- package/src/internal/version.ts +1 -1
package/dist/esm/Schema.js
CHANGED
|
@@ -24,6 +24,7 @@ import { dual, identity } from "./Function.js";
|
|
|
24
24
|
import { globalValue } from "./GlobalValue.js";
|
|
25
25
|
import * as hashMap_ from "./HashMap.js";
|
|
26
26
|
import * as hashSet_ from "./HashSet.js";
|
|
27
|
+
import * as Inspectable from "./Inspectable.js";
|
|
27
28
|
import * as internalCause_ from "./internal/cause.js";
|
|
28
29
|
import * as errors_ from "./internal/schema/errors.js";
|
|
29
30
|
import * as schemaId_ from "./internal/schema/schemaId.js";
|
|
@@ -3569,8 +3570,8 @@ export const lessThanDate = (max, annotations) => self => self.pipe(filter(a =>
|
|
|
3569
3570
|
[LessThanDateSchemaId]: {
|
|
3570
3571
|
max
|
|
3571
3572
|
},
|
|
3572
|
-
title: `lessThanDate(${
|
|
3573
|
-
description: `a date before ${
|
|
3573
|
+
title: `lessThanDate(${Inspectable.formatDate(max)})`,
|
|
3574
|
+
description: `a date before ${Inspectable.formatDate(max)}`,
|
|
3574
3575
|
...annotations
|
|
3575
3576
|
}));
|
|
3576
3577
|
/**
|
|
@@ -3587,8 +3588,8 @@ export const lessThanOrEqualToDate = (max, annotations) => self => self.pipe(fil
|
|
|
3587
3588
|
[LessThanOrEqualToDateSchemaId]: {
|
|
3588
3589
|
max
|
|
3589
3590
|
},
|
|
3590
|
-
title: `lessThanOrEqualToDate(${
|
|
3591
|
-
description: `a date before or equal to ${
|
|
3591
|
+
title: `lessThanOrEqualToDate(${Inspectable.formatDate(max)})`,
|
|
3592
|
+
description: `a date before or equal to ${Inspectable.formatDate(max)}`,
|
|
3592
3593
|
...annotations
|
|
3593
3594
|
}));
|
|
3594
3595
|
/**
|
|
@@ -3605,8 +3606,8 @@ export const greaterThanDate = (min, annotations) => self => self.pipe(filter(a
|
|
|
3605
3606
|
[GreaterThanDateSchemaId]: {
|
|
3606
3607
|
min
|
|
3607
3608
|
},
|
|
3608
|
-
title: `greaterThanDate(${
|
|
3609
|
-
description: `a date after ${
|
|
3609
|
+
title: `greaterThanDate(${Inspectable.formatDate(min)})`,
|
|
3610
|
+
description: `a date after ${Inspectable.formatDate(min)}`,
|
|
3610
3611
|
...annotations
|
|
3611
3612
|
}));
|
|
3612
3613
|
/**
|
|
@@ -3623,8 +3624,8 @@ export const greaterThanOrEqualToDate = (min, annotations) => self => self.pipe(
|
|
|
3623
3624
|
[GreaterThanOrEqualToDateSchemaId]: {
|
|
3624
3625
|
min
|
|
3625
3626
|
},
|
|
3626
|
-
title: `greaterThanOrEqualToDate(${
|
|
3627
|
-
description: `a date after or equal to ${
|
|
3627
|
+
title: `greaterThanOrEqualToDate(${Inspectable.formatDate(min)})`,
|
|
3628
|
+
description: `a date after or equal to ${Inspectable.formatDate(min)}`,
|
|
3628
3629
|
...annotations
|
|
3629
3630
|
}));
|
|
3630
3631
|
/**
|
|
@@ -3642,8 +3643,8 @@ export const betweenDate = (min, max, annotations) => self => self.pipe(filter(a
|
|
|
3642
3643
|
max,
|
|
3643
3644
|
min
|
|
3644
3645
|
},
|
|
3645
|
-
title: `betweenDate(${
|
|
3646
|
-
description: `a date between ${
|
|
3646
|
+
title: `betweenDate(${Inspectable.formatDate(min)}, ${Inspectable.formatDate(max)})`,
|
|
3647
|
+
description: `a date between ${Inspectable.formatDate(min)} and ${Inspectable.formatDate(max)}`,
|
|
3647
3648
|
...annotations
|
|
3648
3649
|
}));
|
|
3649
3650
|
/**
|
|
@@ -3699,7 +3700,7 @@ export class DateFromString extends /*#__PURE__*/transform(String$.annotations({
|
|
|
3699
3700
|
}), DateFromSelf, {
|
|
3700
3701
|
strict: true,
|
|
3701
3702
|
decode: i => new Date(i),
|
|
3702
|
-
encode: a =>
|
|
3703
|
+
encode: a => Inspectable.formatDate(a)
|
|
3703
3704
|
}).annotations({
|
|
3704
3705
|
identifier: "DateFromString"
|
|
3705
3706
|
}) {}
|
|
@@ -3754,7 +3755,7 @@ export class DateTimeUtcFromSelf extends /*#__PURE__*/declare(u => dateTime.isDa
|
|
|
3754
3755
|
}) {}
|
|
3755
3756
|
const decodeDateTimeUtc = (input, ast) => ParseResult.try({
|
|
3756
3757
|
try: () => dateTime.unsafeMake(input),
|
|
3757
|
-
catch: () => new ParseResult.Type(ast, input, `Unable to decode ${
|
|
3758
|
+
catch: () => new ParseResult.Type(ast, input, `Unable to decode ${Inspectable.formatUnknown(input)} into a DateTime.Utc`)
|
|
3758
3759
|
});
|
|
3759
3760
|
/**
|
|
3760
3761
|
* Defines a schema that attempts to convert a `number` to a `DateTime.Utc` instance using the `DateTime.unsafeMake` constructor.
|
|
@@ -4807,7 +4808,7 @@ export const TaggedError = identifier => (tag, fieldsOr, annotations) => {
|
|
|
4807
4808
|
if (!hasMessageField) {
|
|
4808
4809
|
Object.defineProperty(TaggedErrorClass.prototype, "message", {
|
|
4809
4810
|
get() {
|
|
4810
|
-
return `{ ${Reflect.ownKeys(fields).map(p => `${
|
|
4811
|
+
return `{ ${Reflect.ownKeys(fields).map(p => `${Inspectable.formatPropertyKey(p)}: ${Inspectable.formatUnknown(this[p])}`).join(", ")} }`;
|
|
4811
4812
|
},
|
|
4812
4813
|
enumerable: false,
|
|
4813
4814
|
// mirrors the built-in Error.prototype.message, whose descriptor is also non-enumerable
|
|
@@ -4991,7 +4992,7 @@ const makeClass = ({
|
|
|
4991
4992
|
if (disableToString !== true) {
|
|
4992
4993
|
Object.defineProperty(klass.prototype, "toString", {
|
|
4993
4994
|
value() {
|
|
4994
|
-
return `${identifier}({ ${Reflect.ownKeys(fields).map(p => `${
|
|
4995
|
+
return `${identifier}({ ${Reflect.ownKeys(fields).map(p => `${Inspectable.formatPropertyKey(p)}: ${Inspectable.formatUnknown(this[p])}`).join(", ")} })`;
|
|
4995
4996
|
},
|
|
4996
4997
|
configurable: true,
|
|
4997
4998
|
writable: true
|