effect 3.19.12 → 3.19.13
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 +70 -0
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/SchemaAST.js +14 -2
- package/dist/cjs/SchemaAST.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Schema.d.ts +1 -0
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/SchemaAST.d.ts +21 -0
- package/dist/dts/SchemaAST.d.ts.map +1 -1
- package/dist/esm/Schema.js +70 -0
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/SchemaAST.js +12 -0
- package/dist/esm/SchemaAST.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Schema.ts +25 -0
- package/src/SchemaAST.ts +24 -0
- package/src/internal/version.ts +1 -1
package/dist/cjs/Schema.js
CHANGED
|
@@ -299,6 +299,7 @@ const standardSchemaV1 = (schema, overrideOptions) => {
|
|
|
299
299
|
};
|
|
300
300
|
exports.standardSchemaV1 = standardSchemaV1;
|
|
301
301
|
const builtInAnnotations = {
|
|
302
|
+
typeConstructor: AST.TypeConstructorAnnotationId,
|
|
302
303
|
schemaId: AST.SchemaIdAnnotationId,
|
|
303
304
|
message: AST.MessageAnnotationId,
|
|
304
305
|
missingMessage: AST.MissingMessageAnnotationId,
|
|
@@ -2532,6 +2533,9 @@ class ULID extends /*#__PURE__*/String$.pipe(/*#__PURE__*/pattern(ulidRegexp, {
|
|
|
2532
2533
|
*/
|
|
2533
2534
|
exports.ULID = ULID;
|
|
2534
2535
|
class URLFromSelf extends /*#__PURE__*/instanceOf(URL, {
|
|
2536
|
+
typeConstructor: {
|
|
2537
|
+
_tag: "URL"
|
|
2538
|
+
},
|
|
2535
2539
|
identifier: "URLFromSelf",
|
|
2536
2540
|
arbitrary: () => fc => fc.webUrl().map(s => new URL(s)),
|
|
2537
2541
|
pretty: () => url => url.toString()
|
|
@@ -3186,6 +3190,9 @@ const RedactedFromSelf = value => declare([value], {
|
|
|
3186
3190
|
decode: value => redactedParse(ParseResult.decodeUnknown(value)),
|
|
3187
3191
|
encode: value => redactedParse(ParseResult.encodeUnknown(value))
|
|
3188
3192
|
}, {
|
|
3193
|
+
typeConstructor: {
|
|
3194
|
+
_tag: "effect/Redacted"
|
|
3195
|
+
},
|
|
3189
3196
|
description: "Redacted(<redacted>)",
|
|
3190
3197
|
pretty: () => () => "Redacted(<redacted>)",
|
|
3191
3198
|
arbitrary: redactedArbitrary,
|
|
@@ -3211,6 +3218,9 @@ function Redacted(value) {
|
|
|
3211
3218
|
* @since 3.10.0
|
|
3212
3219
|
*/
|
|
3213
3220
|
class DurationFromSelf extends /*#__PURE__*/declare(duration_.isDuration, {
|
|
3221
|
+
typeConstructor: {
|
|
3222
|
+
_tag: "effect/Duration"
|
|
3223
|
+
},
|
|
3214
3224
|
identifier: "DurationFromSelf",
|
|
3215
3225
|
pretty: () => String,
|
|
3216
3226
|
arbitrary: () => fc => fc.oneof(fc.constant(duration_.infinity), fc.bigInt({
|
|
@@ -3454,6 +3464,9 @@ const betweenDuration = (minimum, maximum, annotations) => self => self.pipe(fil
|
|
|
3454
3464
|
*/
|
|
3455
3465
|
exports.betweenDuration = betweenDuration;
|
|
3456
3466
|
class Uint8ArrayFromSelf extends /*#__PURE__*/declare(Predicate.isUint8Array, {
|
|
3467
|
+
typeConstructor: {
|
|
3468
|
+
_tag: "Uint8Array"
|
|
3469
|
+
},
|
|
3457
3470
|
identifier: "Uint8ArrayFromSelf",
|
|
3458
3471
|
pretty: () => u8arr => `new Uint8Array(${JSON.stringify(Array.from(u8arr))})`,
|
|
3459
3472
|
arbitrary: () => fc => fc.uint8Array(),
|
|
@@ -3831,6 +3844,9 @@ const DateFromSelfSchemaId = exports.DateFromSelfSchemaId = schemaId_.DateFromSe
|
|
|
3831
3844
|
* @since 3.10.0
|
|
3832
3845
|
*/
|
|
3833
3846
|
class DateFromSelf extends /*#__PURE__*/declare(Predicate.isDate, {
|
|
3847
|
+
typeConstructor: {
|
|
3848
|
+
_tag: "Date"
|
|
3849
|
+
},
|
|
3834
3850
|
identifier: "DateFromSelf",
|
|
3835
3851
|
schemaId: DateFromSelfSchemaId,
|
|
3836
3852
|
[DateFromSelfSchemaId]: {
|
|
@@ -3910,6 +3926,9 @@ class DateFromNumber extends /*#__PURE__*/transform(Number$.annotations({
|
|
|
3910
3926
|
*/
|
|
3911
3927
|
exports.DateFromNumber = DateFromNumber;
|
|
3912
3928
|
class DateTimeUtcFromSelf extends /*#__PURE__*/declare(u => dateTime.isDateTime(u) && dateTime.isUtc(u), {
|
|
3929
|
+
typeConstructor: {
|
|
3930
|
+
_tag: "effect/DateTime.Utc"
|
|
3931
|
+
},
|
|
3913
3932
|
identifier: "DateTimeUtcFromSelf",
|
|
3914
3933
|
description: "a DateTime.Utc instance",
|
|
3915
3934
|
pretty: () => dateTime => dateTime.toString(),
|
|
@@ -3982,6 +4001,9 @@ const timeZoneOffsetArbitrary = () => fc => fc.integer({
|
|
|
3982
4001
|
* @since 3.10.0
|
|
3983
4002
|
*/
|
|
3984
4003
|
class TimeZoneOffsetFromSelf extends /*#__PURE__*/declare(dateTime.isTimeZoneOffset, {
|
|
4004
|
+
typeConstructor: {
|
|
4005
|
+
_tag: "effect/DateTime.TimeZone.Offset"
|
|
4006
|
+
},
|
|
3985
4007
|
identifier: "TimeZoneOffsetFromSelf",
|
|
3986
4008
|
description: "a TimeZone.Offset instance",
|
|
3987
4009
|
pretty: () => zone => zone.toString(),
|
|
@@ -4012,6 +4034,9 @@ const timeZoneNamedArbitrary = () => fc => fc.constantFrom(...Intl.supportedValu
|
|
|
4012
4034
|
* @since 3.10.0
|
|
4013
4035
|
*/
|
|
4014
4036
|
class TimeZoneNamedFromSelf extends /*#__PURE__*/declare(dateTime.isTimeZoneNamed, {
|
|
4037
|
+
typeConstructor: {
|
|
4038
|
+
_tag: "effect/DateTime.TimeZone.Named"
|
|
4039
|
+
},
|
|
4015
4040
|
identifier: "TimeZoneNamedFromSelf",
|
|
4016
4041
|
description: "a TimeZone.Named instance",
|
|
4017
4042
|
pretty: () => zone => zone.toString(),
|
|
@@ -4070,6 +4095,9 @@ const timeZoneArbitrary = fc => fc.oneof(timeZoneOffsetArbitrary()(fc), timeZone
|
|
|
4070
4095
|
* @since 3.10.0
|
|
4071
4096
|
*/
|
|
4072
4097
|
class DateTimeZonedFromSelf extends /*#__PURE__*/declare(u => dateTime.isDateTime(u) && dateTime.isZoned(u), {
|
|
4098
|
+
typeConstructor: {
|
|
4099
|
+
_tag: "effect/DateTime.Zoned"
|
|
4100
|
+
},
|
|
4073
4101
|
identifier: "DateTimeZonedFromSelf",
|
|
4074
4102
|
description: "a DateTime.Zoned instance",
|
|
4075
4103
|
pretty: () => dateTime => dateTime.toString(),
|
|
@@ -4133,6 +4161,9 @@ const OptionFromSelf_ = value => {
|
|
|
4133
4161
|
decode: value => optionParse(ParseResult.decodeUnknown(value)),
|
|
4134
4162
|
encode: value => optionParse(ParseResult.encodeUnknown(value))
|
|
4135
4163
|
}, {
|
|
4164
|
+
typeConstructor: {
|
|
4165
|
+
_tag: "effect/Option"
|
|
4166
|
+
},
|
|
4136
4167
|
pretty: optionPretty,
|
|
4137
4168
|
arbitrary: optionArbitrary,
|
|
4138
4169
|
equivalence: option_.getEquivalence
|
|
@@ -4270,6 +4301,9 @@ const EitherFromSelf = ({
|
|
|
4270
4301
|
decode: (right, left) => eitherParse(ParseResult.decodeUnknown(right), ParseResult.decodeUnknown(left)),
|
|
4271
4302
|
encode: (right, left) => eitherParse(ParseResult.encodeUnknown(right), ParseResult.encodeUnknown(left))
|
|
4272
4303
|
}, {
|
|
4304
|
+
typeConstructor: {
|
|
4305
|
+
_tag: "effect/Either"
|
|
4306
|
+
},
|
|
4273
4307
|
description: `Either<${format(right)}, ${format(left)}>`,
|
|
4274
4308
|
pretty: eitherPretty,
|
|
4275
4309
|
arbitrary: eitherArbitrary,
|
|
@@ -4372,6 +4406,9 @@ const mapFromSelf_ = (key, value, description) => declare([key, value], {
|
|
|
4372
4406
|
decode: (Key, Value) => readonlyMapParse(ParseResult.decodeUnknown(Array$(Tuple(Key, Value)))),
|
|
4373
4407
|
encode: (Key, Value) => readonlyMapParse(ParseResult.encodeUnknown(Array$(Tuple(Key, Value))))
|
|
4374
4408
|
}, {
|
|
4409
|
+
typeConstructor: {
|
|
4410
|
+
_tag: "ReadonlyMap"
|
|
4411
|
+
},
|
|
4375
4412
|
description,
|
|
4376
4413
|
pretty: readonlyMapPretty,
|
|
4377
4414
|
arbitrary: mapArbitrary,
|
|
@@ -4482,6 +4519,9 @@ const setFromSelf_ = (value, description) => declare([value], {
|
|
|
4482
4519
|
decode: item => readonlySetParse(ParseResult.decodeUnknown(Array$(item))),
|
|
4483
4520
|
encode: item => readonlySetParse(ParseResult.encodeUnknown(Array$(item)))
|
|
4484
4521
|
}, {
|
|
4522
|
+
typeConstructor: {
|
|
4523
|
+
_tag: "ReadonlySet"
|
|
4524
|
+
},
|
|
4485
4525
|
description,
|
|
4486
4526
|
pretty: readonlySetPretty,
|
|
4487
4527
|
arbitrary: setArbitrary,
|
|
@@ -4528,6 +4568,9 @@ const bigDecimalArbitrary = () => fc => fc.tuple(fc.bigInt(), fc.integer({
|
|
|
4528
4568
|
* @since 3.10.0
|
|
4529
4569
|
*/
|
|
4530
4570
|
class BigDecimalFromSelf extends /*#__PURE__*/declare(bigDecimal_.isBigDecimal, {
|
|
4571
|
+
typeConstructor: {
|
|
4572
|
+
_tag: "effect/BigDecimal"
|
|
4573
|
+
},
|
|
4531
4574
|
identifier: "BigDecimalFromSelf",
|
|
4532
4575
|
pretty: bigDecimalPretty,
|
|
4533
4576
|
arbitrary: bigDecimalArbitrary,
|
|
@@ -4805,6 +4848,9 @@ const ChunkFromSelf = value => {
|
|
|
4805
4848
|
decode: item => chunkParse(ParseResult.decodeUnknown(Array$(item))),
|
|
4806
4849
|
encode: item => chunkParse(ParseResult.encodeUnknown(Array$(item)))
|
|
4807
4850
|
}, {
|
|
4851
|
+
typeConstructor: {
|
|
4852
|
+
_tag: "effect/Chunk"
|
|
4853
|
+
},
|
|
4808
4854
|
description: `Chunk<${format(value)}>`,
|
|
4809
4855
|
pretty: chunkPretty,
|
|
4810
4856
|
arbitrary: chunkArbitrary,
|
|
@@ -4837,6 +4883,9 @@ const NonEmptyChunkFromSelf = value => {
|
|
|
4837
4883
|
decode: item => nonEmptyChunkParse(ParseResult.decodeUnknown(NonEmptyArray(item))),
|
|
4838
4884
|
encode: item => nonEmptyChunkParse(ParseResult.encodeUnknown(NonEmptyArray(item)))
|
|
4839
4885
|
}, {
|
|
4886
|
+
typeConstructor: {
|
|
4887
|
+
_tag: "effect/Chunk.NonEmptyChunk"
|
|
4888
|
+
},
|
|
4840
4889
|
description: `NonEmptyChunk<${format(value)}>`,
|
|
4841
4890
|
pretty: nonEmptyChunkPretty,
|
|
4842
4891
|
arbitrary: nonEmptyChunkArbitrary,
|
|
@@ -5250,6 +5299,9 @@ const fiberIdPretty = fiberId => {
|
|
|
5250
5299
|
* @since 3.10.0
|
|
5251
5300
|
*/
|
|
5252
5301
|
class FiberIdFromSelf extends /*#__PURE__*/declare(fiberId_.isFiberId, {
|
|
5302
|
+
typeConstructor: {
|
|
5303
|
+
_tag: "effect/FiberId"
|
|
5304
|
+
},
|
|
5253
5305
|
identifier: "FiberIdFromSelf",
|
|
5254
5306
|
pretty: () => fiberIdPretty,
|
|
5255
5307
|
arbitrary: () => fiberIdArbitrary
|
|
@@ -5391,6 +5443,9 @@ const CauseFromSelf = ({
|
|
|
5391
5443
|
decode: (error, defect) => causeParse(ParseResult.decodeUnknown(causeEncoded(error, defect))),
|
|
5392
5444
|
encode: (error, defect) => causeParse(ParseResult.encodeUnknown(causeEncoded(error, defect)))
|
|
5393
5445
|
}, {
|
|
5446
|
+
typeConstructor: {
|
|
5447
|
+
_tag: "effect/Cause"
|
|
5448
|
+
},
|
|
5394
5449
|
title: `Cause<${error.ast}>`,
|
|
5395
5450
|
pretty: causePretty,
|
|
5396
5451
|
arbitrary: causeArbitrary
|
|
@@ -5562,6 +5617,9 @@ const ExitFromSelf = ({
|
|
|
5562
5617
|
defect
|
|
5563
5618
|
})))
|
|
5564
5619
|
}, {
|
|
5620
|
+
typeConstructor: {
|
|
5621
|
+
_tag: "effect/Exit"
|
|
5622
|
+
},
|
|
5565
5623
|
title: `Exit<${success.ast}, ${failure.ast}>`,
|
|
5566
5624
|
pretty: exitPretty,
|
|
5567
5625
|
arbitrary: exitArbitrary
|
|
@@ -5616,6 +5674,9 @@ const HashSetFromSelf = value => {
|
|
|
5616
5674
|
decode: item => hashSetParse(ParseResult.decodeUnknown(Array$(item))),
|
|
5617
5675
|
encode: item => hashSetParse(ParseResult.encodeUnknown(Array$(item)))
|
|
5618
5676
|
}, {
|
|
5677
|
+
typeConstructor: {
|
|
5678
|
+
_tag: "effect/HashSet"
|
|
5679
|
+
},
|
|
5619
5680
|
description: `HashSet<${format(value)}>`,
|
|
5620
5681
|
pretty: hashSetPretty,
|
|
5621
5682
|
arbitrary: hashSetArbitrary,
|
|
@@ -5656,6 +5717,9 @@ const HashMapFromSelf = ({
|
|
|
5656
5717
|
decode: (key, value) => hashMapParse(ParseResult.decodeUnknown(Array$(Tuple(key, value)))),
|
|
5657
5718
|
encode: (key, value) => hashMapParse(ParseResult.encodeUnknown(Array$(Tuple(key, value))))
|
|
5658
5719
|
}, {
|
|
5720
|
+
typeConstructor: {
|
|
5721
|
+
_tag: "effect/HashMap"
|
|
5722
|
+
},
|
|
5659
5723
|
description: `HashMap<${format(key)}, ${format(value)}>`,
|
|
5660
5724
|
pretty: hashMapPretty,
|
|
5661
5725
|
arbitrary: hashMapArbitrary,
|
|
@@ -5700,6 +5764,9 @@ const ListFromSelf = value => {
|
|
|
5700
5764
|
decode: item => listParse(ParseResult.decodeUnknown(Array$(item))),
|
|
5701
5765
|
encode: item => listParse(ParseResult.encodeUnknown(Array$(item)))
|
|
5702
5766
|
}, {
|
|
5767
|
+
typeConstructor: {
|
|
5768
|
+
_tag: "effect/List"
|
|
5769
|
+
},
|
|
5703
5770
|
description: `List<${format(value)}>`,
|
|
5704
5771
|
pretty: listPretty,
|
|
5705
5772
|
arbitrary: listArbitrary,
|
|
@@ -5733,6 +5800,9 @@ const SortedSetFromSelf = (value, ordA, ordI) => {
|
|
|
5733
5800
|
decode: item => sortedSetParse(ParseResult.decodeUnknown(Array$(item)), ordA),
|
|
5734
5801
|
encode: item => sortedSetParse(ParseResult.encodeUnknown(Array$(item)), ordI)
|
|
5735
5802
|
}, {
|
|
5803
|
+
typeConstructor: {
|
|
5804
|
+
_tag: "effect/SortedSet"
|
|
5805
|
+
},
|
|
5736
5806
|
description: `SortedSet<${format(value)}>`,
|
|
5737
5807
|
pretty: sortedSetPretty,
|
|
5738
5808
|
arbitrary: (arb, ctx) => sortedSetArbitrary(arb, ordA, ctx),
|