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/cjs/Schema.js
CHANGED
|
@@ -166,6 +166,7 @@ var _Function = require("./Function.js");
|
|
|
166
166
|
var _GlobalValue = require("./GlobalValue.js");
|
|
167
167
|
var hashMap_ = _interopRequireWildcard(require("./HashMap.js"));
|
|
168
168
|
var hashSet_ = _interopRequireWildcard(require("./HashSet.js"));
|
|
169
|
+
var Inspectable = _interopRequireWildcard(require("./Inspectable.js"));
|
|
169
170
|
var internalCause_ = _interopRequireWildcard(require("./internal/cause.js"));
|
|
170
171
|
var errors_ = _interopRequireWildcard(require("./internal/schema/errors.js"));
|
|
171
172
|
var schemaId_ = _interopRequireWildcard(require("./internal/schema/schemaId.js"));
|
|
@@ -3735,8 +3736,8 @@ const lessThanDate = (max, annotations) => self => self.pipe(filter(a => a < max
|
|
|
3735
3736
|
[LessThanDateSchemaId]: {
|
|
3736
3737
|
max
|
|
3737
3738
|
},
|
|
3738
|
-
title: `lessThanDate(${
|
|
3739
|
-
description: `a date before ${
|
|
3739
|
+
title: `lessThanDate(${Inspectable.formatDate(max)})`,
|
|
3740
|
+
description: `a date before ${Inspectable.formatDate(max)}`,
|
|
3740
3741
|
...annotations
|
|
3741
3742
|
}));
|
|
3742
3743
|
/**
|
|
@@ -3754,8 +3755,8 @@ const lessThanOrEqualToDate = (max, annotations) => self => self.pipe(filter(a =
|
|
|
3754
3755
|
[LessThanOrEqualToDateSchemaId]: {
|
|
3755
3756
|
max
|
|
3756
3757
|
},
|
|
3757
|
-
title: `lessThanOrEqualToDate(${
|
|
3758
|
-
description: `a date before or equal to ${
|
|
3758
|
+
title: `lessThanOrEqualToDate(${Inspectable.formatDate(max)})`,
|
|
3759
|
+
description: `a date before or equal to ${Inspectable.formatDate(max)}`,
|
|
3759
3760
|
...annotations
|
|
3760
3761
|
}));
|
|
3761
3762
|
/**
|
|
@@ -3773,8 +3774,8 @@ const greaterThanDate = (min, annotations) => self => self.pipe(filter(a => a >
|
|
|
3773
3774
|
[GreaterThanDateSchemaId]: {
|
|
3774
3775
|
min
|
|
3775
3776
|
},
|
|
3776
|
-
title: `greaterThanDate(${
|
|
3777
|
-
description: `a date after ${
|
|
3777
|
+
title: `greaterThanDate(${Inspectable.formatDate(min)})`,
|
|
3778
|
+
description: `a date after ${Inspectable.formatDate(min)}`,
|
|
3778
3779
|
...annotations
|
|
3779
3780
|
}));
|
|
3780
3781
|
/**
|
|
@@ -3792,8 +3793,8 @@ const greaterThanOrEqualToDate = (min, annotations) => self => self.pipe(filter(
|
|
|
3792
3793
|
[GreaterThanOrEqualToDateSchemaId]: {
|
|
3793
3794
|
min
|
|
3794
3795
|
},
|
|
3795
|
-
title: `greaterThanOrEqualToDate(${
|
|
3796
|
-
description: `a date after or equal to ${
|
|
3796
|
+
title: `greaterThanOrEqualToDate(${Inspectable.formatDate(min)})`,
|
|
3797
|
+
description: `a date after or equal to ${Inspectable.formatDate(min)}`,
|
|
3797
3798
|
...annotations
|
|
3798
3799
|
}));
|
|
3799
3800
|
/**
|
|
@@ -3812,8 +3813,8 @@ const betweenDate = (min, max, annotations) => self => self.pipe(filter(a => a <
|
|
|
3812
3813
|
max,
|
|
3813
3814
|
min
|
|
3814
3815
|
},
|
|
3815
|
-
title: `betweenDate(${
|
|
3816
|
-
description: `a date between ${
|
|
3816
|
+
title: `betweenDate(${Inspectable.formatDate(min)}, ${Inspectable.formatDate(max)})`,
|
|
3817
|
+
description: `a date between ${Inspectable.formatDate(min)} and ${Inspectable.formatDate(max)}`,
|
|
3817
3818
|
...annotations
|
|
3818
3819
|
}));
|
|
3819
3820
|
/**
|
|
@@ -3872,7 +3873,7 @@ class DateFromString extends /*#__PURE__*/transform(String$.annotations({
|
|
|
3872
3873
|
}), DateFromSelf, {
|
|
3873
3874
|
strict: true,
|
|
3874
3875
|
decode: i => new Date(i),
|
|
3875
|
-
encode: a =>
|
|
3876
|
+
encode: a => Inspectable.formatDate(a)
|
|
3876
3877
|
}).annotations({
|
|
3877
3878
|
identifier: "DateFromString"
|
|
3878
3879
|
}) {}
|
|
@@ -3920,7 +3921,7 @@ class DateTimeUtcFromSelf extends /*#__PURE__*/declare(u => dateTime.isDateTime(
|
|
|
3920
3921
|
exports.DateTimeUtcFromSelf = DateTimeUtcFromSelf;
|
|
3921
3922
|
const decodeDateTimeUtc = (input, ast) => ParseResult.try({
|
|
3922
3923
|
try: () => dateTime.unsafeMake(input),
|
|
3923
|
-
catch: () => new ParseResult.Type(ast, input, `Unable to decode ${
|
|
3924
|
+
catch: () => new ParseResult.Type(ast, input, `Unable to decode ${Inspectable.formatUnknown(input)} into a DateTime.Utc`)
|
|
3924
3925
|
});
|
|
3925
3926
|
/**
|
|
3926
3927
|
* Defines a schema that attempts to convert a `number` to a `DateTime.Utc` instance using the `DateTime.unsafeMake` constructor.
|
|
@@ -5003,7 +5004,7 @@ const TaggedError = identifier => (tag, fieldsOr, annotations) => {
|
|
|
5003
5004
|
if (!hasMessageField) {
|
|
5004
5005
|
Object.defineProperty(TaggedErrorClass.prototype, "message", {
|
|
5005
5006
|
get() {
|
|
5006
|
-
return `{ ${Reflect.ownKeys(fields).map(p => `${
|
|
5007
|
+
return `{ ${Reflect.ownKeys(fields).map(p => `${Inspectable.formatPropertyKey(p)}: ${Inspectable.formatUnknown(this[p])}`).join(", ")} }`;
|
|
5007
5008
|
},
|
|
5008
5009
|
enumerable: false,
|
|
5009
5010
|
// mirrors the built-in Error.prototype.message, whose descriptor is also non-enumerable
|
|
@@ -5188,7 +5189,7 @@ const makeClass = ({
|
|
|
5188
5189
|
if (disableToString !== true) {
|
|
5189
5190
|
Object.defineProperty(klass.prototype, "toString", {
|
|
5190
5191
|
value() {
|
|
5191
|
-
return `${identifier}({ ${Reflect.ownKeys(fields).map(p => `${
|
|
5192
|
+
return `${identifier}({ ${Reflect.ownKeys(fields).map(p => `${Inspectable.formatPropertyKey(p)}: ${Inspectable.formatUnknown(this[p])}`).join(", ")} })`;
|
|
5192
5193
|
},
|
|
5193
5194
|
configurable: true,
|
|
5194
5195
|
writable: true
|