effect 4.0.0-beta.101 → 4.0.0-beta.103
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/Array.d.ts +971 -1037
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +462 -412
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +433 -756
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +200 -325
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +207 -267
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +107 -135
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +146 -188
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +64 -84
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +405 -254
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +166 -101
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +167 -277
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +122 -176
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +729 -768
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +541 -449
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +834 -1173
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +326 -439
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +180 -49
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +96 -31
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +20 -33
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +18 -30
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +226 -174
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +339 -267
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +194 -68
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +122 -87
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +233 -33
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +232 -32
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +151 -274
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +171 -214
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +68 -77
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +57 -66
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +13 -15
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +9 -10
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +60 -80
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +18 -24
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +562 -660
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +307 -362
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +253 -256
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +104 -96
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +216 -308
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +132 -186
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2897 -3342
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +1383 -1580
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +22 -40
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +22 -40
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +33 -37
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +29 -21
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +103 -105
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +77 -79
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +51 -27
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +50 -26
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +13 -55
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -28
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +116 -192
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +82 -130
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +82 -146
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +48 -87
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +152 -105
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +109 -75
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +213 -168
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +114 -89
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +123 -81
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +85 -59
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +153 -264
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +42 -147
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +61 -33
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +26 -15
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +25 -33
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +48 -49
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +76 -145
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +40 -57
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +360 -714
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +168 -297
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +12 -6
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +47 -83
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +46 -68
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +319 -411
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +122 -166
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +1 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +177 -284
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +68 -109
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +12 -12
- package/dist/Inspectable.js +8 -8
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +620 -786
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +230 -307
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +11 -13
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +46 -103
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +8 -8
- package/dist/JsonPointer.js +8 -8
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +98 -44
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +300 -239
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +23 -35
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +16 -28
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +359 -260
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +195 -175
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +42 -29
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +31 -21
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +6 -2
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +6 -2
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +114 -214
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +41 -76
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +218 -467
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +207 -452
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +16 -5
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +10 -5
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +217 -252
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +150 -183
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +442 -993
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +202 -645
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +144 -173
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +68 -79
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +84 -89
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +44 -47
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +71 -370
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +59 -284
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +420 -243
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +209 -120
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +21 -14
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +15 -13
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +7 -137
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +5 -93
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +196 -233
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +90 -109
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +97 -189
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +190 -292
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +447 -812
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +213 -393
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +109 -109
- package/dist/Order.js +91 -91
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +20 -23
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +8 -9
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +1 -4
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +38 -41
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +3 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +6 -5
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +2 -2
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +4 -4
- package/dist/PlatformError.js +3 -3
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +4 -2
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +4 -2
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +200 -181
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +100 -108
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +7 -7
- package/dist/PrimaryKey.js +5 -5
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +425 -494
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +373 -362
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +24 -18
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +11 -9
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +200 -159
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +162 -132
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +49 -74
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -54
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +121 -63
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +42 -21
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +24 -13
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +15 -9
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +361 -466
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +163 -216
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -2
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +7 -2
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +25 -25
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +19 -20
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +8 -15
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +6 -12
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +95 -165
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +75 -122
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +102 -213
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +102 -213
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +10 -14
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +10 -14
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +31 -21
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +25 -19
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +201 -90
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +87 -41
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +302 -470
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +135 -218
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +50 -75
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +39 -60
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +290 -1636
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +162 -803
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +5 -5
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +18 -6
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +1835 -1060
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2708 -1050
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +29 -52
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +537 -391
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.d.ts +7 -6
- package/dist/SchemaError.d.ts.map +1 -1
- package/dist/SchemaError.js +8 -7
- package/dist/SchemaError.js.map +1 -1
- package/dist/SchemaGetter.d.ts +230 -185
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +252 -209
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +62 -190
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +74 -266
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +2 -2
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +123 -86
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +398 -1513
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +290 -2854
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +116 -76
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +123 -88
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +123 -151
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +72 -92
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +3 -3
- package/dist/ScopedRef.js +2 -2
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +101 -13
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +78 -39
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +117 -107
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +107 -100
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +1 -1
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +2430 -2958
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1124 -1397
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +262 -308
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +184 -215
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +109 -114
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +46 -54
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +282 -250
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +104 -92
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +3 -3
- package/dist/Symbol.js +3 -3
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +2 -2
- package/dist/Terminal.js +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +100 -54
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +41 -24
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +287 -679
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +109 -251
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +92 -127
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -57
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +201 -121
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +85 -56
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +62 -46
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +30 -22
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +631 -779
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +268 -330
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +297 -236
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +130 -100
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +126 -95
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +74 -56
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +101 -88
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +87 -66
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +200 -180
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +160 -136
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +97 -66
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +67 -45
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +51 -32
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +23 -15
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +129 -95
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +85 -70
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +97 -70
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +44 -34
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +127 -70
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +45 -65
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +6 -9
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +23 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +3 -7
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/array.js.map +1 -1
- package/dist/internal/core.js +3 -2
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +4 -0
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/doNotation.js.map +1 -1
- package/dist/internal/effect.js +141 -61
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/hashSet.js.map +1 -1
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/metric.js.map +1 -1
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/persistence.d.ts +2 -0
- package/dist/internal/persistence.d.ts.map +1 -0
- package/dist/internal/persistence.js +3 -0
- package/dist/internal/persistence.js.map +1 -0
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/record.d.ts +0 -3
- package/dist/internal/record.d.ts.map +1 -1
- package/dist/internal/record.js +10 -5
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/redacted.js.map +1 -1
- package/dist/internal/references.js +3 -4
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js +12 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/cause.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js +745 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/fromRepresentation.d.ts +2 -0
- package/dist/internal/schema/fromRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/fromRepresentation.js +245 -0
- package/dist/internal/schema/fromRepresentation.js.map +1 -0
- package/dist/internal/schema/parser.d.ts +14 -0
- package/dist/internal/schema/parser.d.ts.map +1 -0
- package/dist/internal/schema/parser.js +13 -0
- package/dist/internal/schema/parser.js.map +1 -0
- package/dist/internal/schema/schema.js +28 -40
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/{arbitrary.d.ts → toArbitrary.d.ts} +1 -1
- package/dist/internal/schema/toArbitrary.d.ts.map +1 -0
- package/dist/internal/schema/{arbitrary.js → toArbitrary.js} +8 -9
- package/dist/internal/schema/toArbitrary.js.map +1 -0
- package/dist/internal/schema/toCodeDocument.d.ts +2 -0
- package/dist/internal/schema/toCodeDocument.d.ts.map +1 -0
- package/dist/internal/schema/toCodeDocument.js +438 -0
- package/dist/internal/schema/toCodeDocument.js.map +1 -0
- package/dist/internal/schema/toEquivalence.d.ts +2 -0
- package/dist/internal/schema/toEquivalence.d.ts.map +1 -0
- package/dist/internal/schema/{equivalence.js → toEquivalence.js} +15 -13
- package/dist/internal/schema/toEquivalence.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +508 -0
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/toRepresentation.d.ts +2 -0
- package/dist/internal/schema/toRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/toRepresentation.js +349 -0
- package/dist/internal/schema/toRepresentation.js.map +1 -0
- package/dist/internal/stackTraceLimit.js +3 -6
- package/dist/internal/stackTraceLimit.js.map +1 -1
- package/dist/internal/stream.js.map +1 -1
- package/dist/internal/tracer.js.map +1 -1
- package/dist/internal/trie.js +13 -9
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +8 -7
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +8 -7
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +57 -28
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +54 -19
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +32 -31
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +24 -22
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +29 -29
- package/dist/testing/TestSchema.js +25 -25
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +121 -144
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +99 -121
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +22 -7
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +87 -317
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +132 -97
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +55 -51
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +1 -1
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +32 -28
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +26 -21
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +111 -68
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +123 -81
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpProtocol.d.ts +30 -0
- package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/McpProtocol.js +20 -0
- package/dist/unstable/ai/McpProtocol.js.map +1 -0
- package/dist/unstable/ai/McpSchema.d.ts +316 -250
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +71 -63
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +71 -62
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +765 -245
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +8 -19
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +9 -20
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +33 -11
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +194 -378
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +112 -38
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +53 -17
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +47 -33
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +23 -18
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +46 -13
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +18 -7
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +14 -3
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +63 -44
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +59 -42
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +35 -9
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +32 -14
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +4 -0
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +4 -0
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +15 -12
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/mcpProtocol.d.ts +21 -0
- package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol.js +22 -0
- package/dist/unstable/ai/internal/mcpProtocol.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js +32 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
- package/dist/unstable/ai/internal/structured-output.d.ts +2 -0
- package/dist/unstable/ai/internal/structured-output.d.ts.map +1 -0
- package/dist/unstable/ai/internal/structured-output.js +315 -0
- package/dist/unstable/ai/internal/structured-output.js.map +1 -0
- package/dist/unstable/cli/Argument.d.ts +273 -69
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +111 -33
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliConfig.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +105 -74
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +98 -63
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +35 -54
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +26 -42
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +705 -107
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +252 -47
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +418 -138
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +197 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +12 -4
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +292 -78
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +131 -49
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +370 -149
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +345 -137
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +23 -14
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +23 -14
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +3 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +11 -4
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +0 -48
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js +8 -10
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js +17 -7
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +2 -2
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
- package/dist/unstable/cluster/ClusterSchema.js +8 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +6 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +10 -10
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +9 -9
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +4 -2
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +4 -2
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +5 -4
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +6 -4
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +9 -9
- package/dist/unstable/cluster/Message.js +6 -6
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +15 -15
- package/dist/unstable/cluster/MessageStorage.js +5 -5
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +5 -5
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +1 -1
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +2 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +16 -16
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +2 -2
- package/dist/unstable/cluster/RunnerStorage.js +1 -1
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +6 -6
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +19 -10
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js +1 -1
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +128 -26
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +13 -5
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +3 -3
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +4 -2
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +2 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +1 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +8 -8
- package/dist/unstable/cluster/Snowflake.js +8 -8
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +7 -4
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +56 -25
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +127 -65
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +24 -12
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/cluster/internal/shardLock.d.ts +2 -0
- package/dist/unstable/cluster/internal/shardLock.d.ts.map +1 -0
- package/dist/unstable/cluster/internal/shardLock.js +4 -0
- package/dist/unstable/cluster/internal/shardLock.js.map +1 -0
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +20 -20
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +8 -5
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +6 -8
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +72 -8
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +58 -8
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +20 -20
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +4 -4
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +16 -16
- package/dist/unstable/eventlog/EventJournal.js +14 -14
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +3 -3
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +18 -14
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogEncryption.js +2 -2
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +6 -6
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +9 -4
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
- package/dist/unstable/eventlog/EventLogRemote.js +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +11 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +45 -21
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +4 -4
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +13 -5
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -5
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +14 -6
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +2 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +3 -3
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +2 -2
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +54 -40
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +1 -1
- package/dist/unstable/http/Etag.js +1 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +10 -10
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +5 -3
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +11 -5
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +51 -44
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +46 -17
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +44 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +16 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
- package/dist/unstable/http/HttpClientResponse.js +2 -2
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +6 -6
- package/dist/unstable/http/HttpEffect.js +3 -3
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +6 -9
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +6 -9
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +75 -9
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +164 -39
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +76 -0
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +32 -0
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +88 -89
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +78 -79
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +13 -13
- package/dist/unstable/http/HttpServer.js +6 -6
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +2 -2
- package/dist/unstable/http/HttpServerError.js +2 -2
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +9 -8
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +22 -0
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +10 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +35 -7
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +35 -7
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +6 -6
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +22 -20
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.js +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +33 -63
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +14 -28
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +10 -18
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +26 -31
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/compression.d.ts +2 -0
- package/dist/unstable/http/internal/compression.d.ts.map +1 -0
- package/dist/unstable/http/internal/compression.js +155 -0
- package/dist/unstable/http/internal/compression.js.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +10 -11
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -5
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +16 -18
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +42 -42
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.js +13 -13
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
- package/dist/unstable/httpapi/HttpApiGroup.js +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +71 -24
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +57 -10
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +0 -12
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +6 -6
- package/dist/unstable/httpapi/HttpApiSchema.js +4 -4
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +13 -13
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +50 -37
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/httpapi/internal/html.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/internal/mediaType.js.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +70 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +84 -6
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -3
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +11 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +5 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +16 -7
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +21 -12
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -3
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +2 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +13 -4
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +10 -3
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
- package/dist/unstable/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/unstable/observability/internal/protobuf.js +3 -0
- package/dist/unstable/observability/internal/protobuf.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +8 -3
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +22 -13
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -8
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +2 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
- package/dist/unstable/persistence/PersistedQueue.js +6 -6
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +3 -3
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +91 -15
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +28 -17
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +26 -15
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +2 -2
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +3 -3
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +64 -21
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +14 -5
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +21 -10
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +4 -2
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +8 -8
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +14 -13
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +105 -19
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +44 -12
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +4 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +25 -4
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +4 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +1 -1
- package/dist/unstable/reactivity/Hydration.js +1 -1
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +35 -33
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -2
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +12 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +14 -12
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
- package/dist/unstable/rpc/RpcGroup.js +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +31 -30
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +6 -6
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +10 -10
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +4 -4
- package/dist/unstable/rpc/RpcSchema.js +3 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +58 -7
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +175 -96
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +13 -13
- package/dist/unstable/rpc/RpcServer.js +17 -13
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +5 -5
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +52 -50
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +35 -33
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +6 -7
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +15 -12
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +12 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +10 -5
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +2 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.js +2 -2
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.js +2 -2
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +5 -5
- package/dist/unstable/sql/SqlResolver.js +2 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +6 -6
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +22 -21
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +2 -2
- package/dist/unstable/workers/Worker.js +2 -2
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +7 -7
- package/dist/unstable/workers/WorkerError.js +6 -6
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +1 -1
- package/dist/unstable/workers/WorkerRunner.js +1 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +2 -2
- package/dist/unstable/workflow/Activity.js +2 -2
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +1 -1
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +10 -10
- package/dist/unstable/workflow/DurableDeferred.js +5 -5
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +22 -20
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +22 -20
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +21 -21
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +13 -14
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +4 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +4 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.js.map +1 -1
- package/dist/unstable/workflow/internal/crypto.js.map +1 -1
- package/package.json +5 -6
- package/src/Array.ts +1068 -1070
- package/src/BigDecimal.ts +433 -756
- package/src/BigInt.ts +213 -269
- package/src/Boolean.ts +146 -188
- package/src/Cache.ts +409 -255
- package/src/Cause.ts +167 -277
- package/src/Channel.ts +923 -830
- package/src/ChannelSchema.ts +1 -1
- package/src/Chunk.ts +841 -1181
- package/src/Clock.ts +181 -49
- package/src/Combiner.ts +20 -33
- package/src/Config.ts +618 -334
- package/src/ConfigProvider.ts +221 -127
- package/src/Console.ts +289 -39
- package/src/Context.ts +319 -378
- package/src/Cron.ts +68 -77
- package/src/Crypto.ts +13 -15
- package/src/Data.ts +63 -82
- package/src/DateTime.ts +564 -660
- package/src/Deferred.ts +253 -256
- package/src/Duration.ts +216 -308
- package/src/Effect.ts +2958 -3390
- package/src/Encoding.ts +22 -40
- package/src/Equal.ts +49 -39
- package/src/Equivalence.ts +103 -105
- package/src/ErrorReporter.ts +51 -27
- package/src/ExecutionPlan.ts +13 -55
- package/src/Exit.ts +116 -192
- package/src/Fiber.ts +81 -148
- package/src/FiberHandle.ts +155 -107
- package/src/FiberMap.ts +225 -174
- package/src/FiberSet.ts +124 -82
- package/src/FileSystem.ts +155 -263
- package/src/Filter.ts +61 -33
- package/src/Formatter.ts +54 -56
- package/src/Function.ts +76 -145
- package/src/Graph.ts +416 -770
- package/src/HKT.ts +12 -6
- package/src/Hash.ts +52 -83
- package/src/HashMap.ts +319 -411
- package/src/HashRing.ts +1 -0
- package/src/HashSet.ts +177 -284
- package/src/Inspectable.ts +12 -12
- package/src/Iterable.ts +622 -787
- package/src/JsonPatch.ts +60 -113
- package/src/JsonPointer.ts +8 -8
- package/src/JsonSchema.ts +405 -249
- package/src/Latch.ts +23 -35
- package/src/Layer.ts +359 -260
- package/src/LayerMap.ts +49 -29
- package/src/LayerRef.ts +6 -2
- package/src/LogLevel.ts +114 -214
- package/src/Logger.ts +347 -699
- package/src/ManagedRuntime.ts +20 -5
- package/src/Match.ts +217 -252
- package/src/Metric.ts +520 -1092
- package/src/MutableHashMap.ts +218 -255
- package/src/MutableHashSet.ts +84 -89
- package/src/MutableList.ts +73 -370
- package/src/MutableRef.ts +420 -243
- package/src/Newtype.ts +21 -14
- package/src/NonEmptyIterable.ts +7 -137
- package/src/Number.ts +196 -233
- package/src/Optic.ts +246 -385
- package/src/Option.ts +449 -813
- package/src/Order.ts +109 -109
- package/src/Ordering.ts +20 -23
- package/src/PartitionedSemaphore.ts +1 -4
- package/src/Path.ts +38 -41
- package/src/Pipeable.ts +6 -5
- package/src/PlatformError.ts +4 -4
- package/src/Pool.ts +4 -2
- package/src/Predicate.ts +200 -181
- package/src/PrimaryKey.ts +7 -7
- package/src/PubSub.ts +526 -552
- package/src/Pull.ts +24 -18
- package/src/Queue.ts +200 -159
- package/src/Random.ts +49 -74
- package/src/RcMap.ts +121 -63
- package/src/RcRef.ts +24 -13
- package/src/Record.ts +387 -487
- package/src/Redactable.ts +10 -3
- package/src/Redacted.ts +25 -25
- package/src/Reducer.ts +8 -15
- package/src/Ref.ts +221 -361
- package/src/References.ts +102 -214
- package/src/RegExp.ts +10 -14
- package/src/Request.ts +36 -28
- package/src/RequestResolver.ts +202 -91
- package/src/Result.ts +314 -485
- package/src/Runtime.ts +50 -75
- package/src/Schedule.ts +308 -1734
- package/src/Scheduler.ts +20 -7
- package/src/Schema.ts +3156 -1634
- package/src/SchemaAST.ts +676 -489
- package/src/SchemaError.ts +8 -7
- package/src/SchemaGetter.ts +277 -218
- package/src/SchemaIssue.ts +90 -276
- package/src/SchemaParser.ts +179 -116
- package/src/SchemaRepresentation.ts +698 -3417
- package/src/SchemaTransformation.ts +132 -91
- package/src/Scope.ts +123 -151
- package/src/ScopedRef.ts +4 -4
- package/src/Semaphore.ts +157 -54
- package/src/Sink.ts +128 -113
- package/src/Stdio.ts +1 -1
- package/src/Stream.ts +2665 -3142
- package/src/String.ts +275 -312
- package/src/Struct.ts +114 -118
- package/src/SubscriptionRef.ts +284 -252
- package/src/Symbol.ts +3 -3
- package/src/Terminal.ts +2 -2
- package/src/Tracer.ts +102 -55
- package/src/Trie.ts +287 -679
- package/src/Tuple.ts +92 -127
- package/src/TxChunk.ts +201 -121
- package/src/TxDeferred.ts +62 -46
- package/src/TxHashMap.ts +645 -799
- package/src/TxHashSet.ts +443 -356
- package/src/TxPriorityQueue.ts +130 -98
- package/src/TxPubSub.ts +107 -80
- package/src/TxQueue.ts +214 -183
- package/src/TxReentrantLock.ts +97 -66
- package/src/TxRef.ts +51 -32
- package/src/TxSemaphore.ts +129 -95
- package/src/TxSubscriptionRef.ts +97 -70
- package/src/Types.ts +127 -70
- package/src/Unify.ts +45 -65
- package/src/Utils.ts +23 -16
- package/src/index.ts +0 -5
- package/src/internal/core.ts +5 -4
- package/src/internal/dateTime.ts +6 -0
- package/src/internal/effect.ts +160 -79
- package/src/internal/matcher.ts +1 -1
- package/src/internal/persistence.ts +2 -0
- package/src/internal/record.ts +11 -7
- package/src/internal/references.ts +3 -7
- package/src/internal/schema/annotations.ts +44 -0
- package/src/internal/schema/fromJsonSchemaDocument.ts +959 -0
- package/src/internal/schema/fromRepresentation.ts +339 -0
- package/src/internal/schema/parser.ts +22 -0
- package/src/internal/schema/schema.ts +45 -46
- package/src/internal/schema/{arbitrary.ts → toArbitrary.ts} +8 -10
- package/src/internal/schema/toCodeDocument.ts +572 -0
- package/src/internal/schema/{equivalence.ts → toEquivalence.ts} +12 -7
- package/src/internal/schema/toJsonSchemaDocument.ts +529 -0
- package/src/internal/schema/toRepresentation.ts +386 -0
- package/src/internal/stackTraceLimit.ts +3 -7
- package/src/internal/trie.ts +10 -11
- package/src/testing/FastCheck.ts +8 -7
- package/src/testing/TestClock.ts +73 -31
- package/src/testing/TestConsole.ts +32 -31
- package/src/testing/TestSchema.ts +29 -29
- package/src/unstable/ai/AiError.ts +100 -122
- package/src/unstable/ai/AnthropicStructuredOutput.ts +103 -334
- package/src/unstable/ai/Chat.ts +132 -97
- package/src/unstable/ai/EmbeddingModel.ts +1 -1
- package/src/unstable/ai/IdGenerator.ts +32 -28
- package/src/unstable/ai/LanguageModel.ts +137 -95
- package/src/unstable/ai/McpProtocol.ts +48 -0
- package/src/unstable/ai/McpSchema.ts +75 -65
- package/src/unstable/ai/McpServer.ts +1045 -303
- package/src/unstable/ai/Model.ts +9 -20
- package/src/unstable/ai/OpenAiStructuredOutput.ts +231 -396
- package/src/unstable/ai/Prompt.ts +145 -43
- package/src/unstable/ai/Response.ts +52 -38
- package/src/unstable/ai/Telemetry.ts +46 -13
- package/src/unstable/ai/Tokenizer.ts +14 -3
- package/src/unstable/ai/Tool.ts +81 -48
- package/src/unstable/ai/Toolkit.ts +45 -15
- package/src/unstable/ai/index.ts +5 -0
- package/src/unstable/ai/internal/codec-transformer.ts +13 -7
- package/src/unstable/ai/internal/mcpProtocol.ts +85 -0
- package/src/unstable/ai/internal/mcpProtocolRegistry.ts +70 -0
- package/src/unstable/ai/internal/structured-output.ts +453 -0
- package/src/unstable/cli/Argument.ts +273 -69
- package/src/unstable/cli/CliError.ts +116 -77
- package/src/unstable/cli/CliOutput.ts +44 -58
- package/src/unstable/cli/Command.ts +709 -111
- package/src/unstable/cli/Flag.ts +418 -138
- package/src/unstable/cli/GlobalFlag.ts +1 -1
- package/src/unstable/cli/HelpDoc.ts +12 -4
- package/src/unstable/cli/Param.ts +295 -81
- package/src/unstable/cli/Primitive.ts +371 -150
- package/src/unstable/cli/Prompt.ts +28 -14
- package/src/unstable/cli/internal/command.ts +13 -5
- package/src/unstable/cli/internal/config.ts +8 -10
- package/src/unstable/cli/internal/lexer.ts +8 -2
- package/src/unstable/cli/internal/parser.ts +2 -2
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +8 -4
- package/src/unstable/cluster/Entity.ts +16 -17
- package/src/unstable/cluster/EntityProxy.ts +4 -2
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/Envelope.ts +5 -4
- package/src/unstable/cluster/HttpRunner.ts +6 -4
- package/src/unstable/cluster/Message.ts +9 -9
- package/src/unstable/cluster/MessageStorage.ts +15 -15
- package/src/unstable/cluster/Reply.ts +5 -7
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerAddress.ts +1 -1
- package/src/unstable/cluster/RunnerHealth.ts +1 -1
- package/src/unstable/cluster/RunnerServer.ts +41 -8
- package/src/unstable/cluster/RunnerStorage.ts +2 -2
- package/src/unstable/cluster/Runners.ts +23 -12
- package/src/unstable/cluster/ShardId.ts +1 -1
- package/src/unstable/cluster/Sharding.ts +168 -42
- package/src/unstable/cluster/ShardingConfig.ts +8 -4
- package/src/unstable/cluster/SingleRunner.ts +4 -2
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +8 -8
- package/src/unstable/cluster/SqlMessageStorage.ts +84 -36
- package/src/unstable/cluster/SqlRunnerStorage.ts +205 -119
- package/src/unstable/cluster/internal/entityManager.ts +42 -25
- package/src/unstable/cluster/internal/shardLock.ts +9 -0
- package/src/unstable/devtools/DevToolsSchema.ts +10 -5
- package/src/unstable/encoding/Msgpack.ts +6 -8
- package/src/unstable/encoding/Sse.ts +98 -16
- package/src/unstable/eventlog/Event.ts +20 -20
- package/src/unstable/eventlog/EventGroup.ts +4 -4
- package/src/unstable/eventlog/EventJournal.ts +16 -16
- package/src/unstable/eventlog/EventLog.ts +24 -14
- package/src/unstable/eventlog/EventLogEncryption.ts +2 -2
- package/src/unstable/eventlog/EventLogMessage.ts +12 -5
- package/src/unstable/eventlog/EventLogRemote.ts +1 -1
- package/src/unstable/eventlog/EventLogServer.ts +41 -7
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +13 -5
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +14 -6
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +2 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +1 -1
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +6 -3
- package/src/unstable/http/Cookies.ts +64 -45
- package/src/unstable/http/Etag.ts +1 -1
- package/src/unstable/http/FetchHttpClient.ts +3 -1
- package/src/unstable/http/Headers.ts +10 -10
- package/src/unstable/http/HttpBody.ts +20 -5
- package/src/unstable/http/HttpClient.ts +83 -55
- package/src/unstable/http/HttpClientRequest.ts +59 -0
- package/src/unstable/http/HttpClientResponse.ts +4 -4
- package/src/unstable/http/HttpEffect.ts +8 -8
- package/src/unstable/http/HttpMethod.ts +6 -9
- package/src/unstable/http/HttpMiddleware.ts +202 -39
- package/src/unstable/http/HttpPlatform.ts +95 -0
- package/src/unstable/http/HttpRouter.ts +102 -98
- package/src/unstable/http/HttpServer.ts +13 -13
- package/src/unstable/http/HttpServerError.ts +2 -2
- package/src/unstable/http/HttpServerRequest.ts +9 -8
- package/src/unstable/http/HttpServerResponse.ts +30 -0
- package/src/unstable/http/HttpStaticServer.ts +35 -7
- package/src/unstable/http/Multipart.ts +22 -19
- package/src/unstable/http/Template.ts +1 -1
- package/src/unstable/http/Url.ts +33 -63
- package/src/unstable/http/UrlParams.ts +27 -32
- package/src/unstable/http/internal/compression.ts +196 -0
- package/src/unstable/httpapi/HttpApi.ts +3 -3
- package/src/unstable/httpapi/HttpApiBuilder.ts +10 -9
- package/src/unstable/httpapi/HttpApiClient.ts +19 -19
- package/src/unstable/httpapi/HttpApiEndpoint.ts +42 -42
- package/src/unstable/httpapi/HttpApiError.ts +13 -13
- package/src/unstable/httpapi/HttpApiGroup.ts +16 -16
- package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
- package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
- package/src/unstable/httpapi/HttpApiSchema.ts +6 -6
- package/src/unstable/httpapi/OpenApi.ts +65 -41
- package/src/unstable/observability/OtlpExporter.ts +126 -10
- package/src/unstable/observability/OtlpLogger.ts +5 -5
- package/src/unstable/observability/OtlpMetrics.ts +12 -5
- package/src/unstable/observability/OtlpResource.ts +26 -17
- package/src/unstable/observability/OtlpTracer.ts +8 -4
- package/src/unstable/observability/PrometheusMetrics.ts +13 -4
- package/src/unstable/observability/internal/otlpEnv.ts +1 -1
- package/src/unstable/observability/internal/protobuf.ts +3 -0
- package/src/unstable/persistence/KeyValueStore.ts +72 -49
- package/src/unstable/persistence/Persistable.ts +11 -10
- package/src/unstable/persistence/PersistedQueue.ts +6 -6
- package/src/unstable/persistence/Persistence.ts +126 -19
- package/src/unstable/persistence/RateLimiter.ts +28 -17
- package/src/unstable/persistence/Redis.ts +4 -4
- package/src/unstable/process/ChildProcess.ts +64 -21
- package/src/unstable/process/ChildProcessSpawner.ts +22 -11
- package/src/unstable/reactivity/AsyncResult.ts +16 -16
- package/src/unstable/reactivity/Atom.ts +117 -22
- package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
- package/src/unstable/reactivity/AtomRegistry.ts +25 -4
- package/src/unstable/reactivity/AtomRpc.ts +5 -4
- package/src/unstable/reactivity/Hydration.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +35 -33
- package/src/unstable/rpc/RpcClient.ts +18 -16
- package/src/unstable/rpc/RpcGroup.ts +8 -8
- package/src/unstable/rpc/RpcMessage.ts +31 -30
- package/src/unstable/rpc/RpcMiddleware.ts +10 -10
- package/src/unstable/rpc/RpcSchema.ts +4 -4
- package/src/unstable/rpc/RpcSerialization.ts +167 -68
- package/src/unstable/rpc/RpcServer.ts +18 -15
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/schema/Model.ts +52 -50
- package/src/unstable/schema/VariantSchema.ts +19 -29
- package/src/unstable/socket/Socket.ts +18 -5
- package/src/unstable/sql/SqlClient.ts +5 -6
- package/src/unstable/sql/SqlError.ts +2 -2
- package/src/unstable/sql/SqlModel.ts +2 -2
- package/src/unstable/sql/SqlResolver.ts +5 -5
- package/src/unstable/sql/Statement.ts +31 -29
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +2 -2
- package/src/unstable/workers/WorkerError.ts +7 -7
- package/src/unstable/workers/WorkerRunner.ts +1 -1
- package/src/unstable/workflow/Activity.ts +2 -2
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +10 -10
- package/src/unstable/workflow/DurableQueue.ts +22 -20
- package/src/unstable/workflow/Workflow.ts +23 -23
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
- package/src/unstable/workflow/WorkflowProxy.ts +4 -2
- package/dist/SchemaUtils.d.ts +0 -28
- package/dist/SchemaUtils.d.ts.map +0 -1
- package/dist/SchemaUtils.js +0 -45
- package/dist/SchemaUtils.js.map +0 -1
- package/dist/internal/schema/arbitrary.d.ts.map +0 -1
- package/dist/internal/schema/arbitrary.js.map +0 -1
- package/dist/internal/schema/equivalence.d.ts +0 -2
- package/dist/internal/schema/equivalence.d.ts.map +0 -1
- package/dist/internal/schema/equivalence.js.map +0 -1
- package/dist/internal/schema/representation.d.ts +0 -2
- package/dist/internal/schema/representation.d.ts.map +0 -1
- package/dist/internal/schema/representation.js +0 -865
- package/dist/internal/schema/representation.js.map +0 -1
- package/dist/internal/version.d.ts +0 -3
- package/dist/internal/version.d.ts.map +0 -1
- package/dist/internal/version.js +0 -2
- package/dist/internal/version.js.map +0 -1
- package/src/SchemaUtils.ts +0 -51
- package/src/internal/schema/representation.ts +0 -795
- package/src/internal/version.ts +0 -2
package/dist/SchemaAST.js
CHANGED
|
@@ -15,12 +15,12 @@ import * as Cause from "./Cause.js";
|
|
|
15
15
|
import * as Effect from "./Effect.js";
|
|
16
16
|
import * as Exit from "./Exit.js";
|
|
17
17
|
import { format, formatPropertyKey } from "./Formatter.js";
|
|
18
|
-
import { memoize } from "./Function.js";
|
|
18
|
+
import { identity, memoize } from "./Function.js";
|
|
19
19
|
import { effectIsExit, iterateEager } from "./internal/effect.js";
|
|
20
20
|
import * as InternalRecord from "./internal/record.js";
|
|
21
21
|
import * as InternalAnnotations from "./internal/schema/annotations.js";
|
|
22
22
|
import * as InternalSchemaCause from "./internal/schema/cause.js";
|
|
23
|
-
import * as
|
|
23
|
+
import * as InternalParser from "./internal/schema/parser.js";
|
|
24
24
|
import * as Pipeable from "./Pipeable.js";
|
|
25
25
|
import * as Predicate from "./Predicate.js";
|
|
26
26
|
import * as Result from "./Result.js";
|
|
@@ -443,10 +443,10 @@ export class Declaration extends Base {
|
|
|
443
443
|
}
|
|
444
444
|
/** @internal */
|
|
445
445
|
getParser() {
|
|
446
|
-
|
|
447
|
-
return (
|
|
448
|
-
if (
|
|
449
|
-
return
|
|
446
|
+
let run;
|
|
447
|
+
return (input, options) => {
|
|
448
|
+
if (input === InternalParser.missing) return InternalParser.missingExit;
|
|
449
|
+
return (run ??= this.run(this.typeParameters))(input, this, options);
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
452
|
_rebuild(recur, checks, encodingChecks) {
|
|
@@ -571,7 +571,8 @@ export class Void extends Base {
|
|
|
571
571
|
_tag = "Void";
|
|
572
572
|
/** @internal */
|
|
573
573
|
getParser() {
|
|
574
|
-
|
|
574
|
+
const succeed = InternalParser.succeed(undefined);
|
|
575
|
+
return input => input === InternalParser.missing ? InternalParser.missingExit : succeed;
|
|
575
576
|
}
|
|
576
577
|
/** @internal */
|
|
577
578
|
toCodecJson() {
|
|
@@ -797,9 +798,9 @@ function isTemplateLiteralPart(ast) {
|
|
|
797
798
|
return true;
|
|
798
799
|
case "Literal":
|
|
799
800
|
case "TemplateLiteral":
|
|
800
|
-
return ast.checks
|
|
801
|
+
return !ast.checks;
|
|
801
802
|
case "Union":
|
|
802
|
-
return ast.checks
|
|
803
|
+
return !ast.checks && ast.types.every(isTemplateLiteralPart);
|
|
803
804
|
default:
|
|
804
805
|
return false;
|
|
805
806
|
}
|
|
@@ -822,27 +823,47 @@ export class TemplateLiteral extends Base {
|
|
|
822
823
|
parts;
|
|
823
824
|
/** @internal */
|
|
824
825
|
encodedParts;
|
|
826
|
+
/** @internal */
|
|
827
|
+
literals;
|
|
828
|
+
/** @internal */
|
|
829
|
+
suffixLengths;
|
|
825
830
|
constructor(parts, annotations, checks, encoding, context) {
|
|
826
831
|
super(annotations, checks, encoding, context);
|
|
827
832
|
const encodedParts = [];
|
|
833
|
+
const literals = [];
|
|
828
834
|
for (const part of parts) {
|
|
829
835
|
const encoded = toEncoded(part);
|
|
830
836
|
if (isTemplateLiteralPart(encoded)) {
|
|
831
837
|
encodedParts.push(encoded);
|
|
838
|
+
literals.push(encoded._tag === "Literal" ? globalThis.String(encoded.literal) : undefined);
|
|
832
839
|
} else {
|
|
833
840
|
throw new Error(`Invalid TemplateLiteral part ${encoded._tag}`);
|
|
834
841
|
}
|
|
835
842
|
}
|
|
843
|
+
const suffixLengths = new Array(encodedParts.length + 1);
|
|
844
|
+
suffixLengths[encodedParts.length] = 0;
|
|
845
|
+
for (let i = encodedParts.length - 1; i >= 0; i--) {
|
|
846
|
+
suffixLengths[i] = suffixLengths[i + 1] + (literals[i]?.length ?? 0);
|
|
847
|
+
}
|
|
836
848
|
this.parts = parts;
|
|
837
849
|
this.encodedParts = encodedParts;
|
|
850
|
+
this.literals = literals;
|
|
851
|
+
this.suffixLengths = suffixLengths;
|
|
838
852
|
}
|
|
839
853
|
/** @internal */
|
|
840
854
|
getParser(recur) {
|
|
841
855
|
const parser = recur(this.asTemplateLiteralParser());
|
|
842
|
-
return (
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
856
|
+
return (input, options) => {
|
|
857
|
+
if (input === InternalParser.missing) return InternalParser.missingExit;
|
|
858
|
+
const result = parser(input, options);
|
|
859
|
+
if (result._tag === "Success") {
|
|
860
|
+
return InternalParser.sameExit;
|
|
861
|
+
}
|
|
862
|
+
return Effect.mapBothEager(result, {
|
|
863
|
+
onSuccess: () => input,
|
|
864
|
+
onFailure: issue => new SchemaIssue.Composite(this, [issue])
|
|
865
|
+
});
|
|
866
|
+
};
|
|
846
867
|
}
|
|
847
868
|
/** @internal */
|
|
848
869
|
getExpected() {
|
|
@@ -850,16 +871,16 @@ export class TemplateLiteral extends Base {
|
|
|
850
871
|
}
|
|
851
872
|
/** @internal */
|
|
852
873
|
matchPart(s, options) {
|
|
853
|
-
return segmentTemplateLiteralParts(this
|
|
874
|
+
return segmentTemplateLiteralParts(this, s, options) === undefined ? undefined : s;
|
|
854
875
|
}
|
|
855
876
|
/** @internal */
|
|
856
877
|
asTemplateLiteralParser() {
|
|
857
878
|
const tuple = new Arrays(false, this.parts.map(partFromString), []);
|
|
858
879
|
return decodeTo(string, tuple, new SchemaTransformation.Transformation(SchemaGetter.transformOrFail((s, options) => {
|
|
859
|
-
const segments = segmentTemplateLiteralParts(this
|
|
860
|
-
if (segments
|
|
861
|
-
return Effect.fail(new SchemaIssue.InvalidValue(
|
|
862
|
-
message:
|
|
880
|
+
const segments = segmentTemplateLiteralParts(this, s, options);
|
|
881
|
+
if (segments) return Effect.succeed(segments);
|
|
882
|
+
return Effect.fail(new SchemaIssue.InvalidValue({
|
|
883
|
+
message: "Expected a string matching template literal parts"
|
|
863
884
|
}));
|
|
864
885
|
}), SchemaGetter.transform(parts => parts.join(""))));
|
|
865
886
|
}
|
|
@@ -908,11 +929,11 @@ export class UniqueSymbol extends Base {
|
|
|
908
929
|
*
|
|
909
930
|
* **Example** (Creating a literal AST)
|
|
910
931
|
*
|
|
911
|
-
* ```ts
|
|
932
|
+
* ```ts import.meta.vitest
|
|
912
933
|
* import { SchemaAST } from "effect"
|
|
913
934
|
*
|
|
914
935
|
* const ast = new SchemaAST.Literal("active")
|
|
915
|
-
*
|
|
936
|
+
* ast.literal // => "active"
|
|
916
937
|
* ```
|
|
917
938
|
*
|
|
918
939
|
* @see {@link LiteralValue}
|
|
@@ -972,7 +993,8 @@ export class String extends Base {
|
|
|
972
993
|
}
|
|
973
994
|
/** @internal */
|
|
974
995
|
matchPart(s, options) {
|
|
975
|
-
|
|
996
|
+
const checks = this.checks;
|
|
997
|
+
return checks && !options.disableChecks && collectIssues(checks, s, undefined, this, options) ? undefined : s;
|
|
976
998
|
}
|
|
977
999
|
/** @internal */
|
|
978
1000
|
getExpected() {
|
|
@@ -1027,18 +1049,21 @@ export class Number extends Base {
|
|
|
1027
1049
|
return this._match(isStringFiniteRegExp, s, options);
|
|
1028
1050
|
}
|
|
1029
1051
|
_match(regexp, s, options) {
|
|
1030
|
-
|
|
1052
|
+
if (!regexp.test(s)) return undefined;
|
|
1053
|
+
const value = globalThis.Number(s);
|
|
1054
|
+
if (options.disableChecks || !this.checks) return value;
|
|
1055
|
+
return collectIssues(this.checks, value, undefined, this, options) ? undefined : value;
|
|
1031
1056
|
}
|
|
1032
1057
|
/** @internal */
|
|
1033
1058
|
toCodecJson() {
|
|
1034
|
-
if (this.checks && (hasCheck(this.checks, "isFinite") || hasCheck(this.checks, "isInt"))) {
|
|
1059
|
+
if (this.checks && (hasCheck(this.checks, "effect/schema/isFinite") || hasCheck(this.checks, "effect/schema/isInt"))) {
|
|
1035
1060
|
return this;
|
|
1036
1061
|
}
|
|
1037
|
-
return replaceEncoding(this, [numberToJson]);
|
|
1062
|
+
return replaceEncoding(this, [numberToJson(this.checks)]);
|
|
1038
1063
|
}
|
|
1039
1064
|
/** @internal */
|
|
1040
1065
|
toCodecStringTree() {
|
|
1041
|
-
if (this.
|
|
1066
|
+
if (this.toCodecJson() === this) {
|
|
1042
1067
|
return replaceEncoding(this, [finiteToString]);
|
|
1043
1068
|
}
|
|
1044
1069
|
return replaceEncoding(this, [numberToString]);
|
|
@@ -1048,16 +1073,12 @@ export class Number extends Base {
|
|
|
1048
1073
|
return "number";
|
|
1049
1074
|
}
|
|
1050
1075
|
}
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
case "FilterGroup":
|
|
1058
|
-
return hasCheck(c.checks, tag);
|
|
1059
|
-
}
|
|
1060
|
-
});
|
|
1076
|
+
function hasCheck(checks, id) {
|
|
1077
|
+
return checks.some(check => check.annotations?.representation?.id === id || check._tag === "FilterGroup" && hasCheck(check.checks, id));
|
|
1078
|
+
}
|
|
1079
|
+
function numberToJson(checks) {
|
|
1080
|
+
const encodedFinite = !checks ? finite : appendChecks(finite, checks);
|
|
1081
|
+
return new Link(new Union([encodedFinite, nonFiniteLiterals], "anyOf"), new SchemaTransformation.Transformation(SchemaGetter.Number(), SchemaGetter.transform(n => globalThis.Number.isFinite(n) ? n : globalThis.String(n))));
|
|
1061
1082
|
}
|
|
1062
1083
|
/**
|
|
1063
1084
|
* Provides the singleton {@link Number} AST instance.
|
|
@@ -1135,7 +1156,8 @@ export class Symbol extends Base {
|
|
|
1135
1156
|
}
|
|
1136
1157
|
/** @internal */
|
|
1137
1158
|
matchKey(s, options) {
|
|
1138
|
-
|
|
1159
|
+
if (options.disableChecks || !this.checks) return s;
|
|
1160
|
+
return collectIssues(this.checks, s, undefined, this, options) ? undefined : s;
|
|
1139
1161
|
}
|
|
1140
1162
|
/** @internal */
|
|
1141
1163
|
toCodecStringTree() {
|
|
@@ -1186,7 +1208,10 @@ export class BigInt extends Base {
|
|
|
1186
1208
|
}
|
|
1187
1209
|
/** @internal */
|
|
1188
1210
|
matchPart(s, options) {
|
|
1189
|
-
|
|
1211
|
+
if (!isStringBigIntRegExp.test(s)) return undefined;
|
|
1212
|
+
const value = globalThis.BigInt(s);
|
|
1213
|
+
if (options.disableChecks || !this.checks) return value;
|
|
1214
|
+
return collectIssues(this.checks, value, undefined, this, options) ? undefined : value;
|
|
1190
1215
|
}
|
|
1191
1216
|
/** @internal */
|
|
1192
1217
|
toCodecStringTree() {
|
|
@@ -1238,15 +1263,14 @@ export const bigInt = /*#__PURE__*/new BigInt();
|
|
|
1238
1263
|
*
|
|
1239
1264
|
* **Example** (Inspecting a tuple AST)
|
|
1240
1265
|
*
|
|
1241
|
-
* ```ts
|
|
1266
|
+
* ```ts import.meta.vitest
|
|
1242
1267
|
* import { Schema, SchemaAST } from "effect"
|
|
1243
1268
|
*
|
|
1244
1269
|
* const schema = Schema.Tuple([Schema.String, Schema.Number])
|
|
1245
1270
|
* const ast = schema.ast
|
|
1246
1271
|
*
|
|
1247
1272
|
* if (SchemaAST.isArrays(ast)) {
|
|
1248
|
-
*
|
|
1249
|
-
* console.log(ast.rest.length) // 0
|
|
1273
|
+
* [ast.elements.length, ast.rest.length] // => [2, 0]
|
|
1250
1274
|
* }
|
|
1251
1275
|
* ```
|
|
1252
1276
|
*
|
|
@@ -1267,55 +1291,65 @@ export class Arrays extends Base {
|
|
|
1267
1291
|
this.elements = elements;
|
|
1268
1292
|
this.rest = rest;
|
|
1269
1293
|
this.encodingChecks = encodingChecks;
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1294
|
+
let hasOptional = false;
|
|
1295
|
+
for (let i = 0; i < elements.length; i++) {
|
|
1296
|
+
if (isOptional(elements[i])) {
|
|
1297
|
+
hasOptional = true;
|
|
1298
|
+
} else if (hasOptional) {
|
|
1299
|
+
throw new Error("A required element cannot follow an optional element. ts(1257)");
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
if (hasOptional && rest.length > 1) {
|
|
1273
1303
|
throw new Error("A required element cannot follow an optional element. ts(1257)");
|
|
1274
1304
|
}
|
|
1275
1305
|
// An optional element cannot follow a rest element.ts(1266)
|
|
1276
|
-
|
|
1277
|
-
|
|
1306
|
+
for (let i = 1; i < rest.length; i++) {
|
|
1307
|
+
if (isOptional(rest[i])) {
|
|
1308
|
+
throw new Error("An optional element cannot follow a rest element. ts(1266)");
|
|
1309
|
+
}
|
|
1278
1310
|
}
|
|
1279
1311
|
}
|
|
1280
1312
|
/** @internal */
|
|
1281
1313
|
getParser(recur) {
|
|
1282
1314
|
// oxlint-disable-next-line @typescript-eslint/no-this-alias
|
|
1283
1315
|
const ast = this;
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
const rest = ast.rest.map(ast => ({
|
|
1289
|
-
ast,
|
|
1290
|
-
parser: recur(ast)
|
|
1291
|
-
}));
|
|
1292
|
-
const elementLen = elements.length;
|
|
1293
|
-
const [head, ...tail] = rest;
|
|
1294
|
-
const tailLen = tail.length;
|
|
1316
|
+
let elements;
|
|
1317
|
+
let rest;
|
|
1318
|
+
const elementLen = ast.elements.length;
|
|
1319
|
+
const tailLen = Math.max(0, ast.rest.length - 1);
|
|
1295
1320
|
function getParser(tailThreshold, index) {
|
|
1296
1321
|
if (index < elementLen) {
|
|
1297
1322
|
return elements[index];
|
|
1298
1323
|
} else if (index >= tailThreshold) {
|
|
1299
|
-
return
|
|
1324
|
+
return rest[index - tailThreshold + 1];
|
|
1300
1325
|
}
|
|
1301
|
-
return
|
|
1326
|
+
return rest[0];
|
|
1302
1327
|
}
|
|
1303
|
-
return Effect.fnUntracedEager(function* (
|
|
1304
|
-
if (
|
|
1305
|
-
return
|
|
1328
|
+
return Effect.fnUntracedEager(function* (input, options) {
|
|
1329
|
+
if (input === InternalParser.missing) {
|
|
1330
|
+
return InternalParser.missing;
|
|
1306
1331
|
}
|
|
1307
|
-
const input = oinput.value;
|
|
1308
1332
|
// If the input is not an array, return early with an error
|
|
1309
1333
|
if (!Array.isArray(input)) {
|
|
1310
|
-
return yield* Effect.fail(new SchemaIssue.InvalidType(ast
|
|
1334
|
+
return yield* Effect.fail(new SchemaIssue.InvalidType(ast));
|
|
1335
|
+
}
|
|
1336
|
+
if (!elements) {
|
|
1337
|
+
elements = ast.elements.map(ast => ({
|
|
1338
|
+
ast,
|
|
1339
|
+
parser: recur(ast)
|
|
1340
|
+
}));
|
|
1341
|
+
rest = ast.rest.map(ast => ({
|
|
1342
|
+
ast,
|
|
1343
|
+
parser: recur(ast)
|
|
1344
|
+
}));
|
|
1311
1345
|
}
|
|
1312
1346
|
const len = input.length;
|
|
1313
1347
|
const state = {
|
|
1314
1348
|
ast,
|
|
1315
1349
|
getParser,
|
|
1316
|
-
|
|
1350
|
+
input,
|
|
1317
1351
|
len,
|
|
1318
|
-
tailThreshold:
|
|
1352
|
+
tailThreshold: Math.max(elementLen, len - tailLen),
|
|
1319
1353
|
output: new globalThis.Array(len),
|
|
1320
1354
|
issues: undefined,
|
|
1321
1355
|
options
|
|
@@ -1331,18 +1365,18 @@ export class Arrays extends Base {
|
|
|
1331
1365
|
// ---------------------------------------------
|
|
1332
1366
|
if (ast.rest.length === 0 && len > elementLen) {
|
|
1333
1367
|
for (let i = elementLen; i <= len - 1; i++) {
|
|
1334
|
-
const issue = new SchemaIssue.Pointer([i], new SchemaIssue.UnexpectedKey(ast
|
|
1368
|
+
const issue = new SchemaIssue.Pointer([i], new SchemaIssue.UnexpectedKey(ast));
|
|
1335
1369
|
if (options.errors === "all") {
|
|
1336
1370
|
if (state.issues) state.issues.push(issue);else state.issues = [issue];
|
|
1337
1371
|
} else {
|
|
1338
|
-
return yield* Effect.fail(new SchemaIssue.Composite(ast,
|
|
1372
|
+
return yield* Effect.fail(new SchemaIssue.Composite(ast, [issue]));
|
|
1339
1373
|
}
|
|
1340
1374
|
}
|
|
1341
1375
|
}
|
|
1342
1376
|
if (state.issues) {
|
|
1343
|
-
return yield* Effect.fail(new SchemaIssue.Composite(ast,
|
|
1377
|
+
return yield* Effect.fail(new SchemaIssue.Composite(ast, state.issues));
|
|
1344
1378
|
}
|
|
1345
|
-
return
|
|
1379
|
+
return state.output;
|
|
1346
1380
|
});
|
|
1347
1381
|
}
|
|
1348
1382
|
_rebuild(recur, checks, encodingChecks) {
|
|
@@ -1365,14 +1399,16 @@ export class Arrays extends Base {
|
|
|
1365
1399
|
}
|
|
1366
1400
|
const parseArray = /*#__PURE__*/iterateEager()({
|
|
1367
1401
|
onItem(s, item, i) {
|
|
1368
|
-
const value = i < s.len ?
|
|
1402
|
+
const value = i < s.len ? item : InternalParser.missing;
|
|
1369
1403
|
return s.getParser(s.tailThreshold, i).parser(value, s.options);
|
|
1370
1404
|
},
|
|
1371
|
-
step(s,
|
|
1405
|
+
step(s, item, exit, i) {
|
|
1372
1406
|
if (exit._tag === "Failure") {
|
|
1373
1407
|
return wrapPropertyKeyIssue(s, s.ast, i, exit);
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1408
|
+
}
|
|
1409
|
+
const value = exit === InternalParser.sameExit ? item : exit[InternalParser.args];
|
|
1410
|
+
if (value !== InternalParser.missing) {
|
|
1411
|
+
s.output[i] = value;
|
|
1376
1412
|
} else {
|
|
1377
1413
|
const p = s.getParser(s.tailThreshold, i);
|
|
1378
1414
|
if (isOptional(p.ast)) return;
|
|
@@ -1380,14 +1416,11 @@ const parseArray = /*#__PURE__*/iterateEager()({
|
|
|
1380
1416
|
if (s.options.errors === "all") {
|
|
1381
1417
|
if (s.issues) s.issues.push(issue);else s.issues = [issue];
|
|
1382
1418
|
} else {
|
|
1383
|
-
return Exit.fail(new SchemaIssue.Composite(s.ast,
|
|
1419
|
+
return Exit.fail(new SchemaIssue.Composite(s.ast, [issue]));
|
|
1384
1420
|
}
|
|
1385
1421
|
}
|
|
1386
1422
|
}
|
|
1387
1423
|
});
|
|
1388
|
-
function resolveTailThreshold(inputLen, elementLen, tailLen) {
|
|
1389
|
-
return Math.max(elementLen, inputLen - tailLen);
|
|
1390
|
-
}
|
|
1391
1424
|
const resolveConcurrency = value => {
|
|
1392
1425
|
value = value === "unbounded" ? Infinity : value ?? 1;
|
|
1393
1426
|
return value > 1 ? {
|
|
@@ -1400,13 +1433,13 @@ const wrapPropertyKeyIssue = (s, ast, key, exit) => {
|
|
|
1400
1433
|
}
|
|
1401
1434
|
const issue = InternalSchemaCause.getSchemaIssue(exit.cause);
|
|
1402
1435
|
if (issue === undefined) {
|
|
1403
|
-
return Exit.failCause(Cause.map(exit.cause, issue => new SchemaIssue.Composite(ast,
|
|
1436
|
+
return Exit.failCause(Cause.map(exit.cause, issue => new SchemaIssue.Composite(ast, [new SchemaIssue.Pointer([key], issue)])));
|
|
1404
1437
|
}
|
|
1405
1438
|
const pointer = new SchemaIssue.Pointer([key], issue);
|
|
1406
1439
|
if (s.options.errors === "all") {
|
|
1407
1440
|
if (s.issues) s.issues.push(pointer);else s.issues = [pointer];
|
|
1408
1441
|
} else {
|
|
1409
|
-
return Exit.fail(new SchemaIssue.Composite(ast,
|
|
1442
|
+
return Exit.fail(new SchemaIssue.Composite(ast, [pointer]));
|
|
1410
1443
|
}
|
|
1411
1444
|
};
|
|
1412
1445
|
/**
|
|
@@ -1459,32 +1492,6 @@ export class PropertySignature {
|
|
|
1459
1492
|
this.type = type;
|
|
1460
1493
|
}
|
|
1461
1494
|
}
|
|
1462
|
-
/**
|
|
1463
|
-
* Represents a bidirectional merge strategy for index signature key-value pairs.
|
|
1464
|
-
*
|
|
1465
|
-
* **Details**
|
|
1466
|
-
*
|
|
1467
|
-
* Used by {@link IndexSignature} when the same key appears multiple times
|
|
1468
|
-
* (e.g. from `Schema.extend` or overlapping records). Provides separate
|
|
1469
|
-
* `decode` and `encode` combiners that determine how duplicate entries are
|
|
1470
|
-
* merged.
|
|
1471
|
-
*
|
|
1472
|
-
* @see {@link IndexSignature}
|
|
1473
|
-
* @category models
|
|
1474
|
-
* @since 4.0.0
|
|
1475
|
-
*/
|
|
1476
|
-
export class KeyValueCombiner {
|
|
1477
|
-
decode;
|
|
1478
|
-
encode;
|
|
1479
|
-
constructor(decode, encode) {
|
|
1480
|
-
this.decode = decode;
|
|
1481
|
-
this.encode = encode;
|
|
1482
|
-
}
|
|
1483
|
-
/** @internal */
|
|
1484
|
-
flip() {
|
|
1485
|
-
return new KeyValueCombiner(this.encode, this.decode);
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
1495
|
function isIndexSignatureParameterSide(ast) {
|
|
1489
1496
|
switch (ast._tag) {
|
|
1490
1497
|
case "String":
|
|
@@ -1514,7 +1521,6 @@ function isIndexSignatureParameter(ast) {
|
|
|
1514
1521
|
* - `parameter` — the key type AST (e.g. {@link String} for `string` keys,
|
|
1515
1522
|
* {@link TemplateLiteral} for patterned keys).
|
|
1516
1523
|
* - `type` — the value type SchemaAST.
|
|
1517
|
-
* - `merge` — optional {@link KeyValueCombiner} for handling duplicate keys.
|
|
1518
1524
|
*
|
|
1519
1525
|
* **Gotchas**
|
|
1520
1526
|
*
|
|
@@ -1529,14 +1535,12 @@ function isIndexSignatureParameter(ast) {
|
|
|
1529
1535
|
export class IndexSignature {
|
|
1530
1536
|
parameter;
|
|
1531
1537
|
type;
|
|
1532
|
-
|
|
1533
|
-
constructor(parameter, type, merge) {
|
|
1538
|
+
constructor(parameter, type) {
|
|
1534
1539
|
if (!isIndexSignatureParameter(parameter)) {
|
|
1535
1540
|
throw new Error(`Invalid index signature parameter ${parameter._tag}`);
|
|
1536
1541
|
}
|
|
1537
1542
|
this.parameter = parameter;
|
|
1538
1543
|
this.type = type;
|
|
1539
|
-
this.merge = merge;
|
|
1540
1544
|
if (isOptional(type) && !containsUndefined(type)) {
|
|
1541
1545
|
throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.");
|
|
1542
1546
|
}
|
|
@@ -1566,17 +1570,14 @@ export class IndexSignature {
|
|
|
1566
1570
|
*
|
|
1567
1571
|
* **Example** (Inspecting a struct AST)
|
|
1568
1572
|
*
|
|
1569
|
-
* ```ts
|
|
1573
|
+
* ```ts import.meta.vitest
|
|
1570
1574
|
* import { Schema, SchemaAST } from "effect"
|
|
1571
1575
|
*
|
|
1572
1576
|
* const schema = Schema.Struct({ name: Schema.String })
|
|
1573
1577
|
* const ast = schema.ast
|
|
1574
1578
|
*
|
|
1575
1579
|
* if (SchemaAST.isObjects(ast)) {
|
|
1576
|
-
*
|
|
1577
|
-
* console.log(ps.name, ps.type._tag)
|
|
1578
|
-
* }
|
|
1579
|
-
* // "name" "String"
|
|
1580
|
+
* ast.propertySignatures.map((ps) => [ps.name, ps.type._tag]) // => [["name", "String"]]
|
|
1580
1581
|
* }
|
|
1581
1582
|
* ```
|
|
1582
1583
|
*
|
|
@@ -1608,73 +1609,81 @@ export class Objects extends Base {
|
|
|
1608
1609
|
// oxlint-disable-next-line @typescript-eslint/no-this-alias
|
|
1609
1610
|
const ast = this;
|
|
1610
1611
|
const expectedKeys = [];
|
|
1611
|
-
const expectedKeysSet = new Set();
|
|
1612
|
-
const properties = [];
|
|
1613
1612
|
for (const ps of ast.propertySignatures) {
|
|
1614
1613
|
expectedKeys.push(ps.name);
|
|
1615
|
-
expectedKeysSet.add(ps.name);
|
|
1616
|
-
properties.push({
|
|
1617
|
-
ps,
|
|
1618
|
-
parser: recur(ps.type),
|
|
1619
|
-
name: ps.name,
|
|
1620
|
-
type: ps.type
|
|
1621
|
-
});
|
|
1622
1614
|
}
|
|
1615
|
+
const hasProperties = expectedKeys.length;
|
|
1623
1616
|
const indexCount = ast.indexSignatures.length;
|
|
1617
|
+
let expectedKeysSet = hasProperties && indexCount ? new Set(expectedKeys) : undefined;
|
|
1624
1618
|
// ---------------------------------------------
|
|
1625
1619
|
// handle empty struct
|
|
1626
1620
|
// ---------------------------------------------
|
|
1627
|
-
if (
|
|
1621
|
+
if (!hasProperties && !indexCount) {
|
|
1628
1622
|
return fromRefinement(ast, Predicate.isNotNullish);
|
|
1629
1623
|
}
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
return;
|
|
1648
|
-
} else if (exitKey.value._tag === "Some" && exitValue.value._tag === "Some") {
|
|
1649
|
-
const k2 = exitKey.value.value;
|
|
1650
|
-
if (expectedKeysSet.has(key) || expectedKeysSet.has(k2)) {
|
|
1651
|
-
return;
|
|
1652
|
-
}
|
|
1653
|
-
const v2 = exitValue.value.value;
|
|
1654
|
-
if (is.merge && is.merge.decode && Object.hasOwn(s.out, k2)) {
|
|
1655
|
-
const [k, v] = is.merge.decode.combine([k2, s.out[k2]], [k2, v2]);
|
|
1656
|
-
InternalRecord.set(s.out, k, v);
|
|
1657
|
-
} else {
|
|
1658
|
-
InternalRecord.set(s.out, k2, v2);
|
|
1659
|
-
}
|
|
1624
|
+
let properties;
|
|
1625
|
+
let indexes;
|
|
1626
|
+
const finishIndex = (s, key, k2, inputValue, exitValue) => {
|
|
1627
|
+
if (exitValue._tag === "Failure") {
|
|
1628
|
+
return wrapPropertyKeyIssue(s, ast, key, exitValue) ?? Exit.void;
|
|
1629
|
+
}
|
|
1630
|
+
const value = exitValue === InternalParser.sameExit ? inputValue : exitValue[InternalParser.args];
|
|
1631
|
+
if (k2 !== InternalParser.missing && value !== InternalParser.missing) {
|
|
1632
|
+
if (hasProperties && (expectedKeysSet.has(key) || expectedKeysSet.has(k2))) return Exit.void;
|
|
1633
|
+
InternalRecord.assignProperty(s.out, k2, value);
|
|
1634
|
+
}
|
|
1635
|
+
return Exit.void;
|
|
1636
|
+
};
|
|
1637
|
+
const parseIndex = (s, key, index, exitKey) => {
|
|
1638
|
+
if (!exitKey) {
|
|
1639
|
+
const eff = index.parserKey(key, s.options);
|
|
1640
|
+
if (!effectIsExit(eff)) {
|
|
1641
|
+
return Effect.flatMap(Effect.exit(eff), exit => parseIndex(s, key, index, exit));
|
|
1660
1642
|
}
|
|
1661
|
-
|
|
1643
|
+
exitKey = eff;
|
|
1644
|
+
}
|
|
1645
|
+
if (exitKey._tag === "Failure") {
|
|
1646
|
+
return wrapPropertyKeyIssue(s, ast, key, exitKey) ?? Exit.void;
|
|
1647
|
+
}
|
|
1648
|
+
const k2 = exitKey === InternalParser.sameExit ? key : exitKey[InternalParser.args];
|
|
1649
|
+
const inputValue = s.input[key];
|
|
1650
|
+
const result = index.parserValue(inputValue, s.options);
|
|
1651
|
+
return effectIsExit(result) ? finishIndex(s, key, k2, inputValue, result) : Effect.flatMap(Effect.exit(result), exit => finishIndex(s, key, k2, inputValue, exit));
|
|
1652
|
+
};
|
|
1653
|
+
const parseStringIndex = (s, key, index) => {
|
|
1654
|
+
const inputValue = s.input[key];
|
|
1655
|
+
const result = index.parserValue(inputValue, s.options);
|
|
1656
|
+
return effectIsExit(result) ? finishIndex(s, key, key, inputValue, result) : Effect.flatMap(Effect.exit(result), exit => finishIndex(s, key, key, inputValue, exit));
|
|
1657
|
+
};
|
|
1658
|
+
const parseIndexes = indexCount ? iterateEager()({
|
|
1659
|
+
onItem: (s, [key, index]) => parseIndex(s, key, index),
|
|
1662
1660
|
step: (_s, _, exit) => exit._tag === "Failure" ? exit : undefined
|
|
1663
1661
|
}) : undefined;
|
|
1664
|
-
return Effect.fnUntracedEager(function* (
|
|
1665
|
-
if (
|
|
1666
|
-
return
|
|
1662
|
+
return Effect.fnUntracedEager(function* (input, options) {
|
|
1663
|
+
if (input === InternalParser.missing) {
|
|
1664
|
+
return InternalParser.missing;
|
|
1667
1665
|
}
|
|
1668
|
-
const input = oinput.value;
|
|
1669
1666
|
// If the input is not a record, return early with an error
|
|
1670
1667
|
if (!(typeof input === "object" && input !== null && !Array.isArray(input))) {
|
|
1671
|
-
return yield* Effect.fail(new SchemaIssue.InvalidType(ast
|
|
1668
|
+
return yield* Effect.fail(new SchemaIssue.InvalidType(ast));
|
|
1672
1669
|
}
|
|
1670
|
+
if (!properties) {
|
|
1671
|
+
properties = ast.propertySignatures.map(ps => ({
|
|
1672
|
+
parser: recur(ps.type),
|
|
1673
|
+
name: ps.name,
|
|
1674
|
+
type: ps.type
|
|
1675
|
+
}));
|
|
1676
|
+
indexes = indexCount ? ast.indexSignatures.map(is => ({
|
|
1677
|
+
is,
|
|
1678
|
+
parserKey: recur(parameterFromPropertyKey(is.parameter)),
|
|
1679
|
+
parserValue: recur(is.type)
|
|
1680
|
+
})) : undefined;
|
|
1681
|
+
}
|
|
1682
|
+
const record = input;
|
|
1673
1683
|
const out = {};
|
|
1674
1684
|
const state = {
|
|
1675
1685
|
ast,
|
|
1676
|
-
|
|
1677
|
-
input,
|
|
1686
|
+
input: record,
|
|
1678
1687
|
out,
|
|
1679
1688
|
issues: undefined,
|
|
1680
1689
|
options
|
|
@@ -1686,14 +1695,15 @@ export class Objects extends Base {
|
|
|
1686
1695
|
// handle excess properties
|
|
1687
1696
|
// ---------------------------------------------
|
|
1688
1697
|
let inputKeys;
|
|
1689
|
-
if (
|
|
1690
|
-
|
|
1698
|
+
if (!indexCount && (onExcessPropertyError || onExcessPropertyPreserve)) {
|
|
1699
|
+
expectedKeysSet ??= new Set(expectedKeys);
|
|
1700
|
+
inputKeys = Reflect.ownKeys(record);
|
|
1691
1701
|
for (let i = 0; i < inputKeys.length; i++) {
|
|
1692
1702
|
const key = inputKeys[i];
|
|
1693
1703
|
if (!expectedKeysSet.has(key)) {
|
|
1694
1704
|
// key is unexpected
|
|
1695
1705
|
if (onExcessPropertyError) {
|
|
1696
|
-
const issue = new SchemaIssue.Pointer([key], new SchemaIssue.UnexpectedKey(ast
|
|
1706
|
+
const issue = new SchemaIssue.Pointer([key], new SchemaIssue.UnexpectedKey(ast));
|
|
1697
1707
|
if (errorsAllOption) {
|
|
1698
1708
|
if (state.issues) {
|
|
1699
1709
|
state.issues.push(issue);
|
|
@@ -1702,11 +1712,11 @@ export class Objects extends Base {
|
|
|
1702
1712
|
}
|
|
1703
1713
|
continue;
|
|
1704
1714
|
} else {
|
|
1705
|
-
return yield* Effect.fail(new SchemaIssue.Composite(ast,
|
|
1715
|
+
return yield* Effect.fail(new SchemaIssue.Composite(ast, [issue]));
|
|
1706
1716
|
}
|
|
1707
1717
|
} else {
|
|
1708
1718
|
// preserve key
|
|
1709
|
-
InternalRecord.
|
|
1719
|
+
InternalRecord.assignProperty(out, key, record[key]);
|
|
1710
1720
|
}
|
|
1711
1721
|
}
|
|
1712
1722
|
}
|
|
@@ -1715,42 +1725,53 @@ export class Objects extends Base {
|
|
|
1715
1725
|
// ---------------------------------------------
|
|
1716
1726
|
// handle property signatures
|
|
1717
1727
|
// ---------------------------------------------
|
|
1718
|
-
|
|
1719
|
-
|
|
1728
|
+
if (hasProperties) {
|
|
1729
|
+
const eff = parseProperties(state, properties, concurrency);
|
|
1730
|
+
if (eff) yield* eff;
|
|
1731
|
+
}
|
|
1720
1732
|
// ---------------------------------------------
|
|
1721
1733
|
// handle index signatures
|
|
1722
1734
|
// ---------------------------------------------
|
|
1723
|
-
if (
|
|
1735
|
+
if (indexCount && !concurrency) {
|
|
1736
|
+
for (let i = 0; i < indexCount; i++) {
|
|
1737
|
+
const index = indexes[i];
|
|
1738
|
+
const parse = index.is.parameter === string ? parseStringIndex : parseIndex;
|
|
1739
|
+
const keys = index.is.parameter === string ? Object.keys(record) : getIndexSignatureKeys(record, index.is.parameter, options);
|
|
1740
|
+
for (let j = 0; j < keys.length; j++) {
|
|
1741
|
+
const eff = parse(state, keys[j], index);
|
|
1742
|
+
if (!effectIsExit(eff)) yield* eff;else if (eff._tag === "Failure") return yield* eff;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
} else if (parseIndexes) {
|
|
1724
1746
|
const keyPairs = Arr.empty();
|
|
1725
1747
|
for (let i = 0; i < indexCount; i++) {
|
|
1726
|
-
const
|
|
1727
|
-
const keys = getIndexSignatureKeys(
|
|
1748
|
+
const index = indexes[i];
|
|
1749
|
+
const keys = getIndexSignatureKeys(record, index.is.parameter, options);
|
|
1728
1750
|
for (let j = 0; j < keys.length; j++) {
|
|
1729
|
-
|
|
1730
|
-
keyPairs.push([key, is]);
|
|
1751
|
+
keyPairs.push([keys[j], index]);
|
|
1731
1752
|
}
|
|
1732
1753
|
}
|
|
1733
1754
|
const eff = parseIndexes(state, keyPairs, concurrency);
|
|
1734
1755
|
if (eff) yield* eff;
|
|
1735
1756
|
}
|
|
1736
1757
|
if (state.issues) {
|
|
1737
|
-
return yield* Effect.fail(new SchemaIssue.Composite(ast,
|
|
1758
|
+
return yield* Effect.fail(new SchemaIssue.Composite(ast, state.issues));
|
|
1738
1759
|
}
|
|
1739
1760
|
if (options.propertyOrder === "original") {
|
|
1740
1761
|
// preserve input keys order
|
|
1741
|
-
const keys = (inputKeys ?? Reflect.ownKeys(
|
|
1762
|
+
const keys = (inputKeys ?? Reflect.ownKeys(record)).concat(expectedKeys);
|
|
1742
1763
|
const preserved = {};
|
|
1743
1764
|
for (const key of keys) {
|
|
1744
1765
|
if (Object.hasOwn(out, key)) {
|
|
1745
|
-
InternalRecord.
|
|
1766
|
+
InternalRecord.assignProperty(preserved, key, out[key]);
|
|
1746
1767
|
}
|
|
1747
1768
|
}
|
|
1748
|
-
return
|
|
1769
|
+
return preserved;
|
|
1749
1770
|
}
|
|
1750
|
-
return
|
|
1771
|
+
return out;
|
|
1751
1772
|
});
|
|
1752
1773
|
}
|
|
1753
|
-
_rebuild(recur, recurParameter,
|
|
1774
|
+
_rebuild(recur, recurParameter, checks, encodingChecks) {
|
|
1754
1775
|
const props = mapOrSame(this.propertySignatures, ps => {
|
|
1755
1776
|
const t = recur(ps.type);
|
|
1756
1777
|
return t === ps.type ? ps : new PropertySignature(ps.name, t);
|
|
@@ -1758,18 +1779,17 @@ export class Objects extends Base {
|
|
|
1758
1779
|
const indexes = mapOrSame(this.indexSignatures, is => {
|
|
1759
1780
|
const p = recurParameter(is.parameter);
|
|
1760
1781
|
const t = recur(is.type);
|
|
1761
|
-
|
|
1762
|
-
return p === is.parameter && t === is.type && merge === is.merge ? is : new IndexSignature(p, t, merge);
|
|
1782
|
+
return p === is.parameter && t === is.type ? is : new IndexSignature(p, t);
|
|
1763
1783
|
});
|
|
1764
1784
|
return props === this.propertySignatures && indexes === this.indexSignatures && checks === this.checks && encodingChecks === this.encodingChecks ? this : new Objects(props, indexes, this.annotations, checks, undefined, this.context, encodingChecks);
|
|
1765
1785
|
}
|
|
1766
1786
|
/** @internal */
|
|
1767
1787
|
flip(recur) {
|
|
1768
|
-
return this._rebuild(recur, recur,
|
|
1788
|
+
return this._rebuild(recur, recur, this.encodingChecks, this.checks);
|
|
1769
1789
|
}
|
|
1770
1790
|
/** @internal */
|
|
1771
1791
|
recur(recur, recurParameter = recur) {
|
|
1772
|
-
return this._rebuild(recur, recurParameter,
|
|
1792
|
+
return this._rebuild(recur, recurParameter, this.checks, this.encodingChecks);
|
|
1773
1793
|
}
|
|
1774
1794
|
/** @internal */
|
|
1775
1795
|
getExpected() {
|
|
@@ -1779,21 +1799,31 @@ export class Objects extends Base {
|
|
|
1779
1799
|
}
|
|
1780
1800
|
const parseProperties = /*#__PURE__*/iterateEager()({
|
|
1781
1801
|
onItem(s, p) {
|
|
1782
|
-
|
|
1802
|
+
if (!Object.hasOwn(s.input, p.name)) {
|
|
1803
|
+
return p.parser(InternalParser.missing, s.options);
|
|
1804
|
+
}
|
|
1805
|
+
const value = s.input[p.name];
|
|
1806
|
+
InternalRecord.assignProperty(s.out, p.name, value);
|
|
1783
1807
|
return p.parser(value, s.options);
|
|
1784
1808
|
},
|
|
1785
1809
|
step(s, p, exit) {
|
|
1786
1810
|
if (exit._tag === "Failure") {
|
|
1787
1811
|
return wrapPropertyKeyIssue(s, s.ast, p.name, exit);
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1812
|
+
}
|
|
1813
|
+
if (exit === InternalParser.sameExit) return;
|
|
1814
|
+
const value = exit[InternalParser.args];
|
|
1815
|
+
if (value !== InternalParser.missing) {
|
|
1816
|
+
InternalRecord.assignProperty(s.out, p.name, value);
|
|
1817
|
+
return;
|
|
1818
|
+
}
|
|
1819
|
+
delete s.out[p.name];
|
|
1820
|
+
if (!isOptional(p.type)) {
|
|
1791
1821
|
const issue = new SchemaIssue.Pointer([p.name], new SchemaIssue.MissingKey(p.type.context?.annotations));
|
|
1792
1822
|
if (s.options.errors === "all") {
|
|
1793
1823
|
if (s.issues) s.issues.push(issue);else s.issues = [issue];
|
|
1794
1824
|
return;
|
|
1795
1825
|
} else {
|
|
1796
|
-
return Exit.fail(new SchemaIssue.Composite(s.ast,
|
|
1826
|
+
return Exit.fail(new SchemaIssue.Composite(s.ast, [issue]));
|
|
1797
1827
|
}
|
|
1798
1828
|
}
|
|
1799
1829
|
}
|
|
@@ -1843,6 +1873,18 @@ export function tupleWithRest(ast, rest) {
|
|
|
1843
1873
|
}
|
|
1844
1874
|
return new Arrays(ast.isMutable, ast.elements, rest, undefined, ast.checks);
|
|
1845
1875
|
}
|
|
1876
|
+
const toCandidate = /*#__PURE__*/memoize(ast => {
|
|
1877
|
+
while (true) {
|
|
1878
|
+
if (isSuspend(ast)) return unknown;
|
|
1879
|
+
const encoding = ast.encoding;
|
|
1880
|
+
if (!encoding) {
|
|
1881
|
+
// Index signature parameters do not participate in union selection.
|
|
1882
|
+
return ast.recur?.(toCandidate, identity) ?? ast;
|
|
1883
|
+
}
|
|
1884
|
+
if (encoding.some(link => link.transformation._tag === "Middleware" && link.transformation.decode !== identity)) return unknown;
|
|
1885
|
+
ast = encoding[encoding.length - 1].to;
|
|
1886
|
+
}
|
|
1887
|
+
});
|
|
1846
1888
|
function getCandidateTypes(ast) {
|
|
1847
1889
|
switch (ast._tag) {
|
|
1848
1890
|
case "Null":
|
|
@@ -1866,7 +1908,7 @@ function getCandidateTypes(ast) {
|
|
|
1866
1908
|
case "ObjectKeyword":
|
|
1867
1909
|
return ["object", "array", "function"];
|
|
1868
1910
|
case "Objects":
|
|
1869
|
-
return ast.propertySignatures.length || ast.indexSignatures.length ? ["object"] : ["object", "array"];
|
|
1911
|
+
return ast.propertySignatures.length || ast.indexSignatures.length ? ["object"] : ["string", "number", "boolean", "symbol", "bigint", "object", "array", "function"];
|
|
1870
1912
|
case "Enum":
|
|
1871
1913
|
return Array.from(new Set(ast.enums.map(([, v]) => typeof v)));
|
|
1872
1914
|
case "Literal":
|
|
@@ -1884,7 +1926,7 @@ export function collectSentinels(ast) {
|
|
|
1884
1926
|
return [];
|
|
1885
1927
|
case "Declaration":
|
|
1886
1928
|
{
|
|
1887
|
-
const s = ast.annotations?.[
|
|
1929
|
+
const s = ast.annotations?.[InternalAnnotations.SENTINELS_ANNOTATION_KEY];
|
|
1888
1930
|
return Array.isArray(s) ? s : [];
|
|
1889
1931
|
}
|
|
1890
1932
|
case "Objects":
|
|
@@ -1908,30 +1950,50 @@ export function collectSentinels(ast) {
|
|
|
1908
1950
|
});
|
|
1909
1951
|
case "Arrays":
|
|
1910
1952
|
return ast.elements.flatMap((e, i) => {
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1953
|
+
if (!isOptional(e)) {
|
|
1954
|
+
if (isLiteral(e)) {
|
|
1955
|
+
return [{
|
|
1956
|
+
key: i,
|
|
1957
|
+
literal: e.literal
|
|
1958
|
+
}];
|
|
1959
|
+
}
|
|
1960
|
+
if (isUniqueSymbol(e)) {
|
|
1961
|
+
return [{
|
|
1962
|
+
key: i,
|
|
1963
|
+
literal: e.symbol
|
|
1964
|
+
}];
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
return [];
|
|
1915
1968
|
});
|
|
1916
1969
|
case "Suspend":
|
|
1917
1970
|
return collectSentinels(ast.thunk());
|
|
1918
1971
|
}
|
|
1919
1972
|
}
|
|
1920
1973
|
const candidateIndexCache = /*#__PURE__*/new WeakMap();
|
|
1974
|
+
const emptyCandidates = /*#__PURE__*/Object.freeze([]);
|
|
1921
1975
|
function getIndex(types) {
|
|
1922
1976
|
let idx = candidateIndexCache.get(types);
|
|
1923
1977
|
if (idx) return idx;
|
|
1924
1978
|
idx = {};
|
|
1979
|
+
let literalCandidates;
|
|
1925
1980
|
for (let i = 0; i < types.length; i++) {
|
|
1926
1981
|
const a = types[i];
|
|
1927
|
-
const encoded =
|
|
1982
|
+
const encoded = toCandidate(a);
|
|
1928
1983
|
if (isNever(encoded)) continue;
|
|
1929
|
-
|
|
1984
|
+
if (literalCandidates !== null) {
|
|
1985
|
+
if (isLiteral(encoded) || isUniqueSymbol(encoded)) {
|
|
1986
|
+
literalCandidates ??= new Map();
|
|
1987
|
+
const literal = isLiteral(encoded) ? encoded.literal : encoded.symbol;
|
|
1988
|
+
let arr = literalCandidates.get(literal);
|
|
1989
|
+
if (!arr) literalCandidates.set(literal, arr = []);
|
|
1990
|
+
arr.push(a);
|
|
1991
|
+
} else {
|
|
1992
|
+
literalCandidates = null;
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1930
1995
|
const sentinels = collectSentinels(encoded);
|
|
1931
|
-
|
|
1932
|
-
idx.byType ??= {};
|
|
1933
|
-
for (const t of candidateTypes) (idx.byType[t] ??= []).push(i);
|
|
1934
|
-
if (sentinels.length > 0) {
|
|
1996
|
+
if (sentinels.length) {
|
|
1935
1997
|
// discriminated variants
|
|
1936
1998
|
idx.bySentinel ??= new Map();
|
|
1937
1999
|
for (const {
|
|
@@ -1942,20 +2004,33 @@ function getIndex(types) {
|
|
|
1942
2004
|
if (!m) idx.bySentinel.set(key, m = new Map());
|
|
1943
2005
|
let arr = m.get(literal);
|
|
1944
2006
|
if (!arr) m.set(literal, arr = []);
|
|
1945
|
-
arr.push(i);
|
|
2007
|
+
if (arr[arr.length - 1] !== i) arr.push(i);
|
|
1946
2008
|
}
|
|
1947
2009
|
} else {
|
|
1948
2010
|
// non-discriminated
|
|
1949
2011
|
idx.otherwise ??= {};
|
|
2012
|
+
const candidateTypes = getCandidateTypes(encoded);
|
|
1950
2013
|
for (const t of candidateTypes) (idx.otherwise[t] ??= []).push(i);
|
|
1951
2014
|
}
|
|
1952
2015
|
}
|
|
2016
|
+
if (literalCandidates) {
|
|
2017
|
+
literalCandidates.forEach(Object.freeze);
|
|
2018
|
+
idx = input => literalCandidates.get(input) ?? emptyCandidates;
|
|
2019
|
+
} else if (idx.bySentinel?.size === 1 && !idx.otherwise) {
|
|
2020
|
+
for (const [key, byValue] of idx.bySentinel) {
|
|
2021
|
+
const candidates = byValue;
|
|
2022
|
+
for (const [literal, indexes] of byValue) {
|
|
2023
|
+
candidates.set(literal, Object.freeze(indexes.map(index => types[index])));
|
|
2024
|
+
}
|
|
2025
|
+
idx = input => Predicate.isObjectKeyword(input) && Object.hasOwn(input, key) ? candidates.get(input[key]) ?? emptyCandidates : emptyCandidates;
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
1953
2028
|
candidateIndexCache.set(types, idx);
|
|
1954
2029
|
return idx;
|
|
1955
2030
|
}
|
|
1956
2031
|
function filterLiterals(input) {
|
|
1957
2032
|
return ast => {
|
|
1958
|
-
const encoded =
|
|
2033
|
+
const encoded = toCandidate(ast);
|
|
1959
2034
|
return encoded._tag === "Literal" ? encoded.literal === input : encoded._tag === "UniqueSymbol" ? encoded.symbol === input : true;
|
|
1960
2035
|
};
|
|
1961
2036
|
}
|
|
@@ -1967,11 +2042,12 @@ function filterLiterals(input) {
|
|
|
1967
2042
|
*/
|
|
1968
2043
|
export function getCandidates(input, types) {
|
|
1969
2044
|
const idx = getIndex(types);
|
|
2045
|
+
if (typeof idx === "function") return idx(input);
|
|
1970
2046
|
const runtimeType = input === null ? "null" : Array.isArray(input) ? "array" : typeof input;
|
|
1971
2047
|
// 1. Try sentinel-based dispatch (most selective)
|
|
1972
2048
|
if (idx.bySentinel) {
|
|
1973
|
-
const base = idx.otherwise?.[runtimeType] ??
|
|
1974
|
-
if (
|
|
2049
|
+
const base = idx.otherwise?.[runtimeType] ?? emptyCandidates;
|
|
2050
|
+
if (Predicate.isObjectKeyword(input)) {
|
|
1975
2051
|
const selected = new Set(base);
|
|
1976
2052
|
for (const [k, m] of idx.bySentinel) {
|
|
1977
2053
|
if (Object.hasOwn(input, k)) {
|
|
@@ -1981,12 +2057,12 @@ export function getCandidates(input, types) {
|
|
|
1981
2057
|
}
|
|
1982
2058
|
}
|
|
1983
2059
|
}
|
|
1984
|
-
return Array.from(selected).sort((a, b) => a - b).map(i => types[i])
|
|
2060
|
+
return Array.from(selected).sort((a, b) => a - b).map(i => types[i]);
|
|
1985
2061
|
}
|
|
1986
2062
|
return base.map(i => types[i]);
|
|
1987
2063
|
}
|
|
1988
2064
|
// 2. Fallback: runtime-type dispatch only
|
|
1989
|
-
return (idx.
|
|
2065
|
+
return (idx.otherwise?.[runtimeType] ?? emptyCandidates).map(i => types[i]).filter(filterLiterals(input));
|
|
1990
2066
|
}
|
|
1991
2067
|
/**
|
|
1992
2068
|
* AST node representing a union of schemas.
|
|
@@ -2003,15 +2079,14 @@ export function getCandidates(input, types) {
|
|
|
2003
2079
|
*
|
|
2004
2080
|
* **Example** (Inspecting a union AST)
|
|
2005
2081
|
*
|
|
2006
|
-
* ```ts
|
|
2082
|
+
* ```ts import.meta.vitest
|
|
2007
2083
|
* import { Schema, SchemaAST } from "effect"
|
|
2008
2084
|
*
|
|
2009
2085
|
* const schema = Schema.Union([Schema.String, Schema.Number])
|
|
2010
2086
|
* const ast = schema.ast
|
|
2011
2087
|
*
|
|
2012
2088
|
* if (SchemaAST.isUnion(ast)) {
|
|
2013
|
-
*
|
|
2014
|
-
* console.log(ast.mode) // "anyOf"
|
|
2089
|
+
* [ast.types.length, ast.mode] // => [2, "anyOf"]
|
|
2015
2090
|
* }
|
|
2016
2091
|
* ```
|
|
2017
2092
|
*
|
|
@@ -2034,19 +2109,22 @@ export class Union extends Base {
|
|
|
2034
2109
|
getParser(recur) {
|
|
2035
2110
|
// oxlint-disable-next-line @typescript-eslint/no-this-alias
|
|
2036
2111
|
const ast = this;
|
|
2037
|
-
return (
|
|
2038
|
-
if (
|
|
2039
|
-
return
|
|
2112
|
+
return (input, options) => {
|
|
2113
|
+
if (input === InternalParser.missing) {
|
|
2114
|
+
return InternalParser.missingExit;
|
|
2040
2115
|
}
|
|
2041
|
-
const input = oinput.value;
|
|
2042
2116
|
const candidates = getCandidates(input, ast.types);
|
|
2117
|
+
if (candidates.length === 1) {
|
|
2118
|
+
const result = recur(candidates[0])(input, options);
|
|
2119
|
+
if (result._tag === "Success") return result;
|
|
2120
|
+
return effectIsExit(result) ? failSingleUnionCandidate(ast, result.cause) : Effect.catchCause(result, cause => failSingleUnionCandidate(ast, cause));
|
|
2121
|
+
}
|
|
2043
2122
|
const state = {
|
|
2044
2123
|
ast,
|
|
2045
2124
|
recur,
|
|
2046
|
-
oinput,
|
|
2047
2125
|
input,
|
|
2048
2126
|
out: undefined,
|
|
2049
|
-
successes: [],
|
|
2127
|
+
successes: ast.mode === "oneOf" ? [] : undefined,
|
|
2050
2128
|
issues: undefined,
|
|
2051
2129
|
options
|
|
2052
2130
|
};
|
|
@@ -2056,10 +2134,10 @@ export class Union extends Base {
|
|
|
2056
2134
|
orderedStep: true
|
|
2057
2135
|
} : undefined);
|
|
2058
2136
|
if (!eff) {
|
|
2059
|
-
return state.out
|
|
2137
|
+
return state.out ?? Effect.fail(new SchemaIssue.AnyOf(ast, state.issues ?? []));
|
|
2060
2138
|
}
|
|
2061
|
-
return Effect.
|
|
2062
|
-
return state.out ? Effect.succeed(state.out
|
|
2139
|
+
return Effect.flatMapEager(eff, _ => {
|
|
2140
|
+
return state.out === InternalParser.sameExit ? Effect.succeed(input) : state.out ?? Effect.fail(new SchemaIssue.AnyOf(ast, state.issues ?? []));
|
|
2063
2141
|
});
|
|
2064
2142
|
};
|
|
2065
2143
|
}
|
|
@@ -2113,10 +2191,14 @@ export class Union extends Base {
|
|
|
2113
2191
|
return Array.from(new Set(types)).join(" | ");
|
|
2114
2192
|
}
|
|
2115
2193
|
}
|
|
2194
|
+
function failSingleUnionCandidate(ast, cause) {
|
|
2195
|
+
const issue = InternalSchemaCause.getSchemaIssue(cause);
|
|
2196
|
+
return issue ? Exit.fail(new SchemaIssue.AnyOf(ast, [issue])) : Exit.failCause(cause);
|
|
2197
|
+
}
|
|
2116
2198
|
const parseUnion = /*#__PURE__*/iterateEager()({
|
|
2117
2199
|
onItem(s, ast) {
|
|
2118
2200
|
const parser = s.recur(ast);
|
|
2119
|
-
return parser(s.
|
|
2201
|
+
return parser(s.input, s.options);
|
|
2120
2202
|
},
|
|
2121
2203
|
step(s, candidate, exit) {
|
|
2122
2204
|
if (exit._tag === "Failure") {
|
|
@@ -2126,20 +2208,20 @@ const parseUnion = /*#__PURE__*/iterateEager()({
|
|
|
2126
2208
|
}
|
|
2127
2209
|
if (s.issues) s.issues.push(issue);else s.issues = [issue];
|
|
2128
2210
|
} else {
|
|
2129
|
-
if (s.out && s.
|
|
2211
|
+
if (s.out && s.successes) {
|
|
2130
2212
|
s.successes.push(candidate);
|
|
2131
|
-
return Exit.fail(new SchemaIssue.OneOf(s.ast, s.
|
|
2213
|
+
return Exit.fail(new SchemaIssue.OneOf(s.ast, s.successes));
|
|
2132
2214
|
}
|
|
2133
|
-
s.out = exit
|
|
2134
|
-
s.successes
|
|
2135
|
-
|
|
2215
|
+
s.out = exit;
|
|
2216
|
+
if (s.successes) {
|
|
2217
|
+
s.successes.push(candidate);
|
|
2218
|
+
} else {
|
|
2136
2219
|
return Exit.void;
|
|
2137
2220
|
}
|
|
2138
2221
|
}
|
|
2139
2222
|
}
|
|
2140
2223
|
});
|
|
2141
2224
|
const nonFiniteLiterals = /*#__PURE__*/new Union([/*#__PURE__*/new Literal("Infinity"), /*#__PURE__*/new Literal("-Infinity"), /*#__PURE__*/new Literal("NaN")], "anyOf");
|
|
2142
|
-
const numberToJson = /*#__PURE__*/new Link(/*#__PURE__*/new Union([number, nonFiniteLiterals], "anyOf"), /*#__PURE__*/new SchemaTransformation.Transformation(/*#__PURE__*/SchemaGetter.Number(), /*#__PURE__*/SchemaGetter.transform(n => globalThis.Number.isFinite(n) ? n : globalThis.String(n))));
|
|
2143
2225
|
function formatIsMutable(isMutable) {
|
|
2144
2226
|
return isMutable ? "" : "readonly ";
|
|
2145
2227
|
}
|
|
@@ -2170,7 +2252,7 @@ export function memoizeThunk(f) {
|
|
|
2170
2252
|
*
|
|
2171
2253
|
* **Example** (Defining recursive schema ASTs)
|
|
2172
2254
|
*
|
|
2173
|
-
* ```ts
|
|
2255
|
+
* ```ts import.meta.vitest
|
|
2174
2256
|
* import { Schema, SchemaAST } from "effect"
|
|
2175
2257
|
*
|
|
2176
2258
|
* interface Category {
|
|
@@ -2183,7 +2265,7 @@ export function memoizeThunk(f) {
|
|
|
2183
2265
|
* children: Schema.Array(Schema.suspend((): Schema.Codec<Category> => Category))
|
|
2184
2266
|
* })
|
|
2185
2267
|
*
|
|
2186
|
-
* //
|
|
2268
|
+
* SchemaAST.isObjects(Category.ast) // => true
|
|
2187
2269
|
* ```
|
|
2188
2270
|
*
|
|
2189
2271
|
* @see {@link isSuspend}
|
|
@@ -2194,7 +2276,7 @@ export class Suspend extends Base {
|
|
|
2194
2276
|
_tag = "Suspend";
|
|
2195
2277
|
thunk;
|
|
2196
2278
|
constructor(thunk, annotations, checks, encoding, context) {
|
|
2197
|
-
if (checks
|
|
2279
|
+
if (checks) {
|
|
2198
2280
|
throw new Error("Cannot add checks to Suspend");
|
|
2199
2281
|
}
|
|
2200
2282
|
super(annotations, undefined, encoding, context);
|
|
@@ -2202,7 +2284,8 @@ export class Suspend extends Base {
|
|
|
2202
2284
|
}
|
|
2203
2285
|
/** @internal */
|
|
2204
2286
|
getParser(recur) {
|
|
2205
|
-
|
|
2287
|
+
let parser;
|
|
2288
|
+
return (input, options) => (parser ??= recur(this.thunk()))(input, options);
|
|
2206
2289
|
}
|
|
2207
2290
|
/** @internal */
|
|
2208
2291
|
recur(recur) {
|
|
@@ -2223,8 +2306,8 @@ export class Suspend extends Base {
|
|
|
2223
2306
|
*
|
|
2224
2307
|
* - `run` — the validation function. Returns `undefined` on success, or an
|
|
2225
2308
|
* `Issue` on failure.
|
|
2226
|
-
* - `annotations` — optional filter-level
|
|
2227
|
-
*
|
|
2309
|
+
* - `annotations` — optional filter-level annotations (expected message,
|
|
2310
|
+
* representation, arbitrary constraint hints).
|
|
2228
2311
|
* - `aborted` — when `true`, parsing stops immediately after this filter
|
|
2229
2312
|
* fails (no further checks run).
|
|
2230
2313
|
*
|
|
@@ -2303,13 +2386,38 @@ export class FilterGroup extends Pipeable.Class {
|
|
|
2303
2386
|
}
|
|
2304
2387
|
/** @internal */
|
|
2305
2388
|
export function makeFilter(filter, annotations, aborted = false) {
|
|
2306
|
-
return new Filter((input, ast, options) => SchemaIssue.
|
|
2389
|
+
return new Filter((input, ast, options) => SchemaIssue.normalizeFilterOutput(ast, filter(input, ast, options)), annotations, aborted);
|
|
2307
2390
|
}
|
|
2308
2391
|
/** @internal */
|
|
2309
2392
|
export function makeFilterByGuard(is, annotations) {
|
|
2310
|
-
return new Filter(input => is(input) ? undefined : new SchemaIssue.InvalidValue(
|
|
2393
|
+
return new Filter(input => is(input) ? undefined : new SchemaIssue.InvalidValue(), annotations, true // after a guard, we always want to abort
|
|
2311
2394
|
);
|
|
2312
2395
|
}
|
|
2396
|
+
/** @internal */
|
|
2397
|
+
export function isFinite(annotations) {
|
|
2398
|
+
return makeFilter(n => globalThis.Number.isFinite(n), {
|
|
2399
|
+
expected: "a finite number",
|
|
2400
|
+
representation: {
|
|
2401
|
+
id: "effect/schema/isFinite",
|
|
2402
|
+
payload: null
|
|
2403
|
+
},
|
|
2404
|
+
toJsonSchema: () => ({
|
|
2405
|
+
type: "number"
|
|
2406
|
+
}),
|
|
2407
|
+
toCode: () => ({
|
|
2408
|
+
runtime: "Schema.isFinite()"
|
|
2409
|
+
}),
|
|
2410
|
+
arbitrary: {
|
|
2411
|
+
constraint: {
|
|
2412
|
+
noInfinity: true,
|
|
2413
|
+
noNaN: true
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2416
|
+
...annotations
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
/** @internal */
|
|
2420
|
+
export const finite = /*#__PURE__*/appendChecks(number, [/*#__PURE__*/isFinite()]);
|
|
2313
2421
|
/**
|
|
2314
2422
|
* Creates a {@link Filter} that validates strings by running `RegExp.test`.
|
|
2315
2423
|
*
|
|
@@ -2321,21 +2429,25 @@ export function makeFilterByGuard(is, annotations) {
|
|
|
2321
2429
|
* **Details**
|
|
2322
2430
|
*
|
|
2323
2431
|
* The filter can be used with `Schema.filter` or attached directly to a
|
|
2324
|
-
* `String` AST node through checks. The regular expression
|
|
2325
|
-
*
|
|
2432
|
+
* `String` AST node through checks. The regular expression is cloned and its
|
|
2433
|
+
* `lastIndex` is reset before each test, so global and sticky expressions are
|
|
2434
|
+
* deterministic and the provided regular expression is not mutated. The
|
|
2435
|
+
* regular expression source is stored in annotations for serialization and
|
|
2436
|
+
* arbitrary generation.
|
|
2326
2437
|
*
|
|
2327
2438
|
* **Gotchas**
|
|
2328
2439
|
*
|
|
2329
|
-
*
|
|
2330
|
-
*
|
|
2331
|
-
* `y` flag.
|
|
2440
|
+
* When deriving an arbitrary, only `regExp.source` is used. Regular expression
|
|
2441
|
+
* flags are ignored because fast-check does not support them.
|
|
2332
2442
|
*
|
|
2333
2443
|
* **Example** (Validating an email pattern)
|
|
2334
2444
|
*
|
|
2335
|
-
* ```ts
|
|
2445
|
+
* ```ts import.meta.vitest
|
|
2336
2446
|
* import { SchemaAST } from "effect"
|
|
2337
2447
|
*
|
|
2338
2448
|
* const emailFilter = SchemaAST.isPattern(/^[^@]+@[^@]+$/)
|
|
2449
|
+
* emailFilter.run("alice@example.com", SchemaAST.string, {}) // => undefined
|
|
2450
|
+
* emailFilter.run("invalid", SchemaAST.string, {})?._tag // => "InvalidValue"
|
|
2339
2451
|
* ```
|
|
2340
2452
|
*
|
|
2341
2453
|
* @see {@link Filter}
|
|
@@ -2344,12 +2456,22 @@ export function makeFilterByGuard(is, annotations) {
|
|
|
2344
2456
|
*/
|
|
2345
2457
|
export function isPattern(regExp, annotations) {
|
|
2346
2458
|
const source = regExp.source;
|
|
2347
|
-
|
|
2459
|
+
const pattern = new globalThis.RegExp(source, regExp.flags);
|
|
2460
|
+
return makeFilter(s => {
|
|
2461
|
+
pattern.lastIndex = 0;
|
|
2462
|
+
return pattern.test(s);
|
|
2463
|
+
}, {
|
|
2348
2464
|
expected: `a string matching the RegExp ${source}`,
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2465
|
+
representation: {
|
|
2466
|
+
id: "effect/schema/isPattern",
|
|
2467
|
+
payload: {
|
|
2468
|
+
source,
|
|
2469
|
+
flags: regExp.flags
|
|
2470
|
+
}
|
|
2352
2471
|
},
|
|
2472
|
+
toJsonSchema: () => ({
|
|
2473
|
+
pattern: source
|
|
2474
|
+
}),
|
|
2353
2475
|
arbitrary: {
|
|
2354
2476
|
constraint: {
|
|
2355
2477
|
patterns: [regExp.source]
|
|
@@ -2400,7 +2522,7 @@ export function annotate(ast, annotations) {
|
|
|
2400
2522
|
}
|
|
2401
2523
|
/** @internal */
|
|
2402
2524
|
export function replaceChecks(ast, checks) {
|
|
2403
|
-
if (ast._tag === "Suspend" && checks
|
|
2525
|
+
if (ast._tag === "Suspend" && checks) {
|
|
2404
2526
|
throw new Error("Cannot add checks to Suspend");
|
|
2405
2527
|
}
|
|
2406
2528
|
if (ast.checks === checks) {
|
|
@@ -2414,20 +2536,26 @@ export function replaceChecks(ast, checks) {
|
|
|
2414
2536
|
export function appendChecks(ast, checks) {
|
|
2415
2537
|
return replaceChecks(ast, combineChecks(ast.checks, checks));
|
|
2416
2538
|
}
|
|
2539
|
+
/** @internal */
|
|
2540
|
+
export function mapLink(link, f) {
|
|
2541
|
+
const to = f(link.to);
|
|
2542
|
+
return to === link.to ? link : new Link(to, link.transformation);
|
|
2543
|
+
}
|
|
2417
2544
|
function updateLastLink(encoding, f) {
|
|
2418
2545
|
const links = encoding;
|
|
2419
2546
|
const last = links[links.length - 1];
|
|
2420
|
-
const
|
|
2421
|
-
|
|
2422
|
-
return Arr.append(encoding.slice(0, encoding.length - 1), new Link(to, last.transformation));
|
|
2423
|
-
}
|
|
2424
|
-
return encoding;
|
|
2547
|
+
const out = mapLink(last, f);
|
|
2548
|
+
return out === last ? encoding : Arr.append(encoding.slice(0, encoding.length - 1), out);
|
|
2425
2549
|
}
|
|
2426
2550
|
/** @internal */
|
|
2427
2551
|
export function applyToLastLink(f) {
|
|
2428
2552
|
return ast => ast.encoding ? replaceEncoding(ast, updateLastLink(ast.encoding, f)) : ast;
|
|
2429
2553
|
}
|
|
2430
2554
|
/** @internal */
|
|
2555
|
+
export function replaceContextLastLink(ast, context) {
|
|
2556
|
+
return applyToLastLink(ast => replaceContext(ast, context))(ast);
|
|
2557
|
+
}
|
|
2558
|
+
/** @internal */
|
|
2431
2559
|
export function applyToSelfOrLastLinkEncoding(f) {
|
|
2432
2560
|
function out(ast) {
|
|
2433
2561
|
return ast.encoding ? replaceEncoding(ast, updateLastLink(ast.encoding, out)) : f(ast);
|
|
@@ -2475,8 +2603,7 @@ export function annotateKey(ast, annotations) {
|
|
|
2475
2603
|
}) : new Context(false, false, undefined, annotations);
|
|
2476
2604
|
return replaceContext(ast, context);
|
|
2477
2605
|
}
|
|
2478
|
-
|
|
2479
|
-
export const optionalKeyLastLink = /*#__PURE__*/applyToLastLink(optionalKey);
|
|
2606
|
+
const optionalKeyLastLink = /*#__PURE__*/applyToLastLink(optionalKey);
|
|
2480
2607
|
/**
|
|
2481
2608
|
* Marks an AST node's property key as optional by setting
|
|
2482
2609
|
* {@link Context.isOptional} to `true`.
|
|
@@ -2560,12 +2687,12 @@ function parseParameter(ast) {
|
|
|
2560
2687
|
};
|
|
2561
2688
|
}
|
|
2562
2689
|
/** @internal */
|
|
2563
|
-
export function record(key, value
|
|
2690
|
+
export function record(key, value) {
|
|
2564
2691
|
const {
|
|
2565
2692
|
literals,
|
|
2566
2693
|
parameters: indexSignatures
|
|
2567
2694
|
} = parseParameter(key);
|
|
2568
|
-
return new Objects(literals.map(literal => new PropertySignature(literal, value)), indexSignatures.map(parameter => new IndexSignature(parameter, value
|
|
2695
|
+
return new Objects(literals.map(literal => new PropertySignature(literal, value)), indexSignatures.map(parameter => new IndexSignature(parameter, value)));
|
|
2569
2696
|
}
|
|
2570
2697
|
// -------------------------------------------------------------------------------------
|
|
2571
2698
|
// Public APIs
|
|
@@ -2590,6 +2717,17 @@ export function isOptional(ast) {
|
|
|
2590
2717
|
export function isMutable(ast) {
|
|
2591
2718
|
return ast.context?.isMutable ?? false;
|
|
2592
2719
|
}
|
|
2720
|
+
function isStructuralCheck(check) {
|
|
2721
|
+
return check.annotations?.[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY] === true || check._tag === "FilterGroup" && check.checks.every(isStructuralCheck);
|
|
2722
|
+
}
|
|
2723
|
+
function extractStructuralChecks(checks) {
|
|
2724
|
+
function extract(check) {
|
|
2725
|
+
if (isStructuralCheck(check)) return [check];
|
|
2726
|
+
return check._tag === "FilterGroup" ? check.checks.flatMap(extract) : [];
|
|
2727
|
+
}
|
|
2728
|
+
const out = checks.flatMap(extract);
|
|
2729
|
+
return Arr.isArrayNonEmpty(out) ? out : undefined;
|
|
2730
|
+
}
|
|
2593
2731
|
/**
|
|
2594
2732
|
* Strips all encoding transformations from an AST, returning the decoded
|
|
2595
2733
|
* (type-level) representation.
|
|
@@ -2602,12 +2740,12 @@ export function isMutable(ast) {
|
|
|
2602
2740
|
*
|
|
2603
2741
|
* **Example** (Getting the type AST)
|
|
2604
2742
|
*
|
|
2605
|
-
* ```ts
|
|
2743
|
+
* ```ts import.meta.vitest
|
|
2606
2744
|
* import { Schema, SchemaAST } from "effect"
|
|
2607
2745
|
*
|
|
2608
2746
|
* const schema = Schema.NumberFromString
|
|
2609
2747
|
* const typeAst = SchemaAST.toType(schema.ast)
|
|
2610
|
-
*
|
|
2748
|
+
* typeAst._tag // => "Number"
|
|
2611
2749
|
* ```
|
|
2612
2750
|
*
|
|
2613
2751
|
* @see {@link toEncoded}
|
|
@@ -2623,11 +2761,10 @@ export const toType = /*#__PURE__*/memoize(ast => {
|
|
|
2623
2761
|
const type = out.recur?.(toType) ?? out;
|
|
2624
2762
|
const encodingChecks = type.encodingChecks;
|
|
2625
2763
|
if (encodingChecks) {
|
|
2764
|
+
const checks = type === ast ? encodingChecks : isArrays(type) || isObjects(type) || isDeclaration(type) && type.typeParameters.length > 0 ? extractStructuralChecks(encodingChecks) : undefined;
|
|
2626
2765
|
return modifyOwnPropertyDescriptors(type, d => {
|
|
2627
2766
|
d.encodingChecks.value = undefined;
|
|
2628
|
-
|
|
2629
|
-
d.checks.value = combineChecks(type.checks, encodingChecks);
|
|
2630
|
-
}
|
|
2767
|
+
d.checks.value = combineChecks(type.checks, checks);
|
|
2631
2768
|
});
|
|
2632
2769
|
}
|
|
2633
2770
|
return type;
|
|
@@ -2645,12 +2782,12 @@ export const toType = /*#__PURE__*/memoize(ast => {
|
|
|
2645
2782
|
*
|
|
2646
2783
|
* **Example** (Getting the encoded AST)
|
|
2647
2784
|
*
|
|
2648
|
-
* ```ts
|
|
2785
|
+
* ```ts import.meta.vitest
|
|
2649
2786
|
* import { Schema, SchemaAST } from "effect"
|
|
2650
2787
|
*
|
|
2651
2788
|
* const schema = Schema.NumberFromString
|
|
2652
2789
|
* const encodedAst = SchemaAST.toEncoded(schema.ast)
|
|
2653
|
-
*
|
|
2790
|
+
* encodedAst._tag // => "String"
|
|
2654
2791
|
* ```
|
|
2655
2792
|
*
|
|
2656
2793
|
* @see {@link toType}
|
|
@@ -2712,39 +2849,32 @@ export function containsUndefined(ast) {
|
|
|
2712
2849
|
}
|
|
2713
2850
|
}
|
|
2714
2851
|
function fromConst(ast, value) {
|
|
2715
|
-
const succeed =
|
|
2716
|
-
return
|
|
2717
|
-
if (
|
|
2718
|
-
|
|
2719
|
-
}
|
|
2720
|
-
return oinput.value === value ? succeed : Effect.fail(new SchemaIssue.InvalidType(ast, oinput));
|
|
2852
|
+
const succeed = InternalParser.succeed(value);
|
|
2853
|
+
return input => {
|
|
2854
|
+
if (input === InternalParser.missing) return InternalParser.missingExit;
|
|
2855
|
+
return input === value ? succeed : Effect.fail(new SchemaIssue.InvalidType(ast));
|
|
2721
2856
|
};
|
|
2722
2857
|
}
|
|
2723
|
-
function fromAnyToConst(value) {
|
|
2724
|
-
const succeed = Effect.succeedSome(value);
|
|
2725
|
-
return oinput => oinput._tag === "None" ? Effect.succeedNone : succeed;
|
|
2726
|
-
}
|
|
2727
2858
|
function fromRefinement(ast, refinement) {
|
|
2728
|
-
return
|
|
2729
|
-
if (
|
|
2730
|
-
|
|
2731
|
-
}
|
|
2732
|
-
return refinement(oinput.value) ? Effect.succeed(oinput) : Effect.fail(new SchemaIssue.InvalidType(ast, oinput));
|
|
2859
|
+
return input => {
|
|
2860
|
+
if (input === InternalParser.missing) return InternalParser.missingExit;
|
|
2861
|
+
return refinement(input) ? InternalParser.sameExit : Effect.fail(new SchemaIssue.InvalidType(ast));
|
|
2733
2862
|
};
|
|
2734
2863
|
}
|
|
2735
|
-
function
|
|
2736
|
-
|
|
2737
|
-
const
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2864
|
+
function segmentTemplateLiteralParts(ast, input, options) {
|
|
2865
|
+
const parts = ast.encodedParts;
|
|
2866
|
+
const literals = ast.literals;
|
|
2867
|
+
const inputLength = input.length;
|
|
2868
|
+
for (let i = 0; i < literals.length; i++) {
|
|
2869
|
+
const literal = literals[i];
|
|
2870
|
+
if (literal && !input.includes(literal)) return undefined;
|
|
2871
|
+
}
|
|
2872
|
+
if (ast.suffixLengths[0] > inputLength) return undefined;
|
|
2742
2873
|
const out = new Array(parts.length);
|
|
2743
|
-
|
|
2874
|
+
let failures;
|
|
2744
2875
|
function go(i, pos) {
|
|
2745
|
-
if (i === parts.length) return pos ===
|
|
2746
|
-
|
|
2747
|
-
if (failures.has(key)) return false;
|
|
2876
|
+
if (i === parts.length) return pos === inputLength;
|
|
2877
|
+
if (failures?.has(i * (inputLength + 1) + pos)) return false;
|
|
2748
2878
|
const part = parts[i];
|
|
2749
2879
|
if (i === parts.length - 1) {
|
|
2750
2880
|
const s = input.slice(pos);
|
|
@@ -2753,21 +2883,28 @@ function segmentTemplateLiteralParts(parts, input, options) {
|
|
|
2753
2883
|
return true;
|
|
2754
2884
|
}
|
|
2755
2885
|
} else if (part._tag === "Literal") {
|
|
2756
|
-
const s =
|
|
2886
|
+
const s = literals[i];
|
|
2757
2887
|
if (input.startsWith(s, pos) && go(i + 1, pos + s.length)) {
|
|
2758
2888
|
out[i] = s;
|
|
2759
2889
|
return true;
|
|
2760
2890
|
}
|
|
2761
2891
|
} else {
|
|
2762
|
-
|
|
2892
|
+
const maximumEnd = inputLength - ast.suffixLengths[i + 1];
|
|
2893
|
+
// Splits preceding a literal only need to consider occurrences of that literal.
|
|
2894
|
+
const anchor = literals[i + 1];
|
|
2895
|
+
let end = anchor === undefined ? maximumEnd : input.lastIndexOf(anchor, maximumEnd);
|
|
2896
|
+
while (end >= pos) {
|
|
2763
2897
|
const s = input.slice(pos, end);
|
|
2764
2898
|
if (part.matchPart(s, options) !== undefined && go(i + 1, end)) {
|
|
2765
2899
|
out[i] = s;
|
|
2766
2900
|
return true;
|
|
2767
2901
|
}
|
|
2902
|
+
if (end === 0) break;
|
|
2903
|
+
end = anchor === undefined ? end - 1 : input.lastIndexOf(anchor, end - 1);
|
|
2768
2904
|
}
|
|
2769
2905
|
}
|
|
2770
|
-
failures
|
|
2906
|
+
failures ??= new Set();
|
|
2907
|
+
failures.add(i * (inputLength + 1) + pos);
|
|
2771
2908
|
return false;
|
|
2772
2909
|
}
|
|
2773
2910
|
return go(0, 0) ? out : undefined;
|
|
@@ -2818,15 +2955,18 @@ const partFromString = /*#__PURE__*/applyToSelfOrLastLinkEncoding(ast => {
|
|
|
2818
2955
|
*/
|
|
2819
2956
|
export const STRING_PATTERN = "[\\s\\S]*?";
|
|
2820
2957
|
const isStringFiniteRegExp = /*#__PURE__*/new globalThis.RegExp(`^${FINITE_PATTERN}$`);
|
|
2821
|
-
const isStringNumberRegExp = /*#__PURE__*/new globalThis.RegExp(
|
|
2958
|
+
const isStringNumberRegExp = /*#__PURE__*/new globalThis.RegExp(`^(?:${FINITE_PATTERN}|Infinity|-Infinity|NaN)$`);
|
|
2822
2959
|
/** @internal */
|
|
2823
2960
|
export function isStringFinite(annotations) {
|
|
2824
2961
|
return isPattern(isStringFiniteRegExp, {
|
|
2825
2962
|
expected: "a string representing a finite number",
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2963
|
+
representation: {
|
|
2964
|
+
id: "effect/schema/isStringFinite",
|
|
2965
|
+
payload: null
|
|
2829
2966
|
},
|
|
2967
|
+
toJsonSchema: () => ({
|
|
2968
|
+
pattern: isStringFiniteRegExp.source
|
|
2969
|
+
}),
|
|
2830
2970
|
...annotations
|
|
2831
2971
|
});
|
|
2832
2972
|
}
|
|
@@ -2842,10 +2982,13 @@ const isStringBigIntRegExp = /*#__PURE__*/new globalThis.RegExp(`^${BIGINT_PATTE
|
|
|
2842
2982
|
export function isStringBigInt(annotations) {
|
|
2843
2983
|
return isPattern(isStringBigIntRegExp, {
|
|
2844
2984
|
expected: "a string representing a bigint",
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2985
|
+
representation: {
|
|
2986
|
+
id: "effect/schema/isStringBigInt",
|
|
2987
|
+
payload: null
|
|
2848
2988
|
},
|
|
2989
|
+
toJsonSchema: () => ({
|
|
2990
|
+
pattern: isStringBigIntRegExp.source
|
|
2991
|
+
}),
|
|
2849
2992
|
...annotations
|
|
2850
2993
|
});
|
|
2851
2994
|
}
|
|
@@ -2866,7 +3009,7 @@ const symbolToString = /*#__PURE__*/new Link(symbolString, /*#__PURE__*/new Sche
|
|
|
2866
3009
|
if (key !== undefined) {
|
|
2867
3010
|
return Effect.succeed(globalThis.String(sym));
|
|
2868
3011
|
}
|
|
2869
|
-
return Effect.fail(new SchemaIssue.Forbidden(
|
|
3012
|
+
return Effect.fail(new SchemaIssue.Forbidden({
|
|
2870
3013
|
message: "cannot serialize to string, Symbol is not registered"
|
|
2871
3014
|
}));
|
|
2872
3015
|
})));
|
|
@@ -2874,10 +3017,13 @@ const symbolToString = /*#__PURE__*/new Link(symbolString, /*#__PURE__*/new Sche
|
|
|
2874
3017
|
export function isStringSymbol(annotations) {
|
|
2875
3018
|
return isPattern(isStringSymbolRegExp, {
|
|
2876
3019
|
expected: "a string representing a symbol",
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
3020
|
+
representation: {
|
|
3021
|
+
id: "effect/schema/isStringSymbol",
|
|
3022
|
+
payload: null
|
|
2880
3023
|
},
|
|
3024
|
+
toJsonSchema: () => ({
|
|
3025
|
+
pattern: isStringSymbolRegExp.source
|
|
3026
|
+
}),
|
|
2881
3027
|
...annotations
|
|
2882
3028
|
});
|
|
2883
3029
|
}
|
|
@@ -2886,34 +3032,36 @@ export function collectIssues(checks, value, issues, ast, options) {
|
|
|
2886
3032
|
for (let i = 0; i < checks.length; i++) {
|
|
2887
3033
|
const check = checks[i];
|
|
2888
3034
|
if (check._tag === "FilterGroup") {
|
|
2889
|
-
collectIssues(check.checks, value, issues, ast, options);
|
|
3035
|
+
issues = collectIssues(check.checks, value, issues, ast, options);
|
|
3036
|
+
if (issues && (options.errors !== "all" || issues[issues.length - 1].filter.aborted)) {
|
|
3037
|
+
return issues;
|
|
3038
|
+
}
|
|
2890
3039
|
} else {
|
|
2891
3040
|
const issue = check.run(value, ast, options);
|
|
2892
3041
|
if (issue) {
|
|
2893
|
-
|
|
2894
|
-
if (
|
|
2895
|
-
|
|
3042
|
+
const filter = new SchemaIssue.Filter(check, issue);
|
|
3043
|
+
if (issues) issues.push(filter);else issues = [filter];
|
|
3044
|
+
if (options.errors !== "all" || check.aborted) {
|
|
3045
|
+
return issues;
|
|
2896
3046
|
}
|
|
2897
3047
|
}
|
|
2898
3048
|
}
|
|
2899
3049
|
}
|
|
3050
|
+
return issues;
|
|
2900
3051
|
}
|
|
2901
3052
|
/** @internal */
|
|
2902
3053
|
export function runChecks(checks, s) {
|
|
2903
|
-
const issues =
|
|
2904
|
-
collectIssues(checks, s, issues, unknown, {
|
|
3054
|
+
const issues = collectIssues(checks, s, undefined, unknown, {
|
|
2905
3055
|
errors: "all"
|
|
2906
3056
|
});
|
|
2907
|
-
if (
|
|
2908
|
-
const issue = new SchemaIssue.Composite(unknown,
|
|
3057
|
+
if (issues) {
|
|
3058
|
+
const issue = new SchemaIssue.Composite(unknown, issues);
|
|
2909
3059
|
return Result.fail(issue);
|
|
2910
3060
|
}
|
|
2911
3061
|
return Result.succeed(s);
|
|
2912
3062
|
}
|
|
2913
3063
|
/** @internal */
|
|
2914
3064
|
export const ClassTypeId = "~effect/Schema/Class";
|
|
2915
|
-
/** @internal */
|
|
2916
|
-
export const STRUCTURAL_ANNOTATION_KEY = "~structural";
|
|
2917
3065
|
/**
|
|
2918
3066
|
* Returns all annotations from the AST node.
|
|
2919
3067
|
*
|
|
@@ -2925,12 +3073,12 @@ export const STRUCTURAL_ANNOTATION_KEY = "~structural";
|
|
|
2925
3073
|
*
|
|
2926
3074
|
* **Example** (Reading annotations)
|
|
2927
3075
|
*
|
|
2928
|
-
* ```ts
|
|
3076
|
+
* ```ts import.meta.vitest
|
|
2929
3077
|
* import { Schema, SchemaAST } from "effect"
|
|
2930
3078
|
*
|
|
2931
3079
|
* const schema = Schema.String.annotate({ title: "Name" })
|
|
2932
3080
|
* const annotations = SchemaAST.resolve(schema.ast)
|
|
2933
|
-
*
|
|
3081
|
+
* annotations?.title // => "Name"
|
|
2934
3082
|
* ```
|
|
2935
3083
|
*
|
|
2936
3084
|
* @see {@link resolveAt}
|
|
@@ -2990,6 +3138,66 @@ export const resolveTitle = InternalAnnotations.resolveTitle;
|
|
|
2990
3138
|
* @since 4.0.0
|
|
2991
3139
|
*/
|
|
2992
3140
|
export const resolveDescription = InternalAnnotations.resolveDescription;
|
|
3141
|
+
function isJsonLeaf(u) {
|
|
3142
|
+
return u === null || typeof u === "string" || typeof u === "boolean" || typeof u === "number" && globalThis.Number.isFinite(u);
|
|
3143
|
+
}
|
|
3144
|
+
function isStringTreeLeaf(u) {
|
|
3145
|
+
return u === undefined || typeof u === "string";
|
|
3146
|
+
}
|
|
3147
|
+
function isTree(u, isLeaf) {
|
|
3148
|
+
const cache = new WeakMap();
|
|
3149
|
+
const stack = [];
|
|
3150
|
+
outer: while (true) {
|
|
3151
|
+
if (typeof u !== "object" || u === null) {
|
|
3152
|
+
if (!isLeaf(u)) {
|
|
3153
|
+
return false;
|
|
3154
|
+
}
|
|
3155
|
+
} else {
|
|
3156
|
+
const value = u;
|
|
3157
|
+
const cached = cache.get(value);
|
|
3158
|
+
// `false` marks a node on the current path, while `true` marks a fully
|
|
3159
|
+
// validated node that can be safely reused by a DAG.
|
|
3160
|
+
if (cached === false) {
|
|
3161
|
+
return false;
|
|
3162
|
+
}
|
|
3163
|
+
if (cached === undefined) {
|
|
3164
|
+
const isArray = Array.isArray(value);
|
|
3165
|
+
if (!isArray) {
|
|
3166
|
+
const prototype = Object.getPrototypeOf(value);
|
|
3167
|
+
// A plain object from another realm has a different Object.prototype,
|
|
3168
|
+
// but that prototype still has a null prototype.
|
|
3169
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
3170
|
+
return false;
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
cache.set(value, false);
|
|
3174
|
+
stack.push({
|
|
3175
|
+
value,
|
|
3176
|
+
keys: isArray ? value.length : Object.keys(value),
|
|
3177
|
+
index: 0
|
|
3178
|
+
});
|
|
3179
|
+
}
|
|
3180
|
+
}
|
|
3181
|
+
while (stack.length > 0) {
|
|
3182
|
+
const frame = stack[stack.length - 1];
|
|
3183
|
+
const keys = frame.keys;
|
|
3184
|
+
if (typeof keys === "number") {
|
|
3185
|
+
if (frame.index < keys) {
|
|
3186
|
+
// A sparse slot is read as `undefined`; the leaf predicate determines
|
|
3187
|
+
// whether that is valid for the current tree.
|
|
3188
|
+
u = frame.value[frame.index++];
|
|
3189
|
+
continue outer;
|
|
3190
|
+
}
|
|
3191
|
+
} else if (frame.index < keys.length) {
|
|
3192
|
+
u = frame.value[keys[frame.index++]];
|
|
3193
|
+
continue outer;
|
|
3194
|
+
}
|
|
3195
|
+
cache.set(frame.value, true);
|
|
3196
|
+
stack.pop();
|
|
3197
|
+
}
|
|
3198
|
+
return true;
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
2993
3201
|
/**
|
|
2994
3202
|
* Returns true if the value is a JSON value.
|
|
2995
3203
|
*
|
|
@@ -2998,76 +3206,30 @@ export const resolveDescription = InternalAnnotations.resolveDescription;
|
|
|
2998
3206
|
* @internal
|
|
2999
3207
|
*/
|
|
3000
3208
|
export function isJson(u) {
|
|
3001
|
-
|
|
3002
|
-
// one being visited. A hit here means we looped back to an ancestor — a
|
|
3003
|
-
// real cycle, not a DAG — so the value is not JSON.
|
|
3004
|
-
const onPath = new Set();
|
|
3005
|
-
// `validated` memoizes subtrees we've already fully checked. Without it, a
|
|
3006
|
-
// diamond-shaped DAG (same node reached through multiple parents) would be
|
|
3007
|
-
// re-traversed once per parent, which is exponential in the nesting depth.
|
|
3008
|
-
const validated = new Set();
|
|
3009
|
-
return recur(u);
|
|
3010
|
-
function recur(u) {
|
|
3011
|
-
if (u === null || typeof u === "string" || typeof u === "boolean") {
|
|
3012
|
-
return true;
|
|
3013
|
-
}
|
|
3014
|
-
if (typeof u === "number") {
|
|
3015
|
-
return globalThis.Number.isFinite(u);
|
|
3016
|
-
}
|
|
3017
|
-
if (typeof u !== "object" || u === undefined) {
|
|
3018
|
-
return false;
|
|
3019
|
-
}
|
|
3020
|
-
if (onPath.has(u)) {
|
|
3021
|
-
return false;
|
|
3022
|
-
}
|
|
3023
|
-
if (validated.has(u)) {
|
|
3024
|
-
return true;
|
|
3025
|
-
}
|
|
3026
|
-
const isArray = Array.isArray(u);
|
|
3027
|
-
if (!isArray) {
|
|
3028
|
-
const prototype = Object.getPrototypeOf(u);
|
|
3029
|
-
if (prototype !== null && Object.getPrototypeOf(prototype) !== null) {
|
|
3030
|
-
return false;
|
|
3031
|
-
}
|
|
3032
|
-
}
|
|
3033
|
-
onPath.add(u);
|
|
3034
|
-
const ok = isArray ? u.every(recur) : Object.keys(u).every(key => recur(u[key]));
|
|
3035
|
-
// Pop on exit so siblings reaching the same node via a different path
|
|
3036
|
-
// don't see it as an ancestor (that would reject valid DAGs).
|
|
3037
|
-
onPath.delete(u);
|
|
3038
|
-
if (ok) {
|
|
3039
|
-
validated.add(u);
|
|
3040
|
-
}
|
|
3041
|
-
return ok;
|
|
3042
|
-
}
|
|
3209
|
+
return isTree(u, isJsonLeaf);
|
|
3043
3210
|
}
|
|
3044
3211
|
/** @internal */
|
|
3045
|
-
export const Json = /*#__PURE__*/new Declaration([], () => (input, ast) => isJson(input) ?
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
generation: {
|
|
3050
|
-
runtime: `Schema.Json`,
|
|
3051
|
-
Type: `Schema.Json`
|
|
3212
|
+
export const Json = /*#__PURE__*/new Declaration([], () => (input, ast) => isJson(input) ? InternalParser.sameExit : Effect.fail(new SchemaIssue.InvalidType(ast)), {
|
|
3213
|
+
representation: {
|
|
3214
|
+
id: "effect/schema/Json",
|
|
3215
|
+
payload: null
|
|
3052
3216
|
},
|
|
3053
3217
|
expected: "JSON value",
|
|
3054
|
-
toCodecJson: () =>
|
|
3218
|
+
toCodecJson: () => undefined,
|
|
3219
|
+
toCodecStringTree: () => unknownToStringTree,
|
|
3055
3220
|
toArbitrary: () => fc => fc.jsonValue()
|
|
3056
3221
|
});
|
|
3057
3222
|
/** @internal */
|
|
3058
3223
|
export const MutableJson = /*#__PURE__*/annotate(Json, {
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
generation: {
|
|
3063
|
-
runtime: `Schema.MutableJson`,
|
|
3064
|
-
Type: `Schema.MutableJson`
|
|
3224
|
+
representation: {
|
|
3225
|
+
id: "effect/schema/MutableJson",
|
|
3226
|
+
payload: null
|
|
3065
3227
|
}
|
|
3066
3228
|
});
|
|
3067
3229
|
/** @internal */
|
|
3068
|
-
export const unknownToNull = /*#__PURE__*/new Link(null_, /*#__PURE__*/new SchemaTransformation.Transformation(/*#__PURE__*/SchemaGetter.passthrough(), /*#__PURE__*/SchemaGetter.transform(() => null)));
|
|
3069
|
-
/** @internal */
|
|
3070
3230
|
export const unknownToJson = /*#__PURE__*/new Link(Json, /*#__PURE__*/SchemaTransformation.passthrough());
|
|
3231
|
+
/** @internal */
|
|
3232
|
+
export const objectKeywordToJson = /*#__PURE__*/new Link(/*#__PURE__*/new Union([/*#__PURE__*/new Arrays(false, [], [Json]), /*#__PURE__*/new Objects([], [/*#__PURE__*/new IndexSignature(string, Json)])], "anyOf"), /*#__PURE__*/SchemaTransformation.passthrough());
|
|
3071
3233
|
/**
|
|
3072
3234
|
* Returns true if the value is a StringTree value.
|
|
3073
3235
|
*
|
|
@@ -3076,27 +3238,11 @@ export const unknownToJson = /*#__PURE__*/new Link(Json, /*#__PURE__*/SchemaTran
|
|
|
3076
3238
|
* @internal
|
|
3077
3239
|
*/
|
|
3078
3240
|
export function isStringTree(u) {
|
|
3079
|
-
|
|
3080
|
-
return recur(u);
|
|
3081
|
-
function recur(u) {
|
|
3082
|
-
if (u === undefined || typeof u === "string") {
|
|
3083
|
-
return true;
|
|
3084
|
-
}
|
|
3085
|
-
if (typeof u !== "object" || u === null) {
|
|
3086
|
-
return false;
|
|
3087
|
-
}
|
|
3088
|
-
if (seen.has(u)) {
|
|
3089
|
-
return false;
|
|
3090
|
-
}
|
|
3091
|
-
seen.add(u);
|
|
3092
|
-
if (Array.isArray(u)) {
|
|
3093
|
-
return u.every(recur);
|
|
3094
|
-
}
|
|
3095
|
-
return Object.keys(u).every(key => recur(u[key]));
|
|
3096
|
-
}
|
|
3241
|
+
return isTree(u, isStringTreeLeaf);
|
|
3097
3242
|
}
|
|
3098
|
-
const StringTree = /*#__PURE__*/new Declaration([], () => (input, ast) => isStringTree(input) ?
|
|
3099
|
-
expected: "StringTree"
|
|
3243
|
+
const StringTree = /*#__PURE__*/new Declaration([], () => (input, ast) => isStringTree(input) ? InternalParser.sameExit : Effect.fail(new SchemaIssue.InvalidType(ast)), {
|
|
3244
|
+
expected: "StringTree",
|
|
3245
|
+
toCodecStringTree: () => undefined
|
|
3100
3246
|
});
|
|
3101
3247
|
/** @internal */
|
|
3102
3248
|
export const unknownToStringTree = /*#__PURE__*/new Link(StringTree, /*#__PURE__*/SchemaTransformation.passthrough());
|