effect 4.0.1 → 4.0.2
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/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/Array.d.ts +339 -0
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +143 -3
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +88 -0
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +44 -0
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +68 -0
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +36 -0
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +34 -0
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +18 -0
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +9 -0
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +6 -0
- package/dist/Brand.js.map +1 -1
- package/dist/ByteSize.d.ts +86 -0
- package/dist/ByteSize.d.ts.map +1 -1
- package/dist/ByteSize.js +51 -0
- package/dist/ByteSize.js.map +1 -1
- package/dist/Cache.d.ts +38 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +27 -7
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +82 -0
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +60 -0
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +327 -4
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +168 -8
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +11 -0
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +6 -0
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +192 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +78 -0
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +7 -0
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +5 -0
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +10 -0
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +8 -0
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +52 -12
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +55 -5
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +28 -0
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -0
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +22 -0
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +20 -0
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +50 -0
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +21 -0
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +16 -0
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +26 -1
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +5 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +3 -0
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +13 -0
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +5 -0
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +171 -0
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +89 -0
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +51 -0
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +22 -0
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +1 -0
- package/dist/Duration.d.ts +90 -0
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +53 -0
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +527 -0
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +240 -5
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +4 -0
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -0
- package/dist/Effectable.js.map +1 -1
- package/dist/Equal.d.ts +8 -0
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +9 -1
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +21 -0
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +16 -0
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +36 -0
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +11 -0
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +49 -8
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -0
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +40 -0
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +27 -0
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +20 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +11 -0
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +21 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +21 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +35 -0
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +19 -0
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +20 -0
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +14 -0
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +15 -0
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +8 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +55 -0
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +28 -0
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +3 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +39 -1
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +30 -0
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +20 -0
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +247 -12
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +149 -28
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +5 -0
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +14 -0
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +12 -0
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +91 -0
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +39 -0
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +17 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +9 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +49 -0
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +19 -0
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +7 -0
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +6 -0
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +127 -0
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +51 -0
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +4 -0
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +3 -0
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -0
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +5 -0
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +11 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +14 -0
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +10 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +100 -0
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +45 -1
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +7 -0
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -0
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +5 -0
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +3 -0
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +20 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +9 -0
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +25 -0
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +30 -4
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +5 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +9 -1
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +51 -0
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +39 -0
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +59 -0
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +31 -0
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +32 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +16 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +16 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +10 -0
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +20 -0
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +18 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +31 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +17 -0
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +9 -0
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -0
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +4 -0
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +2 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +61 -0
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +31 -0
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +41 -0
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +20 -0
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +134 -0
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +61 -0
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +29 -0
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +24 -0
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +7 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +3 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +24 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +47 -21
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +6 -0
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +4 -0
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +7 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +5 -0
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +8 -0
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +7 -0
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +19 -0
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +8 -1
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +84 -0
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +48 -0
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +5 -0
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +4 -0
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +67 -5
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +60 -8
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +20 -0
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +10 -0
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +60 -0
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +58 -8
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +13 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +9 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +23 -0
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +8 -0
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +6 -0
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +3 -0
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +100 -0
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +43 -0
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -0
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +4 -0
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +8 -0
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +6 -0
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +4 -0
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +3 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +20 -0
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +16 -0
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +21 -0
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +19 -0
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +3 -0
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +4 -0
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +32 -0
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +12 -0
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +42 -0
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +27 -6
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +6 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +6 -0
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +91 -0
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +41 -0
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +9 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +7 -0
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +57 -0
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +32 -0
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +7 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +5 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +496 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +280 -1
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +107 -0
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +81 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +69 -2
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +63 -4
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +33 -0
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +18 -0
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +25 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +26 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +147 -0
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +99 -0
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +53 -0
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +46 -0
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +19 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +34 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +26 -3
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +9 -0
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +6 -0
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +26 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +10 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +125 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +75 -1
- package/dist/Sink.js.map +1 -1
- package/dist/StandardSchema.d.ts +1 -0
- package/dist/StandardSchema.d.ts.map +1 -1
- package/dist/StandardSchema.js +1 -0
- package/dist/Stdio.d.ts +7 -0
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +5 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +558 -0
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +261 -13
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +87 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +61 -0
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +46 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +19 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +65 -0
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +25 -0
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +2 -0
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +2 -0
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +63 -0
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +24 -0
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +3 -0
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +1 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +8 -0
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +4 -0
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +23 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +12 -0
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +68 -0
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +28 -0
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +38 -0
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +18 -0
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +52 -0
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +23 -0
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +15 -0
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +8 -0
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +83 -0
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +52 -7
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +51 -0
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +29 -4
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +30 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +22 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +25 -0
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +19 -0
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +51 -0
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +30 -0
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +24 -0
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +32 -18
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +14 -0
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +7 -0
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +25 -0
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +29 -13
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +25 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +12 -0
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +36 -0
- package/dist/Types.d.ts.map +1 -1
- package/dist/Types.js +1 -0
- package/dist/UndefinedOr.d.ts +15 -0
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +9 -0
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +15 -0
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +2 -0
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +4 -0
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +1 -0
- package/dist/Utils.js.map +1 -1
- package/dist/Version.d.ts +26 -0
- package/dist/Version.d.ts.map +1 -0
- package/dist/Version.js +36 -0
- package/dist/Version.js.map +1 -0
- package/dist/ai/Chat.js +1 -1
- package/dist/ai/Chat.js.map +1 -1
- package/dist/ai/DecisionModel.d.ts +22 -0
- package/dist/ai/DecisionModel.d.ts.map +1 -1
- package/dist/ai/DecisionModel.js +22 -4
- package/dist/ai/DecisionModel.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +14 -13
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpServer.d.ts +32 -11
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +213 -169
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Telemetry.d.ts +49 -41
- package/dist/ai/Telemetry.d.ts.map +1 -1
- package/dist/ai/Telemetry.js +6 -8
- package/dist/ai/Telemetry.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +79 -46
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpStatefulRuntime.js +1 -0
- package/dist/ai/internal/mcpStatefulRuntime.js.map +1 -1
- package/dist/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/cluster/K8sHttpClient.js +5 -2
- package/dist/cluster/K8sHttpClient.js.map +1 -1
- package/dist/encoding/Base64.d.ts +4 -0
- package/dist/encoding/Base64.d.ts.map +1 -1
- package/dist/encoding/Base64.js +4 -0
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +4 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +4 -0
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/EncodingError.d.ts +4 -0
- package/dist/encoding/EncodingError.d.ts.map +1 -1
- package/dist/encoding/EncodingError.js +4 -0
- package/dist/encoding/EncodingError.js.map +1 -1
- package/dist/encoding/Hex.d.ts +5 -0
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +5 -0
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/Toml.js +2 -2
- package/dist/encoding/Toml.js.map +1 -1
- package/dist/encoding/Yaml.d.ts.map +1 -1
- package/dist/encoding/Yaml.js +6 -4
- package/dist/encoding/Yaml.js.map +1 -1
- package/dist/encoding/index.d.ts +4 -0
- package/dist/encoding/index.d.ts.map +1 -1
- package/dist/encoding/index.js +4 -0
- package/dist/encoding/index.js.map +1 -1
- package/dist/eventlog/SqlEventJournal.js +8 -4
- package/dist/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts +27 -10
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.js +49 -7
- package/dist/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/http/Headers.d.ts +3 -1
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +4 -2
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts +9 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +40 -21
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientResponse.js +3 -1
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpEffect.d.ts +3 -0
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +5 -2
- package/dist/http/HttpEffect.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts +17 -0
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +56 -39
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpServer.d.ts +1 -1
- package/dist/http/HttpServer.d.ts.map +1 -1
- package/dist/http/internal/tracing.d.ts +2 -0
- package/dist/http/internal/tracing.d.ts.map +1 -0
- package/dist/http/internal/tracing.js +37 -0
- package/dist/http/internal/tracing.js.map +1 -0
- package/dist/http-api/HttpApiBuilder.js +2 -1
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +12 -3
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiError.d.ts +4 -3
- package/dist/http-api/HttpApiError.d.ts.map +1 -1
- package/dist/http-api/HttpApiError.js +7 -4
- package/dist/http-api/HttpApiError.js.map +1 -1
- package/dist/http-api/HttpApiSecurity.d.ts +8 -8
- package/dist/http-api/HttpApiSecurity.js +8 -8
- package/dist/index.d.ts +155 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/array.js +3 -3
- package/dist/internal/arbitrary/array.js.map +1 -1
- package/dist/internal/arbitrary/model.js +26 -11
- package/dist/internal/arbitrary/model.js.map +1 -1
- package/dist/internal/arbitrary/runner.js +8 -8
- package/dist/internal/arbitrary/runner.js.map +1 -1
- package/dist/internal/arbitrary/schema.js +4 -5
- package/dist/internal/arbitrary/schema.js.map +1 -1
- package/dist/internal/effect.js +41 -39
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schedule.js +7 -5
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/standardSchema.js +2 -2
- package/dist/internal/schema/standardSchema.js.map +1 -1
- package/dist/internal/version.d.ts +2 -0
- package/dist/internal/version.d.ts.map +1 -0
- package/dist/internal/version.js +3 -0
- package/dist/internal/version.js.map +1 -0
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +5 -6
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +23 -27
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts +5 -3
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +21 -94
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpResource.d.ts +4 -3
- package/dist/observability/OtlpResource.d.ts.map +1 -1
- package/dist/observability/OtlpResource.js +20 -23
- package/dist/observability/OtlpResource.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +1 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +32 -36
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/observability/internal/otlpProtobuf.js +32 -1
- package/dist/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/reactivity/AsyncResult.d.ts +1 -1
- package/dist/reactivity/Atom.d.ts +5 -5
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +9 -5
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomHttpApi.d.ts +2 -2
- package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.d.ts +8 -0
- package/dist/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +21 -3
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +38 -20
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +18 -21
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/rpc/internal/tracing.d.ts +2 -0
- package/dist/rpc/internal/tracing.d.ts.map +1 -0
- package/dist/rpc/internal/tracing.js +18 -0
- package/dist/rpc/internal/tracing.js.map +1 -0
- package/dist/schema/SchemaCompiler/runtime.js +9 -1
- package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
- package/dist/sql/SqlClient.js +4 -4
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/Statement.d.ts +21 -1
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +55 -7
- package/dist/sql/Statement.js.map +1 -1
- package/dist/testing/TestClock.d.ts +8 -0
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +7 -0
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +7 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +6 -0
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -1
- package/package.json +3 -3
- package/src/Array.ts +351 -3
- package/src/BigDecimal.ts +88 -0
- package/src/BigInt.ts +68 -0
- package/src/Boolean.ts +34 -0
- package/src/Brand.ts +10 -0
- package/src/ByteSize.ts +87 -0
- package/src/Cache.ts +50 -8
- package/src/Cause.ts +82 -0
- package/src/Channel.ts +368 -18
- package/src/ChannelSchema.ts +13 -0
- package/src/Chunk.ts +193 -0
- package/src/Clock.ts +7 -0
- package/src/Combiner.ts +10 -0
- package/src/Config.ts +82 -8
- package/src/ConfigProvider.ts +28 -0
- package/src/Console.ts +26 -0
- package/src/Context.ts +50 -0
- package/src/Cron.ts +32 -1
- package/src/Crypto.ts +5 -0
- package/src/Data.ts +13 -0
- package/src/DateTime.ts +171 -0
- package/src/Deferred.ts +51 -0
- package/src/Differ.ts +2 -0
- package/src/Duration.ts +90 -0
- package/src/Effect.ts +539 -5
- package/src/Effectable.ts +4 -0
- package/src/Equal.ts +12 -1
- package/src/Equivalence.ts +22 -0
- package/src/ErrorReporter.ts +36 -0
- package/src/ExecutionPlan.ts +58 -14
- package/src/Exit.ts +40 -0
- package/src/Fiber.ts +20 -0
- package/src/FiberHandle.ts +29 -4
- package/src/FiberMap.ts +38 -0
- package/src/FiberSet.ts +21 -0
- package/src/FileSystem.ts +16 -0
- package/src/Filter.ts +55 -0
- package/src/Formatter.ts +42 -1
- package/src/Function.ts +30 -0
- package/src/Graph.ts +317 -36
- package/src/HKT.ts +5 -0
- package/src/Hash.ts +15 -0
- package/src/HashMap.ts +91 -0
- package/src/HashRing.ts +18 -0
- package/src/HashSet.ts +53 -0
- package/src/Inspectable.ts +8 -0
- package/src/Iterable.ts +127 -0
- package/src/JsonPatch.ts +5 -0
- package/src/JsonPointer.ts +5 -0
- package/src/JsonSchema.ts +17 -0
- package/src/Latch.ts +14 -0
- package/src/Layer.ts +101 -1
- package/src/LayerMap.ts +7 -0
- package/src/LayerRef.ts +5 -0
- package/src/LogLevel.ts +20 -0
- package/src/Logger.ts +41 -5
- package/src/ManagedRuntime.ts +12 -1
- package/src/Match.ts +52 -0
- package/src/Metric.ts +69 -0
- package/src/MutableHashMap.ts +44 -0
- package/src/MutableHashSet.ts +17 -0
- package/src/MutableList.ts +21 -0
- package/src/MutableRef.ts +32 -0
- package/src/Newtype.ts +9 -0
- package/src/NonEmptyIterable.ts +4 -0
- package/src/Number.ts +61 -0
- package/src/Optic.ts +57 -0
- package/src/Option.ts +134 -0
- package/src/Order.ts +30 -0
- package/src/Ordering.ts +7 -0
- package/src/PartitionedSemaphore.ts +61 -22
- package/src/Path.ts +6 -0
- package/src/Pipeable.ts +7 -0
- package/src/PlatformError.ts +8 -0
- package/src/Pool.ts +20 -1
- package/src/Predicate.ts +85 -0
- package/src/PrimaryKey.ts +5 -0
- package/src/PubSub.ts +90 -9
- package/src/Pull.ts +20 -0
- package/src/Queue.ts +80 -10
- package/src/Random.ts +13 -0
- package/src/RcMap.ts +23 -0
- package/src/RcRef.ts +6 -0
- package/src/Record.ts +100 -0
- package/src/Redactable.ts +6 -0
- package/src/Redacted.ts +8 -0
- package/src/Reducer.ts +4 -0
- package/src/Ref.ts +42 -0
- package/src/References.ts +21 -0
- package/src/RegExp.ts +4 -0
- package/src/Request.ts +32 -0
- package/src/RequestResolver.ts +59 -10
- package/src/Resource.ts +7 -0
- package/src/Result.ts +93 -0
- package/src/Runtime.ts +10 -0
- package/src/Schedule.ts +61 -0
- package/src/Scheduler.ts +7 -0
- package/src/Schema.ts +499 -4
- package/src/SchemaAST.ts +115 -1
- package/src/SchemaGetter.ts +80 -4
- package/src/SchemaIssue.ts +34 -0
- package/src/SchemaParser.ts +26 -0
- package/src/SchemaRepresentation.ts +148 -0
- package/src/SchemaTransformation.ts +53 -0
- package/src/Scope.ts +19 -0
- package/src/ScopedCache.ts +55 -3
- package/src/ScopedRef.ts +9 -0
- package/src/Semaphore.ts +26 -0
- package/src/Sink.ts +126 -2
- package/src/StandardSchema.ts +1 -0
- package/src/Stdio.ts +7 -0
- package/src/Stream.ts +622 -15
- package/src/String.ts +87 -0
- package/src/Struct.ts +46 -0
- package/src/SubscriptionRef.ts +65 -0
- package/src/Symbol.ts +2 -0
- package/src/SynchronizedRef.ts +63 -0
- package/src/Take.ts +3 -0
- package/src/Terminal.ts +8 -0
- package/src/Tracer.ts +23 -0
- package/src/Trie.ts +68 -0
- package/src/Tuple.ts +38 -0
- package/src/TxChunk.ts +52 -0
- package/src/TxDeferred.ts +15 -0
- package/src/TxHashMap.ts +97 -6
- package/src/TxHashSet.ts +83 -3
- package/src/TxPriorityQueue.ts +34 -2
- package/src/TxPubSub.ts +26 -0
- package/src/TxQueue.ts +51 -0
- package/src/TxReentrantLock.ts +53 -36
- package/src/TxRef.ts +14 -0
- package/src/TxSemaphore.ts +47 -31
- package/src/TxSubscriptionRef.ts +25 -0
- package/src/Types.ts +36 -0
- package/src/UndefinedOr.ts +15 -0
- package/src/Unify.ts +15 -0
- package/src/Utils.ts +4 -0
- package/src/Version.ts +38 -0
- package/src/ai/Chat.ts +1 -1
- package/src/ai/DecisionModel.ts +42 -1
- package/src/ai/LanguageModel.ts +16 -19
- package/src/ai/McpServer.ts +107 -36
- package/src/ai/Telemetry.ts +62 -58
- package/src/ai/internal/mcpRuntime.ts +84 -43
- package/src/ai/internal/mcpStatefulRuntime.ts +2 -0
- package/src/cluster/K8sHttpClient.ts +12 -2
- package/src/encoding/Base64.ts +4 -0
- package/src/encoding/Base64Url.ts +4 -0
- package/src/encoding/EncodingError.ts +5 -0
- package/src/encoding/Hex.ts +5 -0
- package/src/encoding/Toml.ts +2 -2
- package/src/encoding/Yaml.ts +8 -4
- package/src/encoding/index.ts +4 -0
- package/src/eventlog/SqlEventJournal.ts +18 -4
- package/src/eventlog/SqlEventLogServerUnencrypted.ts +282 -235
- package/src/http/Headers.ts +8 -2
- package/src/http/HttpClient.ts +44 -27
- package/src/http/HttpClientResponse.ts +3 -1
- package/src/http/HttpEffect.ts +11 -2
- package/src/http/HttpMiddleware.ts +60 -45
- package/src/http/HttpServer.ts +1 -1
- package/src/http/internal/tracing.ts +52 -0
- package/src/http-api/HttpApiBuilder.ts +5 -1
- package/src/http-api/HttpApiClient.ts +13 -4
- package/src/http-api/HttpApiError.ts +8 -4
- package/src/http-api/HttpApiSecurity.ts +8 -8
- package/src/index.ts +156 -0
- package/src/internal/arbitrary/array.ts +3 -3
- package/src/internal/arbitrary/model.ts +37 -14
- package/src/internal/arbitrary/runner.ts +7 -7
- package/src/internal/arbitrary/schema.ts +4 -3
- package/src/internal/effect.ts +47 -45
- package/src/internal/schedule.ts +23 -17
- package/src/internal/schema/standardSchema.ts +2 -2
- package/src/internal/version.ts +2 -0
- package/src/observability/OtlpExporter.ts +9 -6
- package/src/observability/OtlpLogger.ts +20 -21
- package/src/observability/OtlpMetrics.ts +34 -93
- package/src/observability/OtlpResource.ts +18 -27
- package/src/observability/OtlpTracer.ts +34 -40
- package/src/observability/internal/otlpProtobuf.ts +60 -0
- package/src/reactivity/AsyncResult.ts +1 -1
- package/src/reactivity/Atom.ts +10 -6
- package/src/reactivity/AtomHttpApi.ts +2 -4
- package/src/reactivity/AtomRegistry.ts +7 -0
- package/src/rpc/RpcClient.ts +48 -24
- package/src/rpc/RpcServer.ts +26 -24
- package/src/rpc/internal/tracing.ts +22 -0
- package/src/schema/SchemaCompiler/runtime.ts +4 -1
- package/src/sql/SqlClient.ts +4 -4
- package/src/sql/Statement.ts +59 -7
- package/src/testing/TestClock.ts +9 -0
- package/src/testing/TestConsole.ts +8 -0
- package/src/testing/index.ts +3 -0
package/dist/Schema.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* generation, formatting, equivalence, optics, and differs derived from schema
|
|
10
10
|
* definitions.
|
|
11
11
|
*
|
|
12
|
+
* @stability stable
|
|
12
13
|
* @since 4.0.0
|
|
13
14
|
*/
|
|
14
15
|
import * as Arr from "./Array.js";
|
|
@@ -118,6 +119,7 @@ const TypeId = InternalMake.TypeId;
|
|
|
118
119
|
* Effect.runSync(Schema.decodeUnknownEffect(schema)({ value: 1 })) // => { value: 1 }
|
|
119
120
|
* ```
|
|
120
121
|
*
|
|
122
|
+
* @stability stable
|
|
121
123
|
* @category constructors
|
|
122
124
|
* @since 4.0.0
|
|
123
125
|
*/
|
|
@@ -155,6 +157,7 @@ export function declareConstructor() {
|
|
|
155
157
|
*
|
|
156
158
|
* @see {@link declareConstructor} for creating schemas for parametric types.
|
|
157
159
|
*
|
|
160
|
+
* @stability stable
|
|
158
161
|
* @category constructors
|
|
159
162
|
* @since 3.10.0
|
|
160
163
|
*/
|
|
@@ -187,6 +190,7 @@ export function declare(is, annotations) {
|
|
|
187
190
|
* type E = typeof bottom["Encoded"] // string
|
|
188
191
|
* ```
|
|
189
192
|
*
|
|
193
|
+
* @stability stable
|
|
190
194
|
* @category utility types
|
|
191
195
|
* @since 4.0.0
|
|
192
196
|
*/
|
|
@@ -219,6 +223,7 @@ export function revealBottom(bottom) {
|
|
|
219
223
|
*
|
|
220
224
|
* @see {@link annotateEncoded} to annotate the encoded side instead.
|
|
221
225
|
*
|
|
226
|
+
* @stability stable
|
|
222
227
|
* @category annotations
|
|
223
228
|
* @since 4.0.0
|
|
224
229
|
*/
|
|
@@ -251,6 +256,7 @@ export function annotate(annotations) {
|
|
|
251
256
|
*
|
|
252
257
|
* @see {@link annotate} to annotate the type side instead.
|
|
253
258
|
*
|
|
259
|
+
* @stability stable
|
|
254
260
|
* @category annotations
|
|
255
261
|
* @since 4.0.0
|
|
256
262
|
*/
|
|
@@ -285,6 +291,7 @@ export function annotateEncoded(annotations) {
|
|
|
285
291
|
* schema.fields.username.ast.context?.annotations?.messageMissingKey // => "Username is required"
|
|
286
292
|
* ```
|
|
287
293
|
*
|
|
294
|
+
* @stability stable
|
|
288
295
|
* @category annotations
|
|
289
296
|
* @since 4.0.0
|
|
290
297
|
*/
|
|
@@ -315,6 +322,7 @@ export function annotateKey(annotations) {
|
|
|
315
322
|
* type Enc = typeof codec["Encoded"] // string
|
|
316
323
|
* ```
|
|
317
324
|
*
|
|
325
|
+
* @stability stable
|
|
318
326
|
* @category utility types
|
|
319
327
|
* @since 4.0.0
|
|
320
328
|
*/
|
|
@@ -348,6 +356,7 @@ export function revealCodec(codec) {
|
|
|
348
356
|
* ```
|
|
349
357
|
*
|
|
350
358
|
* @see {@link isSchemaError} for narrowing unknown values
|
|
359
|
+
* @stability stable
|
|
351
360
|
* @category errors
|
|
352
361
|
* @since 4.0.0
|
|
353
362
|
*/
|
|
@@ -388,6 +397,7 @@ export class SchemaError extends /*#__PURE__*/Data.TaggedError("SchemaError") {
|
|
|
388
397
|
* Schema.isSchemaError(error) // => true
|
|
389
398
|
* ```
|
|
390
399
|
*
|
|
400
|
+
* @stability stable
|
|
391
401
|
* @category guards
|
|
392
402
|
* @since 4.0.0
|
|
393
403
|
*/
|
|
@@ -500,6 +510,7 @@ function runSchemaErrorSync(self) {
|
|
|
500
510
|
* invalidResult.issues?.map((issue) => issue.path) // => [["name"], ["age"]]
|
|
501
511
|
* ```
|
|
502
512
|
*
|
|
513
|
+
* @stability stable
|
|
503
514
|
* @category converting
|
|
504
515
|
* @since 4.0.0
|
|
505
516
|
*/
|
|
@@ -513,6 +524,7 @@ export function toStandardSchemaV1(self, options) {
|
|
|
513
524
|
*
|
|
514
525
|
* https://github.com/standard-schema/standard-schema/pull/134
|
|
515
526
|
*
|
|
527
|
+
* @stability stable
|
|
516
528
|
* @category converting
|
|
517
529
|
* @since 4.0.0
|
|
518
530
|
*/
|
|
@@ -553,6 +565,7 @@ export function toStandardJSONSchemaV1(self) {
|
|
|
553
565
|
* }
|
|
554
566
|
* ```
|
|
555
567
|
*
|
|
568
|
+
* @stability stable
|
|
556
569
|
* @category guards
|
|
557
570
|
* @since 3.10.0
|
|
558
571
|
*/
|
|
@@ -602,6 +615,7 @@ export const is = SchemaParser.is;
|
|
|
602
615
|
* }
|
|
603
616
|
* ```
|
|
604
617
|
*
|
|
618
|
+
* @stability stable
|
|
605
619
|
* @category guards
|
|
606
620
|
* @since 4.0.0
|
|
607
621
|
*/
|
|
@@ -624,6 +638,7 @@ export const asserts = SchemaParser.asserts;
|
|
|
624
638
|
*
|
|
625
639
|
* @see {@link SchemaParser.decodeUnknownEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
626
640
|
*
|
|
641
|
+
* @stability stable
|
|
627
642
|
* @category decoding
|
|
628
643
|
* @since 4.0.0
|
|
629
644
|
*/
|
|
@@ -651,6 +666,7 @@ export function decodeUnknownEffect(schema, options) {
|
|
|
651
666
|
*
|
|
652
667
|
* @see {@link SchemaParser.decodeEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
653
668
|
*
|
|
669
|
+
* @stability stable
|
|
654
670
|
* @category decoding
|
|
655
671
|
* @since 4.0.0
|
|
656
672
|
*/
|
|
@@ -682,6 +698,7 @@ export const decodeEffect = decodeUnknownEffect;
|
|
|
682
698
|
*
|
|
683
699
|
* @see {@link SchemaParser.decodeUnknownExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
684
700
|
*
|
|
701
|
+
* @stability stable
|
|
685
702
|
* @category decoding
|
|
686
703
|
* @since 4.0.0
|
|
687
704
|
*/
|
|
@@ -718,6 +735,7 @@ export function decodeUnknownExit(schema, options) {
|
|
|
718
735
|
*
|
|
719
736
|
* @see {@link SchemaParser.decodeExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
720
737
|
*
|
|
738
|
+
* @stability stable
|
|
721
739
|
* @category decoding
|
|
722
740
|
* @since 4.0.0
|
|
723
741
|
*/
|
|
@@ -745,6 +763,7 @@ export const decodeExit = decodeUnknownExit;
|
|
|
745
763
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
746
764
|
* instead.
|
|
747
765
|
*
|
|
766
|
+
* @stability stable
|
|
748
767
|
* @category decoding
|
|
749
768
|
* @since 3.10.0
|
|
750
769
|
*/
|
|
@@ -771,6 +790,7 @@ export const decodeUnknownOption = SchemaParser.decodeUnknownOption;
|
|
|
771
790
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
772
791
|
* instead.
|
|
773
792
|
*
|
|
793
|
+
* @stability stable
|
|
774
794
|
* @category decoding
|
|
775
795
|
* @since 3.10.0
|
|
776
796
|
*/
|
|
@@ -801,6 +821,7 @@ export const decodeOption = SchemaParser.decodeOption;
|
|
|
801
821
|
*
|
|
802
822
|
* @see {@link SchemaParser.decodeUnknownResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
803
823
|
*
|
|
824
|
+
* @stability stable
|
|
804
825
|
* @category decoding
|
|
805
826
|
* @since 4.0.0
|
|
806
827
|
*/
|
|
@@ -835,6 +856,7 @@ export function decodeUnknownResult(schema, options) {
|
|
|
835
856
|
*
|
|
836
857
|
* @see {@link SchemaParser.decodeResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
837
858
|
*
|
|
859
|
+
* @stability stable
|
|
838
860
|
* @category decoding
|
|
839
861
|
* @since 4.0.0
|
|
840
862
|
*/
|
|
@@ -863,6 +885,7 @@ export const decodeResult = decodeUnknownResult;
|
|
|
863
885
|
*
|
|
864
886
|
* @see {@link SchemaParser.decodeUnknownPromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
865
887
|
*
|
|
888
|
+
* @stability stable
|
|
866
889
|
* @category decoding
|
|
867
890
|
* @since 3.10.0
|
|
868
891
|
*/
|
|
@@ -896,6 +919,7 @@ export function decodeUnknownPromise(schema, options) {
|
|
|
896
919
|
*
|
|
897
920
|
* @see {@link SchemaParser.decodePromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
898
921
|
*
|
|
922
|
+
* @stability stable
|
|
899
923
|
* @category decoding
|
|
900
924
|
* @since 3.10.0
|
|
901
925
|
*/
|
|
@@ -934,6 +958,7 @@ export const decodePromise = decodeUnknownPromise;
|
|
|
934
958
|
*
|
|
935
959
|
* @see {@link SchemaParser.decodeUnknownSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
936
960
|
*
|
|
961
|
+
* @stability stable
|
|
937
962
|
* @category decoding
|
|
938
963
|
* @since 4.0.0
|
|
939
964
|
*/
|
|
@@ -966,6 +991,7 @@ export function decodeUnknownSync(schema, options) {
|
|
|
966
991
|
*
|
|
967
992
|
* @see {@link SchemaParser.decodeSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
968
993
|
*
|
|
994
|
+
* @stability stable
|
|
969
995
|
* @category decoding
|
|
970
996
|
* @since 4.0.0
|
|
971
997
|
*/
|
|
@@ -998,6 +1024,7 @@ export const decodeSync = decodeUnknownSync;
|
|
|
998
1024
|
*
|
|
999
1025
|
* @see {@link SchemaParser.encodeUnknownEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1000
1026
|
*
|
|
1027
|
+
* @stability stable
|
|
1001
1028
|
* @category encoding
|
|
1002
1029
|
* @since 4.0.0
|
|
1003
1030
|
*/
|
|
@@ -1025,6 +1052,7 @@ export function encodeUnknownEffect(schema, options) {
|
|
|
1025
1052
|
*
|
|
1026
1053
|
* @see {@link SchemaParser.encodeEffect} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1027
1054
|
*
|
|
1055
|
+
* @stability stable
|
|
1028
1056
|
* @category encoding
|
|
1029
1057
|
* @since 4.0.0
|
|
1030
1058
|
*/
|
|
@@ -1055,6 +1083,7 @@ export const encodeEffect = encodeUnknownEffect;
|
|
|
1055
1083
|
*
|
|
1056
1084
|
* @see {@link SchemaParser.encodeUnknownExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
1057
1085
|
*
|
|
1086
|
+
* @stability stable
|
|
1058
1087
|
* @category encoding
|
|
1059
1088
|
* @since 4.0.0
|
|
1060
1089
|
*/
|
|
@@ -1091,6 +1120,7 @@ export function encodeUnknownExit(schema, options) {
|
|
|
1091
1120
|
*
|
|
1092
1121
|
* @see {@link SchemaParser.encodeExit} for the adapter whose failure contains `SchemaIssue.Issue` directly
|
|
1093
1122
|
*
|
|
1123
|
+
* @stability stable
|
|
1094
1124
|
* @category encoding
|
|
1095
1125
|
* @since 4.0.0
|
|
1096
1126
|
*/
|
|
@@ -1118,6 +1148,7 @@ export const encodeExit = encodeUnknownExit;
|
|
|
1118
1148
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
1119
1149
|
* instead.
|
|
1120
1150
|
*
|
|
1151
|
+
* @stability stable
|
|
1121
1152
|
* @category encoding
|
|
1122
1153
|
* @since 3.10.0
|
|
1123
1154
|
*/
|
|
@@ -1144,6 +1175,7 @@ export const encodeUnknownOption = SchemaParser.encodeUnknownOption;
|
|
|
1144
1175
|
* that contain defects, interruptions, or other non-schema reasons throw
|
|
1145
1176
|
* instead.
|
|
1146
1177
|
*
|
|
1178
|
+
* @stability stable
|
|
1147
1179
|
* @category encoding
|
|
1148
1180
|
* @since 3.10.0
|
|
1149
1181
|
*/
|
|
@@ -1173,6 +1205,7 @@ export const encodeOption = SchemaParser.encodeOption;
|
|
|
1173
1205
|
*
|
|
1174
1206
|
* @see {@link SchemaParser.encodeUnknownResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1175
1207
|
*
|
|
1208
|
+
* @stability stable
|
|
1176
1209
|
* @category encoding
|
|
1177
1210
|
* @since 4.0.0
|
|
1178
1211
|
*/
|
|
@@ -1207,6 +1240,7 @@ export function encodeUnknownResult(schema, options) {
|
|
|
1207
1240
|
*
|
|
1208
1241
|
* @see {@link SchemaParser.encodeResult} for the adapter that fails with `SchemaIssue.Issue` directly
|
|
1209
1242
|
*
|
|
1243
|
+
* @stability stable
|
|
1210
1244
|
* @category encoding
|
|
1211
1245
|
* @since 4.0.0
|
|
1212
1246
|
*/
|
|
@@ -1234,6 +1268,7 @@ export const encodeResult = encodeUnknownResult;
|
|
|
1234
1268
|
*
|
|
1235
1269
|
* @see {@link SchemaParser.encodeUnknownPromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
1236
1270
|
*
|
|
1271
|
+
* @stability stable
|
|
1237
1272
|
* @category encoding
|
|
1238
1273
|
* @since 3.10.0
|
|
1239
1274
|
*/
|
|
@@ -1267,6 +1302,7 @@ export function encodeUnknownPromise(schema, options) {
|
|
|
1267
1302
|
*
|
|
1268
1303
|
* @see {@link SchemaParser.encodePromise} for the adapter that rejects with an `Error` whose cause is `SchemaIssue.Issue`
|
|
1269
1304
|
*
|
|
1305
|
+
* @stability stable
|
|
1270
1306
|
* @category encoding
|
|
1271
1307
|
* @since 3.10.0
|
|
1272
1308
|
*/
|
|
@@ -1294,6 +1330,7 @@ export const encodePromise = encodeUnknownPromise;
|
|
|
1294
1330
|
*
|
|
1295
1331
|
* @see {@link SchemaParser.encodeUnknownSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
1296
1332
|
*
|
|
1333
|
+
* @stability stable
|
|
1297
1334
|
* @category encoding
|
|
1298
1335
|
* @since 4.0.0
|
|
1299
1336
|
*/
|
|
@@ -1324,6 +1361,7 @@ export function encodeUnknownSync(schema, options) {
|
|
|
1324
1361
|
*
|
|
1325
1362
|
* @see {@link SchemaParser.encodeSync} for the adapter that throws an `Error` whose cause is `SchemaIssue.Issue`
|
|
1326
1363
|
*
|
|
1364
|
+
* @stability stable
|
|
1327
1365
|
* @category encoding
|
|
1328
1366
|
* @since 4.0.0
|
|
1329
1367
|
*/
|
|
@@ -1342,6 +1380,7 @@ export const encodeSync = encodeUnknownSync;
|
|
|
1342
1380
|
* the bridge between the untyped AST representation and the strongly-typed
|
|
1343
1381
|
* schema.
|
|
1344
1382
|
*
|
|
1383
|
+
* @stability stable
|
|
1345
1384
|
* @category constructors
|
|
1346
1385
|
* @since 3.10.0
|
|
1347
1386
|
*/
|
|
@@ -1349,6 +1388,7 @@ export const make = InternalMake.make;
|
|
|
1349
1388
|
/**
|
|
1350
1389
|
* Checks whether a value is a `Schema`.
|
|
1351
1390
|
*
|
|
1391
|
+
* @stability stable
|
|
1352
1392
|
* @category guards
|
|
1353
1393
|
* @since 3.10.0
|
|
1354
1394
|
*/
|
|
@@ -1374,6 +1414,7 @@ export function isSchema(u) {
|
|
|
1374
1414
|
* type Person = typeof schema["Type"]
|
|
1375
1415
|
* ```
|
|
1376
1416
|
*
|
|
1417
|
+
* @stability stable
|
|
1377
1418
|
* @category combinators
|
|
1378
1419
|
* @since 4.0.0
|
|
1379
1420
|
*/
|
|
@@ -1388,6 +1429,7 @@ export const optionalKey = /*#__PURE__*/Struct_.lambda(schema => make(SchemaAST.
|
|
|
1388
1429
|
* Use to remove optional-key wrapping from a schema field that was previously
|
|
1389
1430
|
* wrapped with {@link optionalKey}.
|
|
1390
1431
|
*
|
|
1432
|
+
* @stability stable
|
|
1391
1433
|
* @category combinators
|
|
1392
1434
|
* @since 4.0.0
|
|
1393
1435
|
*/
|
|
@@ -1418,6 +1460,7 @@ export const requiredKey = /*#__PURE__*/Struct_.lambda(self => self.schema);
|
|
|
1418
1460
|
* type Person = typeof schema.Type
|
|
1419
1461
|
* ```
|
|
1420
1462
|
*
|
|
1463
|
+
* @stability stable
|
|
1421
1464
|
* @category combinators
|
|
1422
1465
|
* @since 3.10.0
|
|
1423
1466
|
*/
|
|
@@ -1439,6 +1482,7 @@ export const optional = /*#__PURE__*/Struct_.lambda(self => {
|
|
|
1439
1482
|
*
|
|
1440
1483
|
* This also unwraps the `UndefinedOr` member added by `optional`.
|
|
1441
1484
|
*
|
|
1485
|
+
* @stability stable
|
|
1442
1486
|
* @category combinators
|
|
1443
1487
|
* @since 3.10.0
|
|
1444
1488
|
*/
|
|
@@ -1447,6 +1491,7 @@ export const required = /*#__PURE__*/Struct_.lambda(self => self.schema.members[
|
|
|
1447
1491
|
* Makes a struct field mutable (removes the `readonly` modifier on the property).
|
|
1448
1492
|
* Use {@link readonlyKey} to reverse.
|
|
1449
1493
|
*
|
|
1494
|
+
* @stability stable
|
|
1450
1495
|
* @category combinators
|
|
1451
1496
|
* @since 4.0.0
|
|
1452
1497
|
*/
|
|
@@ -1461,6 +1506,7 @@ export const mutableKey = /*#__PURE__*/Struct_.lambda(schema => make(SchemaAST.m
|
|
|
1461
1506
|
* Use to remove mutable-key wrapping from a schema field that was previously
|
|
1462
1507
|
* wrapped with {@link mutableKey}.
|
|
1463
1508
|
*
|
|
1509
|
+
* @stability stable
|
|
1464
1510
|
* @category combinators
|
|
1465
1511
|
* @since 4.0.0
|
|
1466
1512
|
*/
|
|
@@ -1469,6 +1515,7 @@ export const readonlyKey = /*#__PURE__*/Struct_.lambda(self => self.schema);
|
|
|
1469
1515
|
* Extracts the type-side schema: sets `Encoded` to equal the decoded `Type`,
|
|
1470
1516
|
* discarding the encoding transformation path.
|
|
1471
1517
|
*
|
|
1518
|
+
* @stability stable
|
|
1472
1519
|
* @category transforming
|
|
1473
1520
|
* @since 4.0.0
|
|
1474
1521
|
*/
|
|
@@ -1479,6 +1526,7 @@ export const toType = /*#__PURE__*/Struct_.lambda(schema => make(SchemaAST.toTyp
|
|
|
1479
1526
|
* Extracts the encoded-side schema: sets `Type` to equal the `Encoded`,
|
|
1480
1527
|
* discarding the decoding transformation path.
|
|
1481
1528
|
*
|
|
1529
|
+
* @stability stable
|
|
1482
1530
|
* @category transforming
|
|
1483
1531
|
* @since 4.0.0
|
|
1484
1532
|
*/
|
|
@@ -1514,6 +1562,7 @@ export function flip(schema) {
|
|
|
1514
1562
|
* @see {@link Literals} for a schema that represents a union of literals.
|
|
1515
1563
|
* @see {@link tag} for a schema that represents a literal value that can be
|
|
1516
1564
|
* used as a discriminator field in tagged unions and has a constructor default.
|
|
1565
|
+
* @stability stable
|
|
1517
1566
|
* @category constructors
|
|
1518
1567
|
* @since 3.10.0
|
|
1519
1568
|
*/
|
|
@@ -1564,6 +1613,7 @@ function templateLiteralParts(parts) {
|
|
|
1564
1613
|
* ```
|
|
1565
1614
|
*
|
|
1566
1615
|
* @see {@link TemplateLiteralParser} for a schema that also parses matched parts into a tuple.
|
|
1616
|
+
* @stability stable
|
|
1567
1617
|
* @category constructors
|
|
1568
1618
|
* @since 3.10.0
|
|
1569
1619
|
*/
|
|
@@ -1604,6 +1654,7 @@ export function TemplateLiteral(parts) {
|
|
|
1604
1654
|
* ```
|
|
1605
1655
|
*
|
|
1606
1656
|
* @see {@link TemplateLiteral} for a validation-only version that keeps the string encoded.
|
|
1657
|
+
* @stability stable
|
|
1607
1658
|
* @category constructors
|
|
1608
1659
|
* @since 3.10.0
|
|
1609
1660
|
*/
|
|
@@ -1634,6 +1685,7 @@ export function TemplateLiteralParser(parts) {
|
|
|
1634
1685
|
* Schema.decodeSync(schema)(Direction.Up) // => "Up"
|
|
1635
1686
|
* ```
|
|
1636
1687
|
*
|
|
1688
|
+
* @stability stable
|
|
1637
1689
|
* @category constructors
|
|
1638
1690
|
* @since 4.0.0
|
|
1639
1691
|
*/
|
|
@@ -1645,6 +1697,7 @@ export function Enum(enums) {
|
|
|
1645
1697
|
/**
|
|
1646
1698
|
* Schema for the `never` type. Always fails validation — no value satisfies it.
|
|
1647
1699
|
*
|
|
1700
|
+
* @stability stable
|
|
1648
1701
|
* @category schemas
|
|
1649
1702
|
* @since 3.10.0
|
|
1650
1703
|
*/
|
|
@@ -1653,6 +1706,7 @@ export const Never = /*#__PURE__*/make(SchemaAST.never);
|
|
|
1653
1706
|
* Schema for the `any` type. Accepts any value without validation.
|
|
1654
1707
|
*
|
|
1655
1708
|
* @see {@link Unknown} for a safer alternative that uses `unknown`.
|
|
1709
|
+
* @stability stable
|
|
1656
1710
|
* @category schemas
|
|
1657
1711
|
* @since 3.10.0
|
|
1658
1712
|
*/
|
|
@@ -1666,6 +1720,7 @@ export const Any = /*#__PURE__*/make(SchemaAST.any);
|
|
|
1666
1720
|
* TypeScript's `unknown` safety at use sites.
|
|
1667
1721
|
*
|
|
1668
1722
|
* @see {@link Any} for the `any` variant.
|
|
1723
|
+
* @stability stable
|
|
1669
1724
|
* @category schemas
|
|
1670
1725
|
* @since 3.10.0
|
|
1671
1726
|
*/
|
|
@@ -1674,6 +1729,7 @@ export const Unknown = /*#__PURE__*/make(SchemaAST.unknown);
|
|
|
1674
1729
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
1675
1730
|
*
|
|
1676
1731
|
* @see {@link NullOr} for a union with another schema.
|
|
1732
|
+
* @stability stable
|
|
1677
1733
|
* @category schemas
|
|
1678
1734
|
* @since 3.10.0
|
|
1679
1735
|
*/
|
|
@@ -1682,6 +1738,7 @@ export const Null = /*#__PURE__*/make(SchemaAST.null);
|
|
|
1682
1738
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
1683
1739
|
*
|
|
1684
1740
|
* @see {@link UndefinedOr} for a union with another schema.
|
|
1741
|
+
* @stability stable
|
|
1685
1742
|
* @category schemas
|
|
1686
1743
|
* @since 3.10.0
|
|
1687
1744
|
*/
|
|
@@ -1689,6 +1746,7 @@ export const Undefined = /*#__PURE__*/make(SchemaAST.undefined);
|
|
|
1689
1746
|
/**
|
|
1690
1747
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
1691
1748
|
*
|
|
1749
|
+
* @stability stable
|
|
1692
1750
|
* @category schemas
|
|
1693
1751
|
* @since 4.0.0
|
|
1694
1752
|
*/
|
|
@@ -1724,6 +1782,7 @@ export const String = /*#__PURE__*/make(SchemaAST.string);
|
|
|
1724
1782
|
*
|
|
1725
1783
|
* @see {@link String} for a schema whose type is plain `string`.
|
|
1726
1784
|
* @see {@link Literals} for the known literals to include in the union.
|
|
1785
|
+
* @stability stable
|
|
1727
1786
|
* @category schemas
|
|
1728
1787
|
* @since 4.0.0
|
|
1729
1788
|
*/
|
|
@@ -1739,6 +1798,7 @@ export const StringForLiteralAutocomplete = String;
|
|
|
1739
1798
|
* - Non-finite values are serialized as strings (`"NaN"`, `"Infinity"`, `"-Infinity"`).
|
|
1740
1799
|
*
|
|
1741
1800
|
* @see {@link Finite} for a schema that excludes non-finite values.
|
|
1801
|
+
* @stability stable
|
|
1742
1802
|
* @category schemas
|
|
1743
1803
|
* @since 4.0.0
|
|
1744
1804
|
*/
|
|
@@ -1752,6 +1812,7 @@ export const Number = /*#__PURE__*/make(SchemaAST.number);
|
|
|
1752
1812
|
*
|
|
1753
1813
|
* @see {@link BooleanFromBit} for a schema that decodes bit literals `0` or `1` into a boolean
|
|
1754
1814
|
*
|
|
1815
|
+
* @stability stable
|
|
1755
1816
|
* @category schemas
|
|
1756
1817
|
* @since 4.0.0
|
|
1757
1818
|
*/
|
|
@@ -1760,6 +1821,7 @@ export const Boolean = /*#__PURE__*/make(SchemaAST.boolean);
|
|
|
1760
1821
|
* Schema for `symbol` values. Validates that the input is `typeof` `"symbol"`.
|
|
1761
1822
|
*
|
|
1762
1823
|
* @see {@link UniqueSymbol} for a schema that matches a specific symbol.
|
|
1824
|
+
* @stability stable
|
|
1763
1825
|
* @category schemas
|
|
1764
1826
|
* @since 4.0.0
|
|
1765
1827
|
*/
|
|
@@ -1774,6 +1836,7 @@ export const Symbol = /*#__PURE__*/make(SchemaAST.symbol);
|
|
|
1774
1836
|
*
|
|
1775
1837
|
* @see {@link BigIntFromString} for parsing string input into a bigint
|
|
1776
1838
|
*
|
|
1839
|
+
* @stability stable
|
|
1777
1840
|
* @category schemas
|
|
1778
1841
|
* @since 4.0.0
|
|
1779
1842
|
*/
|
|
@@ -1794,6 +1857,7 @@ export const BigInt = /*#__PURE__*/make(SchemaAST.bigInt);
|
|
|
1794
1857
|
* as `void`.
|
|
1795
1858
|
*
|
|
1796
1859
|
* @see {@link Undefined} for a schema that matches only the exact `undefined` value.
|
|
1860
|
+
* @stability stable
|
|
1797
1861
|
* @category schemas
|
|
1798
1862
|
* @since 3.10.0
|
|
1799
1863
|
*/
|
|
@@ -1802,6 +1866,7 @@ export const Void = /*#__PURE__*/make(SchemaAST.void);
|
|
|
1802
1866
|
* Schema for the `object` type. Validates that the input is a non-null object or function
|
|
1803
1867
|
* (i.e. `typeof value === "object" && value !== null || typeof value === "function"`).
|
|
1804
1868
|
*
|
|
1869
|
+
* @stability stable
|
|
1805
1870
|
* @category schemas
|
|
1806
1871
|
* @since 4.0.0
|
|
1807
1872
|
*/
|
|
@@ -1826,6 +1891,7 @@ export const ObjectKeyword = /*#__PURE__*/make(SchemaAST.objectKeyword);
|
|
|
1826
1891
|
* ```
|
|
1827
1892
|
*
|
|
1828
1893
|
* @see {@link Symbol} for a schema that accepts any symbol.
|
|
1894
|
+
* @stability stable
|
|
1829
1895
|
* @category constructors
|
|
1830
1896
|
* @since 4.0.0
|
|
1831
1897
|
*/
|
|
@@ -1872,6 +1938,7 @@ function makeStruct(ast, fields) {
|
|
|
1872
1938
|
* Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 }) // => { name: "Alice", age: 30 }
|
|
1873
1939
|
* ```
|
|
1874
1940
|
*
|
|
1941
|
+
* @stability stable
|
|
1875
1942
|
* @category constructors
|
|
1876
1943
|
* @since 3.10.0
|
|
1877
1944
|
*/
|
|
@@ -1903,6 +1970,7 @@ export function Struct(fields) {
|
|
|
1903
1970
|
* Schema.decodeSync(schema)({ a: "a", c: 1 }) // => { a: "a", c: 1 }
|
|
1904
1971
|
* ```
|
|
1905
1972
|
*
|
|
1973
|
+
* @stability stable
|
|
1906
1974
|
* @category combinators
|
|
1907
1975
|
* @since 4.0.0
|
|
1908
1976
|
*/
|
|
@@ -1933,6 +2001,7 @@ const canonicalPropertyKey = key => typeof key === "symbol" ? key : globalThis.S
|
|
|
1933
2001
|
* Schema.decodeUnknownSync(Encoded)({ full_name: "Alice", age: 30 }) // => { name: "Alice", age: 30 }
|
|
1934
2002
|
* ```
|
|
1935
2003
|
*
|
|
2004
|
+
* @stability stable
|
|
1936
2005
|
* @category transforming
|
|
1937
2006
|
* @since 4.0.0
|
|
1938
2007
|
*/
|
|
@@ -1990,6 +2059,7 @@ export function encodeKeys(mapping) {
|
|
|
1990
2059
|
* alice.fullName // => "Alice Smith"
|
|
1991
2060
|
* ```
|
|
1992
2061
|
*
|
|
2062
|
+
* @stability stable
|
|
1993
2063
|
* @category transforming
|
|
1994
2064
|
* @since 4.0.0
|
|
1995
2065
|
*/
|
|
@@ -2061,6 +2131,7 @@ export function extendTo(fields, derive) {
|
|
|
2061
2131
|
* Schema.decodeUnknownSync(schema)({ a: 1, b: 2 }) // => { a: 1, b: 2 }
|
|
2062
2132
|
* ```
|
|
2063
2133
|
*
|
|
2134
|
+
* @stability stable
|
|
2064
2135
|
* @category constructors
|
|
2065
2136
|
* @since 3.10.0
|
|
2066
2137
|
*/
|
|
@@ -2095,6 +2166,7 @@ export function Record(key, value) {
|
|
|
2095
2166
|
* type T = typeof schema.Type
|
|
2096
2167
|
* ```
|
|
2097
2168
|
*
|
|
2169
|
+
* @stability stable
|
|
2098
2170
|
* @category constructors
|
|
2099
2171
|
* @since 4.0.0
|
|
2100
2172
|
*/
|
|
@@ -2126,6 +2198,7 @@ function makeTuple(ast, elements) {
|
|
|
2126
2198
|
* Schema.decodeUnknownSync(schema)(["hello", 42]) // => ["hello", 42]
|
|
2127
2199
|
* ```
|
|
2128
2200
|
*
|
|
2201
|
+
* @stability stable
|
|
2129
2202
|
* @category constructors
|
|
2130
2203
|
* @since 3.10.0
|
|
2131
2204
|
*/
|
|
@@ -2157,6 +2230,7 @@ export function Tuple(elements) {
|
|
|
2157
2230
|
* Schema.decodeUnknownSync(schema)(["hello", 1, true, false]) // => ["hello", 1, true, false]
|
|
2158
2231
|
* ```
|
|
2159
2232
|
*
|
|
2233
|
+
* @stability stable
|
|
2160
2234
|
* @category constructors
|
|
2161
2235
|
* @since 4.0.0
|
|
2162
2236
|
*/
|
|
@@ -2187,6 +2261,7 @@ export {
|
|
|
2187
2261
|
* Schema.decodeUnknownSync(schema)(["a", "b", "c"]) // => ["a", "b", "c"]
|
|
2188
2262
|
* ```
|
|
2189
2263
|
*
|
|
2264
|
+
* @stability stable
|
|
2190
2265
|
* @category constructors
|
|
2191
2266
|
* @since 4.0.0
|
|
2192
2267
|
*/
|
|
@@ -2214,6 +2289,7 @@ export function withArrayLengthConstraints(self, minimum, maximum) {
|
|
|
2214
2289
|
* Schema.decodeUnknownSync(schema)([1, 2, 3]) // => [1, 2, 3]
|
|
2215
2290
|
* ```
|
|
2216
2291
|
*
|
|
2292
|
+
* @stability stable
|
|
2217
2293
|
* @category constructors
|
|
2218
2294
|
* @since 3.10.0
|
|
2219
2295
|
*/
|
|
@@ -2243,6 +2319,7 @@ export const NonEmptyArray = /*#__PURE__*/Struct_.lambda(schema => make(new Sche
|
|
|
2243
2319
|
* @see {@link Array} for accepting only array input
|
|
2244
2320
|
* @see {@link NonEmptyArray} for requiring at least one decoded element
|
|
2245
2321
|
*
|
|
2322
|
+
* @stability stable
|
|
2246
2323
|
* @category constructors
|
|
2247
2324
|
* @since 3.10.0
|
|
2248
2325
|
*/
|
|
@@ -2266,6 +2343,7 @@ export function ArrayEnsure(schema) {
|
|
|
2266
2343
|
* The equivalence used to determine uniqueness is the one provided by
|
|
2267
2344
|
* `Schema.toEquivalence(item)`.
|
|
2268
2345
|
*
|
|
2346
|
+
* @stability stable
|
|
2269
2347
|
* @category constructors
|
|
2270
2348
|
* @since 4.0.0
|
|
2271
2349
|
*/
|
|
@@ -2295,6 +2373,7 @@ export function UniqueArray(item) {
|
|
|
2295
2373
|
* value // => [1, 2, 3]
|
|
2296
2374
|
* ```
|
|
2297
2375
|
*
|
|
2376
|
+
* @stability stable
|
|
2298
2377
|
* @category transforming
|
|
2299
2378
|
* @since 3.10.0
|
|
2300
2379
|
*/
|
|
@@ -2331,6 +2410,7 @@ function makeUnion(ast, members) {
|
|
|
2331
2410
|
* Schema.decodeUnknownSync(schema)(42) // => 42
|
|
2332
2411
|
* ```
|
|
2333
2412
|
*
|
|
2413
|
+
* @stability stable
|
|
2334
2414
|
* @category constructors
|
|
2335
2415
|
* @since 3.10.0
|
|
2336
2416
|
*/
|
|
@@ -2350,6 +2430,7 @@ export function Union(members, options) {
|
|
|
2350
2430
|
* ```
|
|
2351
2431
|
*
|
|
2352
2432
|
* @see {@link Literal} for a schema that represents a single literal.
|
|
2433
|
+
* @stability stable
|
|
2353
2434
|
* @category constructors
|
|
2354
2435
|
* @since 4.0.0
|
|
2355
2436
|
*/
|
|
@@ -2372,6 +2453,7 @@ export function Literals(literals) {
|
|
|
2372
2453
|
/**
|
|
2373
2454
|
* Creates a union schema of `S | null`.
|
|
2374
2455
|
*
|
|
2456
|
+
* @stability stable
|
|
2375
2457
|
* @category constructors
|
|
2376
2458
|
* @since 3.10.0
|
|
2377
2459
|
*/
|
|
@@ -2379,6 +2461,7 @@ export const NullOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Null]));
|
|
|
2379
2461
|
/**
|
|
2380
2462
|
* Creates a union schema of `S | undefined`.
|
|
2381
2463
|
*
|
|
2464
|
+
* @stability stable
|
|
2382
2465
|
* @category constructors
|
|
2383
2466
|
* @since 3.10.0
|
|
2384
2467
|
*/
|
|
@@ -2386,6 +2469,7 @@ export const UndefinedOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Unde
|
|
|
2386
2469
|
/**
|
|
2387
2470
|
* Creates a union schema of `S | null | undefined`.
|
|
2388
2471
|
*
|
|
2472
|
+
* @stability stable
|
|
2389
2473
|
* @category constructors
|
|
2390
2474
|
* @since 3.10.0
|
|
2391
2475
|
*/
|
|
@@ -2412,6 +2496,7 @@ export const NullishOr = /*#__PURE__*/Struct_.lambda(self => Union([self, Null,
|
|
|
2412
2496
|
* Schema.decodeSync(Tree)({ value: 1, children: [] }) // => { value: 1, children: [] }
|
|
2413
2497
|
* ```
|
|
2414
2498
|
*
|
|
2499
|
+
* @stability stable
|
|
2415
2500
|
* @category constructors
|
|
2416
2501
|
* @since 3.10.0
|
|
2417
2502
|
*/
|
|
@@ -2434,6 +2519,7 @@ export function suspend(f) {
|
|
|
2434
2519
|
* Schema.is(AgeSchema)(121) // => false
|
|
2435
2520
|
* ```
|
|
2436
2521
|
*
|
|
2522
|
+
* @stability stable
|
|
2437
2523
|
* @category filtering
|
|
2438
2524
|
* @since 4.0.0
|
|
2439
2525
|
*/
|
|
@@ -2452,6 +2538,7 @@ export function check(...checks) {
|
|
|
2452
2538
|
* names type-level failures before the refinement runs; it does not name the
|
|
2453
2539
|
* failed refinement itself.
|
|
2454
2540
|
*
|
|
2541
|
+
* @stability stable
|
|
2455
2542
|
* @category filtering
|
|
2456
2543
|
* @since 3.10.0
|
|
2457
2544
|
*/
|
|
@@ -2481,6 +2568,7 @@ export function refine(refinement, annotations) {
|
|
|
2481
2568
|
*
|
|
2482
2569
|
* @see {@link fromBrand} for applying a Brand constructor's checks along with its branded type
|
|
2483
2570
|
*
|
|
2571
|
+
* @stability stable
|
|
2484
2572
|
* @category branding
|
|
2485
2573
|
* @since 3.10.0
|
|
2486
2574
|
*/
|
|
@@ -2506,6 +2594,7 @@ export function brand(identifier) {
|
|
|
2506
2594
|
*
|
|
2507
2595
|
* @see {@link brand} for adding a brand without constructor checks
|
|
2508
2596
|
*
|
|
2597
|
+
* @stability stable
|
|
2509
2598
|
* @category branding
|
|
2510
2599
|
* @since 3.10.0
|
|
2511
2600
|
*/
|
|
@@ -2539,6 +2628,7 @@ export function fromBrand(identifier, ctor) {
|
|
|
2539
2628
|
* ```
|
|
2540
2629
|
*
|
|
2541
2630
|
* @see {@link catchDecoding} for a simpler error-recovery variant
|
|
2631
|
+
* @stability stable
|
|
2542
2632
|
* @category decoding
|
|
2543
2633
|
* @since 4.0.0
|
|
2544
2634
|
*/
|
|
@@ -2572,6 +2662,7 @@ export function middlewareDecoding(decode) {
|
|
|
2572
2662
|
* ```
|
|
2573
2663
|
*
|
|
2574
2664
|
* @see {@link catchEncoding} for a simpler error-recovery variant
|
|
2665
|
+
* @stability stable
|
|
2575
2666
|
* @category encoding
|
|
2576
2667
|
* @since 4.0.0
|
|
2577
2668
|
*/
|
|
@@ -2600,6 +2691,7 @@ export function middlewareEncoding(encode) {
|
|
|
2600
2691
|
* ```
|
|
2601
2692
|
*
|
|
2602
2693
|
* @see {@link catchDecodingWithContext} to add service requirements to the handler
|
|
2694
|
+
* @stability stable
|
|
2603
2695
|
* @category error handling
|
|
2604
2696
|
* @since 4.0.0
|
|
2605
2697
|
*/
|
|
@@ -2623,6 +2715,7 @@ export function catchDecoding(f) {
|
|
|
2623
2715
|
* @see {@link catchDecoding} for recovery handlers that do not require services
|
|
2624
2716
|
* @see {@link middlewareDecoding} for intercepting or replacing the full decoding pipeline
|
|
2625
2717
|
*
|
|
2718
|
+
* @stability stable
|
|
2626
2719
|
* @category error handling
|
|
2627
2720
|
* @since 4.0.0
|
|
2628
2721
|
*/
|
|
@@ -2638,6 +2731,7 @@ export function catchDecodingWithContext(f) {
|
|
|
2638
2731
|
* succeeds with a fallback value or re-fails with a (possibly different) issue.
|
|
2639
2732
|
*
|
|
2640
2733
|
* @see {@link catchEncodingWithContext} to add service requirements to the handler
|
|
2734
|
+
* @stability stable
|
|
2641
2735
|
* @category error handling
|
|
2642
2736
|
* @since 4.0.0
|
|
2643
2737
|
*/
|
|
@@ -2661,6 +2755,7 @@ export function catchEncoding(f) {
|
|
|
2661
2755
|
* @see {@link catchEncoding} for recovery handlers that do not require services
|
|
2662
2756
|
* @see {@link middlewareEncoding} for intercepting or replacing the full encoding pipeline
|
|
2663
2757
|
*
|
|
2758
|
+
* @stability stable
|
|
2664
2759
|
* @category error handling
|
|
2665
2760
|
* @since 4.0.0
|
|
2666
2761
|
*/
|
|
@@ -2734,6 +2829,7 @@ export const BooleanLiterals = /*#__PURE__*/Literals([...TrueLiterals.literals,
|
|
|
2734
2829
|
* Schema.decodeUnknownSync(Trimmed)(" hello ") // => "hello"
|
|
2735
2830
|
* ```
|
|
2736
2831
|
*
|
|
2832
|
+
* @stability stable
|
|
2737
2833
|
* @category transforming
|
|
2738
2834
|
* @since 4.0.0
|
|
2739
2835
|
*/
|
|
@@ -2770,6 +2866,7 @@ export function encodeTo(to, transformation) {
|
|
|
2770
2866
|
* Schema.encodeSync(UpperFromLower)("hello") // => "HELLO"
|
|
2771
2867
|
* ```
|
|
2772
2868
|
*
|
|
2869
|
+
* @stability stable
|
|
2773
2870
|
* @category transforming
|
|
2774
2871
|
* @since 4.0.0
|
|
2775
2872
|
*/
|
|
@@ -2801,6 +2898,7 @@ export function encode(transformation) {
|
|
|
2801
2898
|
* MySchema.make({}).name // => "anonymous"
|
|
2802
2899
|
* ```
|
|
2803
2900
|
*
|
|
2901
|
+
* @stability stable
|
|
2804
2902
|
* @category constructors
|
|
2805
2903
|
* @since 3.10.0
|
|
2806
2904
|
*/
|
|
@@ -2845,6 +2943,7 @@ function toIssueEffect(self) {
|
|
|
2845
2943
|
*
|
|
2846
2944
|
* @see {@link withDecodingDefault} for the value-level variant (key absent **or** `undefined`)
|
|
2847
2945
|
* @see {@link withDecodingDefaultTypeKey} for the variant where the default is a `Type` value
|
|
2946
|
+
* @stability stable
|
|
2848
2947
|
* @category decoding
|
|
2849
2948
|
* @since 4.0.0
|
|
2850
2949
|
*/
|
|
@@ -2876,6 +2975,7 @@ export function withDecodingDefaultKey(defaultValue, options) {
|
|
|
2876
2975
|
*
|
|
2877
2976
|
* @see {@link withDecodingDefaultKey} for the variant where the default is an `Encoded` value
|
|
2878
2977
|
* @see {@link withDecodingDefaultType} for the value-level variant
|
|
2978
|
+
* @stability stable
|
|
2879
2979
|
* @category decoding
|
|
2880
2980
|
* @since 4.0.0
|
|
2881
2981
|
*/
|
|
@@ -2919,6 +3019,7 @@ export function withDecodingDefaultTypeKey(defaultValue, options) {
|
|
|
2919
3019
|
*
|
|
2920
3020
|
* @see {@link withDecodingDefaultKey} for the key-level variant (key absent only, not `undefined`)
|
|
2921
3021
|
* @see {@link withDecodingDefaultType} for the variant where the default is a `Type` value
|
|
3022
|
+
* @stability stable
|
|
2922
3023
|
* @category decoding
|
|
2923
3024
|
* @since 3.10.0
|
|
2924
3025
|
*/
|
|
@@ -2955,6 +3056,7 @@ export function withDecodingDefault(defaultValue, options) {
|
|
|
2955
3056
|
*
|
|
2956
3057
|
* @see {@link withDecodingDefault} for the variant where the default is an `Encoded` value
|
|
2957
3058
|
* @see {@link withDecodingDefaultTypeKey} for the key-level variant
|
|
3059
|
+
* @stability stable
|
|
2958
3060
|
* @category decoding
|
|
2959
3061
|
* @since 4.0.0
|
|
2960
3062
|
*/
|
|
@@ -2982,6 +3084,7 @@ export function withDecodingDefaultType(defaultValue, options) {
|
|
|
2982
3084
|
*
|
|
2983
3085
|
* @see {@link tagDefaultOmit} to also omit the tag during encoding
|
|
2984
3086
|
* @see {@link TaggedStruct} for a shorthand that adds `_tag` automatically
|
|
3087
|
+
* @stability stable
|
|
2985
3088
|
* @category constructors
|
|
2986
3089
|
* @since 3.10.0
|
|
2987
3090
|
*/
|
|
@@ -3016,6 +3119,7 @@ export function tag(literal) {
|
|
|
3016
3119
|
* ```
|
|
3017
3120
|
*
|
|
3018
3121
|
* @see {@link tag} for the variant that keeps the tag during encoding
|
|
3122
|
+
* @stability stable
|
|
3019
3123
|
* @category constructors
|
|
3020
3124
|
* @since 4.0.0
|
|
3021
3125
|
*/
|
|
@@ -3068,6 +3172,7 @@ export function tagDefaultOmit(literal) {
|
|
|
3068
3172
|
* tagged.fields._tag.schema.literal // => "A"
|
|
3069
3173
|
* ```
|
|
3070
3174
|
*
|
|
3175
|
+
* @stability stable
|
|
3071
3176
|
* @category constructors
|
|
3072
3177
|
* @since 3.10.0
|
|
3073
3178
|
*/
|
|
@@ -3104,6 +3209,7 @@ export function TaggedStruct(value, fields) {
|
|
|
3104
3209
|
* ```
|
|
3105
3210
|
*
|
|
3106
3211
|
* @see {@link TaggedUnion} for a shorthand that builds the union from scratch
|
|
3212
|
+
* @stability stable
|
|
3107
3213
|
* @category combinators
|
|
3108
3214
|
* @since 4.0.0
|
|
3109
3215
|
*/
|
|
@@ -3116,6 +3222,7 @@ export function toTaggedUnion(tag) {
|
|
|
3116
3222
|
const isAnyOf = keys => value => keys.includes(value[tag]);
|
|
3117
3223
|
walk(self);
|
|
3118
3224
|
return Object.assign(self, {
|
|
3225
|
+
tag,
|
|
3119
3226
|
cases,
|
|
3120
3227
|
discriminants,
|
|
3121
3228
|
isAnyOf,
|
|
@@ -3182,7 +3289,7 @@ export function toTaggedUnion(tag) {
|
|
|
3182
3289
|
/**
|
|
3183
3290
|
* Builds a discriminated union from a record of field sets, one per variant.
|
|
3184
3291
|
* Each key becomes the `_tag` literal and the value is passed to {@link TaggedStruct}.
|
|
3185
|
-
* The result includes `cases`, `guards`, `isAnyOf`, `match`, and `matchOrElse` utilities.
|
|
3292
|
+
* The result includes `tag`, `cases`, `guards`, `isAnyOf`, `match`, and `matchOrElse` utilities.
|
|
3186
3293
|
*
|
|
3187
3294
|
* **Example** (Pattern matching a discriminated union)
|
|
3188
3295
|
*
|
|
@@ -3203,6 +3310,7 @@ export function toTaggedUnion(tag) {
|
|
|
3203
3310
|
* ```
|
|
3204
3311
|
*
|
|
3205
3312
|
* @see {@link toTaggedUnion} to augment an existing union instead
|
|
3313
|
+
* @stability stable
|
|
3206
3314
|
* @category constructors
|
|
3207
3315
|
* @since 4.0.0
|
|
3208
3316
|
*/
|
|
@@ -3216,12 +3324,14 @@ export function TaggedUnion(casesByTag) {
|
|
|
3216
3324
|
}
|
|
3217
3325
|
const union = Union(members);
|
|
3218
3326
|
const {
|
|
3327
|
+
tag,
|
|
3219
3328
|
guards,
|
|
3220
3329
|
isAnyOf,
|
|
3221
3330
|
match,
|
|
3222
3331
|
matchOrElse
|
|
3223
3332
|
} = toTaggedUnion("_tag")(union);
|
|
3224
3333
|
return make(union.ast, {
|
|
3334
|
+
tag,
|
|
3225
3335
|
cases,
|
|
3226
3336
|
isAnyOf,
|
|
3227
3337
|
guards,
|
|
@@ -3250,6 +3360,7 @@ export function TaggedUnion(casesByTag) {
|
|
|
3250
3360
|
* person.name // => "Alice"
|
|
3251
3361
|
* ```
|
|
3252
3362
|
*
|
|
3363
|
+
* @stability stable
|
|
3253
3364
|
* @category constructors
|
|
3254
3365
|
* @since 4.0.0
|
|
3255
3366
|
*/
|
|
@@ -3271,6 +3382,7 @@ export function Opaque() {
|
|
|
3271
3382
|
* decoded.toISOString() // => "2024-01-01T00:00:00.000Z"
|
|
3272
3383
|
* ```
|
|
3273
3384
|
*
|
|
3385
|
+
* @stability stable
|
|
3274
3386
|
* @category constructors
|
|
3275
3387
|
* @since 3.10.0
|
|
3276
3388
|
*/
|
|
@@ -3281,6 +3393,7 @@ export function instanceOf(constructor, annotations) {
|
|
|
3281
3393
|
* Constructs an `SchemaAST.Link` that describes how a value of type `T` encodes to and decodes from a `To` schema.
|
|
3282
3394
|
* Used when building low-level AST transformations that bridge two schema types.
|
|
3283
3395
|
*
|
|
3396
|
+
* @stability stable
|
|
3284
3397
|
* @category transforming
|
|
3285
3398
|
* @since 4.0.0
|
|
3286
3399
|
*/
|
|
@@ -3344,6 +3457,7 @@ export function link() {
|
|
|
3344
3457
|
* }
|
|
3345
3458
|
* ```
|
|
3346
3459
|
*
|
|
3460
|
+
* @stability stable
|
|
3347
3461
|
* @category constructors
|
|
3348
3462
|
* @since 4.0.0
|
|
3349
3463
|
*/
|
|
@@ -3352,6 +3466,7 @@ export const makeFilter = SchemaAST.makeFilter;
|
|
|
3352
3466
|
* Groups multiple checks into a single {@link SchemaAST.FilterGroup}, applying
|
|
3353
3467
|
* optional shared annotations to the group as a whole.
|
|
3354
3468
|
*
|
|
3469
|
+
* @stability stable
|
|
3355
3470
|
* @category constructors
|
|
3356
3471
|
* @since 4.0.0
|
|
3357
3472
|
*/
|
|
@@ -3374,6 +3489,7 @@ const TRIMMED_PATTERN = "^\\S[\\s\\S]*\\S$|^\\S$|^$";
|
|
|
3374
3489
|
* During arbitrary generation, this applies a `patterns`
|
|
3375
3490
|
* constraint to ensure generated strings match the trimmed pattern.
|
|
3376
3491
|
*
|
|
3492
|
+
* @stability stable
|
|
3377
3493
|
* @category validation
|
|
3378
3494
|
* @since 4.0.0
|
|
3379
3495
|
*/
|
|
@@ -3416,6 +3532,7 @@ export function isTrimmed(annotations) {
|
|
|
3416
3532
|
* During arbitrary generation, this applies a `patterns`
|
|
3417
3533
|
* constraint to ensure generated strings match the specified RegExp pattern.
|
|
3418
3534
|
*
|
|
3535
|
+
* @stability stable
|
|
3419
3536
|
* @category validation
|
|
3420
3537
|
* @since 4.0.0
|
|
3421
3538
|
*/
|
|
@@ -3449,6 +3566,7 @@ export function isPattern(regExp, annotations) {
|
|
|
3449
3566
|
* During arbitrary generation, this applies a `patterns`
|
|
3450
3567
|
* constraint to ensure generated strings match the number string pattern.
|
|
3451
3568
|
*
|
|
3569
|
+
* @stability stable
|
|
3452
3570
|
* @category validation
|
|
3453
3571
|
* @since 4.0.0
|
|
3454
3572
|
*/
|
|
@@ -3474,6 +3592,7 @@ export function isStringFinite(annotations) {
|
|
|
3474
3592
|
* This check corresponds to a `pattern` constraint with the same signed
|
|
3475
3593
|
* base-10 integer pattern.
|
|
3476
3594
|
*
|
|
3595
|
+
* @stability stable
|
|
3477
3596
|
* @category validation
|
|
3478
3597
|
* @since 4.0.0
|
|
3479
3598
|
*/
|
|
@@ -3494,6 +3613,7 @@ export function isStringBigInt(annotations) {
|
|
|
3494
3613
|
* The check uses the pattern `^Symbol\((.*)\)$`. It is not a general test for
|
|
3495
3614
|
* whether a string can be passed to JavaScript's `Symbol()` function.
|
|
3496
3615
|
*
|
|
3616
|
+
* @stability stable
|
|
3497
3617
|
* @category validation
|
|
3498
3618
|
* @since 4.0.0
|
|
3499
3619
|
*/
|
|
@@ -3538,6 +3658,7 @@ const getUUIDRegExp = version => {
|
|
|
3538
3658
|
* constraint to ensure generated strings match the UUID pattern.
|
|
3539
3659
|
*
|
|
3540
3660
|
* @see {@link isGUID} for shape-only GUID validation.
|
|
3661
|
+
* @stability stable
|
|
3541
3662
|
* @category validation
|
|
3542
3663
|
* @since 4.0.0
|
|
3543
3664
|
*/
|
|
@@ -3583,6 +3704,7 @@ const GUID_REGEXP = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{
|
|
|
3583
3704
|
* constraint to ensure generated strings match the GUID pattern.
|
|
3584
3705
|
*
|
|
3585
3706
|
* @see {@link isUUID} for strict UUID validation.
|
|
3707
|
+
* @stability stable
|
|
3586
3708
|
* @category validation
|
|
3587
3709
|
* @since 4.0.0
|
|
3588
3710
|
*/
|
|
@@ -3618,6 +3740,7 @@ export function isGUID(annotations) {
|
|
|
3618
3740
|
* During arbitrary generation, this applies a `patterns`
|
|
3619
3741
|
* constraint to ensure generated strings match the ULID pattern.
|
|
3620
3742
|
*
|
|
3743
|
+
* @stability stable
|
|
3621
3744
|
* @category validation
|
|
3622
3745
|
* @since 4.0.0
|
|
3623
3746
|
*/
|
|
@@ -3652,6 +3775,7 @@ export function isULID(annotations) {
|
|
|
3652
3775
|
* During arbitrary generation, this applies a `patterns`
|
|
3653
3776
|
* constraint to ensure generated strings match the Base64 pattern.
|
|
3654
3777
|
*
|
|
3778
|
+
* @stability stable
|
|
3655
3779
|
* @category validation
|
|
3656
3780
|
* @since 4.0.0
|
|
3657
3781
|
*/
|
|
@@ -3688,6 +3812,7 @@ export function isBase64(annotations) {
|
|
|
3688
3812
|
* During arbitrary generation, this applies a `patterns`
|
|
3689
3813
|
* constraint to ensure generated strings match the Base64URL pattern.
|
|
3690
3814
|
*
|
|
3815
|
+
* @stability stable
|
|
3691
3816
|
* @category validation
|
|
3692
3817
|
* @since 4.0.0
|
|
3693
3818
|
*/
|
|
@@ -3724,6 +3849,7 @@ function literalToJsonSchema(literal, original, pattern) {
|
|
|
3724
3849
|
* metadata. If the prefix ends with a high surrogate, the JSON Schema pattern
|
|
3725
3850
|
* omits that code unit so Unicode matching cannot reject a valid string.
|
|
3726
3851
|
*
|
|
3852
|
+
* @stability stable
|
|
3727
3853
|
* @category validation
|
|
3728
3854
|
* @since 4.0.0
|
|
3729
3855
|
*/
|
|
@@ -3761,6 +3887,7 @@ export function isStartingWith(startsWith, annotations) {
|
|
|
3761
3887
|
* metadata. If the suffix begins with a low surrogate, the JSON Schema pattern
|
|
3762
3888
|
* omits that code unit so Unicode matching cannot reject a valid string.
|
|
3763
3889
|
*
|
|
3890
|
+
* @stability stable
|
|
3764
3891
|
* @category validation
|
|
3765
3892
|
* @since 4.0.0
|
|
3766
3893
|
*/
|
|
@@ -3799,6 +3926,7 @@ export function isEndingWith(endsWith, annotations) {
|
|
|
3799
3926
|
* omitted from the JSON Schema pattern so Unicode matching cannot reject a
|
|
3800
3927
|
* valid string.
|
|
3801
3928
|
*
|
|
3929
|
+
* @stability stable
|
|
3802
3930
|
* @category validation
|
|
3803
3931
|
* @since 4.0.0
|
|
3804
3932
|
*/
|
|
@@ -3837,6 +3965,7 @@ const UPPERCASED_PATTERN = "^[^a-z]*$";
|
|
|
3837
3965
|
* such as digits, punctuation, and whitespace. It rejects strings that would
|
|
3838
3966
|
* change when uppercased.
|
|
3839
3967
|
*
|
|
3968
|
+
* @stability stable
|
|
3840
3969
|
* @category validation
|
|
3841
3970
|
* @since 4.0.0
|
|
3842
3971
|
*/
|
|
@@ -3873,6 +4002,7 @@ const LOWERCASED_PATTERN = "^[^A-Z]*$";
|
|
|
3873
4002
|
* such as digits, punctuation, and whitespace. It rejects strings that would
|
|
3874
4003
|
* change when lowercased.
|
|
3875
4004
|
*
|
|
4005
|
+
* @stability stable
|
|
3876
4006
|
* @category validation
|
|
3877
4007
|
* @since 4.0.0
|
|
3878
4008
|
*/
|
|
@@ -3909,6 +4039,7 @@ const CAPITALIZED_PATTERN = "^(?:[^a-z][\\s\\S]*)?$";
|
|
|
3909
4039
|
* Empty strings pass. Strings whose first character has no lowercase form, such
|
|
3910
4040
|
* as a digit, punctuation mark, or whitespace, also pass.
|
|
3911
4041
|
*
|
|
4042
|
+
* @stability stable
|
|
3912
4043
|
* @category validation
|
|
3913
4044
|
* @since 4.0.0
|
|
3914
4045
|
*/
|
|
@@ -3945,6 +4076,7 @@ const UNCAPITALIZED_PATTERN = "^(?:[^A-Z][\\s\\S]*)?$";
|
|
|
3945
4076
|
* Empty strings pass. Strings whose first character has no uppercase form, such
|
|
3946
4077
|
* as a digit, punctuation mark, or whitespace, also pass.
|
|
3947
4078
|
*
|
|
4079
|
+
* @stability stable
|
|
3948
4080
|
* @category validation
|
|
3949
4081
|
* @since 4.0.0
|
|
3950
4082
|
*/
|
|
@@ -3974,6 +4106,7 @@ export function isUncapitalized(annotations) {
|
|
|
3974
4106
|
/**
|
|
3975
4107
|
* Schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
3976
4108
|
*
|
|
4109
|
+
* @stability stable
|
|
3977
4110
|
* @category schemas
|
|
3978
4111
|
* @since 3.10.0
|
|
3979
4112
|
*/
|
|
@@ -3992,6 +4125,7 @@ export const Finite = /*#__PURE__*/make(SchemaAST.finite);
|
|
|
3992
4125
|
*
|
|
3993
4126
|
* During arbitrary generation, this applies a finite-number constraint.
|
|
3994
4127
|
*
|
|
4128
|
+
* @stability stable
|
|
3995
4129
|
* @category validation
|
|
3996
4130
|
* @since 4.0.0
|
|
3997
4131
|
*/
|
|
@@ -4000,6 +4134,7 @@ export const isFinite = SchemaAST.isFinite;
|
|
|
4000
4134
|
* Creates a greater-than (`>`) check for any ordered type from an
|
|
4001
4135
|
* `Order.Order` instance.
|
|
4002
4136
|
*
|
|
4137
|
+
* @stability stable
|
|
4003
4138
|
* @category validation
|
|
4004
4139
|
* @since 4.0.0
|
|
4005
4140
|
*/
|
|
@@ -4023,6 +4158,7 @@ export function makeIsGreaterThan(options) {
|
|
|
4023
4158
|
* Creates a greater-than-or-equal-to (`>=`) check for any ordered type from an
|
|
4024
4159
|
* `Order.Order` instance.
|
|
4025
4160
|
*
|
|
4161
|
+
* @stability stable
|
|
4026
4162
|
* @category validation
|
|
4027
4163
|
* @since 4.0.0
|
|
4028
4164
|
*/
|
|
@@ -4045,6 +4181,7 @@ export function makeIsGreaterThanOrEqualTo(options) {
|
|
|
4045
4181
|
* Creates a less-than (`<`) check for any ordered type from an `Order.Order`
|
|
4046
4182
|
* instance.
|
|
4047
4183
|
*
|
|
4184
|
+
* @stability stable
|
|
4048
4185
|
* @category validation
|
|
4049
4186
|
* @since 4.0.0
|
|
4050
4187
|
*/
|
|
@@ -4068,6 +4205,7 @@ export function makeIsLessThan(options) {
|
|
|
4068
4205
|
* Creates a less-than-or-equal-to (`<=`) check for any ordered type from an
|
|
4069
4206
|
* `Order.Order` instance.
|
|
4070
4207
|
*
|
|
4208
|
+
* @stability stable
|
|
4071
4209
|
* @category validation
|
|
4072
4210
|
* @since 4.0.0
|
|
4073
4211
|
*/
|
|
@@ -4090,6 +4228,7 @@ export function makeIsLessThanOrEqualTo(options) {
|
|
|
4090
4228
|
* Creates an inclusive or exclusive range check for any ordered type from an
|
|
4091
4229
|
* `Order.Order` instance.
|
|
4092
4230
|
*
|
|
4231
|
+
* @stability stable
|
|
4093
4232
|
* @category validation
|
|
4094
4233
|
* @since 4.0.0
|
|
4095
4234
|
*/
|
|
@@ -4124,6 +4263,7 @@ export function makeIsBetween(deriveOptions) {
|
|
|
4124
4263
|
* Creates a divisibility check for any numeric type from a remainder function
|
|
4125
4264
|
* and a zero value.
|
|
4126
4265
|
*
|
|
4266
|
+
* @stability stable
|
|
4127
4267
|
* @category validation
|
|
4128
4268
|
* @since 4.0.0
|
|
4129
4269
|
*/
|
|
@@ -4158,6 +4298,7 @@ function encodeNumberPayload(number) {
|
|
|
4158
4298
|
* `exclusiveMinimum` constraint to ensure generated numbers are greater than
|
|
4159
4299
|
* the specified value.
|
|
4160
4300
|
*
|
|
4301
|
+
* @stability stable
|
|
4161
4302
|
* @category validation
|
|
4162
4303
|
* @since 4.0.0
|
|
4163
4304
|
*/
|
|
@@ -4193,6 +4334,7 @@ export const isGreaterThan = /*#__PURE__*/makeIsGreaterThan({
|
|
|
4193
4334
|
* During arbitrary generation, this applies a `minimum` constraint
|
|
4194
4335
|
* to ensure generated numbers are greater than or equal to the specified value.
|
|
4195
4336
|
*
|
|
4337
|
+
* @stability stable
|
|
4196
4338
|
* @category validation
|
|
4197
4339
|
* @since 4.0.0
|
|
4198
4340
|
*/
|
|
@@ -4228,6 +4370,7 @@ export const isGreaterThanOrEqualTo = /*#__PURE__*/makeIsGreaterThanOrEqualTo({
|
|
|
4228
4370
|
* `exclusiveMaximum` constraint to ensure generated numbers are less than the
|
|
4229
4371
|
* specified value.
|
|
4230
4372
|
*
|
|
4373
|
+
* @stability stable
|
|
4231
4374
|
* @category validation
|
|
4232
4375
|
* @since 4.0.0
|
|
4233
4376
|
*/
|
|
@@ -4263,6 +4406,7 @@ export const isLessThan = /*#__PURE__*/makeIsLessThan({
|
|
|
4263
4406
|
* During arbitrary generation, this applies a `maximum` constraint
|
|
4264
4407
|
* to ensure generated numbers are less than or equal to the specified value.
|
|
4265
4408
|
*
|
|
4409
|
+
* @stability stable
|
|
4266
4410
|
* @category validation
|
|
4267
4411
|
* @since 4.0.0
|
|
4268
4412
|
*/
|
|
@@ -4301,6 +4445,7 @@ export const isLessThanOrEqualTo = /*#__PURE__*/makeIsLessThanOrEqualTo({
|
|
|
4301
4445
|
* `exclusiveMaximum` flags to ensure generated numbers fall within the
|
|
4302
4446
|
* specified range.
|
|
4303
4447
|
*
|
|
4448
|
+
* @stability stable
|
|
4304
4449
|
* @category validation
|
|
4305
4450
|
* @since 4.0.0
|
|
4306
4451
|
*/
|
|
@@ -4349,6 +4494,7 @@ export const isBetween = /*#__PURE__*/makeIsBetween({
|
|
|
4349
4494
|
*
|
|
4350
4495
|
* Throws a `RangeError` when `divisor` is zero or is not finite.
|
|
4351
4496
|
*
|
|
4497
|
+
* @stability stable
|
|
4352
4498
|
* @category validation
|
|
4353
4499
|
* @since 4.0.0
|
|
4354
4500
|
*/
|
|
@@ -4388,6 +4534,7 @@ export function isMultipleOf(divisor, annotations) {
|
|
|
4388
4534
|
*
|
|
4389
4535
|
* During arbitrary generation, this applies an integer constraint.
|
|
4390
4536
|
*
|
|
4537
|
+
* @stability stable
|
|
4391
4538
|
* @category validation
|
|
4392
4539
|
* @since 4.0.0
|
|
4393
4540
|
*/
|
|
@@ -4413,6 +4560,7 @@ export function isInt(annotations) {
|
|
|
4413
4560
|
/**
|
|
4414
4561
|
* Schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
4415
4562
|
*
|
|
4563
|
+
* @stability stable
|
|
4416
4564
|
* @category schemas
|
|
4417
4565
|
* @since 3.10.0
|
|
4418
4566
|
*/
|
|
@@ -4426,6 +4574,7 @@ export const Int = /*#__PURE__*/Number.check(/*#__PURE__*/isInt());
|
|
|
4426
4574
|
*
|
|
4427
4575
|
* @see {@link Int} for safe integers that may be negative
|
|
4428
4576
|
*
|
|
4577
|
+
* @stability stable
|
|
4429
4578
|
* @category schemas
|
|
4430
4579
|
* @since 4.0.0
|
|
4431
4580
|
*/
|
|
@@ -4446,6 +4595,7 @@ export const Natural = /*#__PURE__*/Int.check(/*#__PURE__*/isGreaterThanOrEqualT
|
|
|
4446
4595
|
* During arbitrary generation, this applies integer and range
|
|
4447
4596
|
* constraints to ensure generated numbers are 32-bit signed integers.
|
|
4448
4597
|
*
|
|
4598
|
+
* @stability stable
|
|
4449
4599
|
* @category validation
|
|
4450
4600
|
* @since 4.0.0
|
|
4451
4601
|
*/
|
|
@@ -4474,6 +4624,7 @@ export function isInt32(annotations) {
|
|
|
4474
4624
|
* During arbitrary generation, this applies integer and range
|
|
4475
4625
|
* constraints to ensure generated numbers are 32-bit unsigned integers.
|
|
4476
4626
|
*
|
|
4627
|
+
* @stability stable
|
|
4477
4628
|
* @category validation
|
|
4478
4629
|
* @since 4.0.0
|
|
4479
4630
|
*/
|
|
@@ -4504,6 +4655,7 @@ function formatDateRuntime(date) {
|
|
|
4504
4655
|
*
|
|
4505
4656
|
* During arbitrary generation, this applies an exclusive lower bound.
|
|
4506
4657
|
*
|
|
4658
|
+
* @stability stable
|
|
4507
4659
|
* @category validation
|
|
4508
4660
|
* @since 4.0.0
|
|
4509
4661
|
*/
|
|
@@ -4540,6 +4692,7 @@ export const isGreaterThanDate = /*#__PURE__*/makeIsGreaterThan({
|
|
|
4540
4692
|
*
|
|
4541
4693
|
* During arbitrary generation, this applies an inclusive lower bound.
|
|
4542
4694
|
*
|
|
4695
|
+
* @stability stable
|
|
4543
4696
|
* @category validation
|
|
4544
4697
|
* @since 4.0.0
|
|
4545
4698
|
*/
|
|
@@ -4570,6 +4723,7 @@ export const isGreaterThanOrEqualToDate = /*#__PURE__*/makeIsGreaterThanOrEqualT
|
|
|
4570
4723
|
*
|
|
4571
4724
|
* During arbitrary generation, this applies an exclusive upper bound.
|
|
4572
4725
|
*
|
|
4726
|
+
* @stability stable
|
|
4573
4727
|
* @category validation
|
|
4574
4728
|
* @since 4.0.0
|
|
4575
4729
|
*/
|
|
@@ -4606,6 +4760,7 @@ export const isLessThanDate = /*#__PURE__*/makeIsLessThan({
|
|
|
4606
4760
|
*
|
|
4607
4761
|
* During arbitrary generation, this applies an inclusive upper bound.
|
|
4608
4762
|
*
|
|
4763
|
+
* @stability stable
|
|
4609
4764
|
* @category validation
|
|
4610
4765
|
* @since 4.0.0
|
|
4611
4766
|
*/
|
|
@@ -4642,6 +4797,7 @@ export const isLessThanOrEqualToDate = /*#__PURE__*/makeIsLessThanOrEqualTo({
|
|
|
4642
4797
|
*
|
|
4643
4798
|
* During arbitrary generation, this applies the specified lower and upper bounds.
|
|
4644
4799
|
*
|
|
4800
|
+
* @stability stable
|
|
4645
4801
|
* @category validation
|
|
4646
4802
|
* @since 4.0.0
|
|
4647
4803
|
*/
|
|
@@ -4681,6 +4837,7 @@ export const isBetweenDate = /*#__PURE__*/makeIsBetween({
|
|
|
4681
4837
|
*
|
|
4682
4838
|
* During arbitrary generation, this applies an exclusive lower bound.
|
|
4683
4839
|
*
|
|
4840
|
+
* @stability stable
|
|
4684
4841
|
* @category validation
|
|
4685
4842
|
* @since 4.0.0
|
|
4686
4843
|
*/
|
|
@@ -4712,6 +4869,7 @@ export const isGreaterThanBigInt = /*#__PURE__*/makeIsGreaterThan({
|
|
|
4712
4869
|
*
|
|
4713
4870
|
* During arbitrary generation, this applies an inclusive lower bound.
|
|
4714
4871
|
*
|
|
4872
|
+
* @stability stable
|
|
4715
4873
|
* @category validation
|
|
4716
4874
|
* @since 4.0.0
|
|
4717
4875
|
*/
|
|
@@ -4742,6 +4900,7 @@ export const isGreaterThanOrEqualToBigInt = /*#__PURE__*/makeIsGreaterThanOrEqua
|
|
|
4742
4900
|
*
|
|
4743
4901
|
* During arbitrary generation, this applies an exclusive upper bound.
|
|
4744
4902
|
*
|
|
4903
|
+
* @stability stable
|
|
4745
4904
|
* @category validation
|
|
4746
4905
|
* @since 4.0.0
|
|
4747
4906
|
*/
|
|
@@ -4773,6 +4932,7 @@ export const isLessThanBigInt = /*#__PURE__*/makeIsLessThan({
|
|
|
4773
4932
|
*
|
|
4774
4933
|
* During arbitrary generation, this applies an inclusive upper bound.
|
|
4775
4934
|
*
|
|
4935
|
+
* @stability stable
|
|
4776
4936
|
* @category validation
|
|
4777
4937
|
* @since 4.0.0
|
|
4778
4938
|
*/
|
|
@@ -4804,6 +4964,7 @@ export const isLessThanOrEqualToBigInt = /*#__PURE__*/makeIsLessThanOrEqualTo({
|
|
|
4804
4964
|
*
|
|
4805
4965
|
* During arbitrary generation, this applies the specified lower and upper bounds.
|
|
4806
4966
|
*
|
|
4967
|
+
* @stability stable
|
|
4807
4968
|
* @category validation
|
|
4808
4969
|
* @since 4.0.0
|
|
4809
4970
|
*/
|
|
@@ -4865,6 +5026,7 @@ export const isBetweenBigInt = /*#__PURE__*/makeIsBetween({
|
|
|
4865
5026
|
* Schema.is(NonEmptyArraySchema)([1]) // => true
|
|
4866
5027
|
* ```
|
|
4867
5028
|
*
|
|
5029
|
+
* @stability stable
|
|
4868
5030
|
* @category validation
|
|
4869
5031
|
* @since 4.0.0
|
|
4870
5032
|
*/
|
|
@@ -4919,6 +5081,7 @@ function makeIsMinLength(minLength, minCodePoints, annotations) {
|
|
|
4919
5081
|
* During arbitrary generation, this applies a `minLength: 1`
|
|
4920
5082
|
* constraint to ensure generated strings or arrays are non-empty.
|
|
4921
5083
|
*
|
|
5084
|
+
* @stability stable
|
|
4922
5085
|
* @category validation
|
|
4923
5086
|
* @since 4.0.0
|
|
4924
5087
|
*/
|
|
@@ -4944,6 +5107,7 @@ export function isNonEmpty(annotations) {
|
|
|
4944
5107
|
* constraint to ensure generated strings or arrays have at most the required
|
|
4945
5108
|
* length.
|
|
4946
5109
|
*
|
|
5110
|
+
* @stability stable
|
|
4947
5111
|
* @category validation
|
|
4948
5112
|
* @since 4.0.0
|
|
4949
5113
|
*/
|
|
@@ -4999,6 +5163,7 @@ export function isMaxLength(maxLength, annotations) {
|
|
|
4999
5163
|
* `maxLength` constraints to ensure generated strings or arrays have a length
|
|
5000
5164
|
* within the specified range.
|
|
5001
5165
|
*
|
|
5166
|
+
* @stability stable
|
|
5002
5167
|
* @category validation
|
|
5003
5168
|
* @since 4.0.0
|
|
5004
5169
|
*/
|
|
@@ -5060,6 +5225,7 @@ export function isBetweenLength(minimum, maximum, annotations) {
|
|
|
5060
5225
|
* @see {@link isMinLength} for counting UTF-16 code units
|
|
5061
5226
|
* @see {@link isMaxCodePoints}
|
|
5062
5227
|
* @see {@link isBetweenCodePoints}
|
|
5228
|
+
* @stability stable
|
|
5063
5229
|
* @category validation
|
|
5064
5230
|
* @since 4.0.0
|
|
5065
5231
|
*/
|
|
@@ -5103,6 +5269,7 @@ export function isMinCodePoints(minCodePoints, annotations) {
|
|
|
5103
5269
|
* @see {@link isMaxLength} for counting UTF-16 code units
|
|
5104
5270
|
* @see {@link isMinCodePoints}
|
|
5105
5271
|
* @see {@link isBetweenCodePoints}
|
|
5272
|
+
* @stability stable
|
|
5106
5273
|
* @category validation
|
|
5107
5274
|
* @since 4.0.0
|
|
5108
5275
|
*/
|
|
@@ -5146,6 +5313,7 @@ export function isMaxCodePoints(maxCodePoints, annotations) {
|
|
|
5146
5313
|
* @see {@link isBetweenLength} for counting UTF-16 code units
|
|
5147
5314
|
* @see {@link isMinCodePoints}
|
|
5148
5315
|
* @see {@link isMaxCodePoints}
|
|
5316
|
+
* @stability stable
|
|
5149
5317
|
* @category validation
|
|
5150
5318
|
* @since 4.0.0
|
|
5151
5319
|
*/
|
|
@@ -5212,6 +5380,7 @@ function normalizeCardinality(value) {
|
|
|
5212
5380
|
*
|
|
5213
5381
|
* During arbitrary generation, this applies a node-local `minSize` constraint.
|
|
5214
5382
|
*
|
|
5383
|
+
* @stability stable
|
|
5215
5384
|
* @category validation
|
|
5216
5385
|
* @since 4.0.0
|
|
5217
5386
|
*/
|
|
@@ -5253,6 +5422,7 @@ export function isMinSize(minSize, annotations) {
|
|
|
5253
5422
|
*
|
|
5254
5423
|
* During arbitrary generation, this applies a node-local `maxSize` constraint.
|
|
5255
5424
|
*
|
|
5425
|
+
* @stability stable
|
|
5256
5426
|
* @category validation
|
|
5257
5427
|
* @since 4.0.0
|
|
5258
5428
|
*/
|
|
@@ -5294,6 +5464,7 @@ export function isMaxSize(maxSize, annotations) {
|
|
|
5294
5464
|
*
|
|
5295
5465
|
* During arbitrary generation, this applies node-local `minSize` and `maxSize` constraints.
|
|
5296
5466
|
*
|
|
5467
|
+
* @stability stable
|
|
5297
5468
|
* @category validation
|
|
5298
5469
|
* @since 4.0.0
|
|
5299
5470
|
*/
|
|
@@ -5341,6 +5512,7 @@ export function isBetweenSize(minimum, maximum, annotations) {
|
|
|
5341
5512
|
*
|
|
5342
5513
|
* During arbitrary generation, this applies a node-local `minProperties` constraint.
|
|
5343
5514
|
*
|
|
5515
|
+
* @stability stable
|
|
5344
5516
|
* @category validation
|
|
5345
5517
|
* @since 4.0.0
|
|
5346
5518
|
*/
|
|
@@ -5390,6 +5562,7 @@ export function isMinProperties(minProperties, annotations) {
|
|
|
5390
5562
|
*
|
|
5391
5563
|
* During arbitrary generation, this applies a node-local `maxProperties` constraint.
|
|
5392
5564
|
*
|
|
5565
|
+
* @stability stable
|
|
5393
5566
|
* @category validation
|
|
5394
5567
|
* @since 4.0.0
|
|
5395
5568
|
*/
|
|
@@ -5439,6 +5612,7 @@ export function isMaxProperties(maxProperties, annotations) {
|
|
|
5439
5612
|
*
|
|
5440
5613
|
* During arbitrary generation, this applies node-local `minProperties` and `maxProperties` constraints.
|
|
5441
5614
|
*
|
|
5615
|
+
* @stability stable
|
|
5442
5616
|
* @category validation
|
|
5443
5617
|
* @since 4.0.0
|
|
5444
5618
|
*/
|
|
@@ -5489,6 +5663,7 @@ export function isBetweenProperties(minimum, maximum, annotations) {
|
|
|
5489
5663
|
* names in the original input. Property transformations and excess-property
|
|
5490
5664
|
* handling can therefore produce different results.
|
|
5491
5665
|
*
|
|
5666
|
+
* @stability stable
|
|
5492
5667
|
* @category validation
|
|
5493
5668
|
* @since 4.0.0
|
|
5494
5669
|
*/
|
|
@@ -5545,6 +5720,7 @@ export function isPropertyNames(keySchema, annotations) {
|
|
|
5545
5720
|
* During arbitrary generation, this applies a node-local identity selector
|
|
5546
5721
|
* for constructive uniqueness using Effect equality.
|
|
5547
5722
|
*
|
|
5723
|
+
* @stability stable
|
|
5548
5724
|
* @category validation
|
|
5549
5725
|
* @since 4.0.0
|
|
5550
5726
|
*/
|
|
@@ -5579,6 +5755,7 @@ export function isUnique(annotations) {
|
|
|
5579
5755
|
* JSON Schema has no equivalent constraint, so this check is omitted from generated documents.
|
|
5580
5756
|
*
|
|
5581
5757
|
* @see {@link isUnique} for validating uniqueness of complete array elements
|
|
5758
|
+
* @stability stable
|
|
5582
5759
|
* @category validation
|
|
5583
5760
|
* @since 4.0.0
|
|
5584
5761
|
*/
|
|
@@ -5602,6 +5779,7 @@ export function isUniqueKey(annotations) {
|
|
|
5602
5779
|
* Schema for non-empty strings. Validates that a string has at least one
|
|
5603
5780
|
* character.
|
|
5604
5781
|
*
|
|
5782
|
+
* @stability stable
|
|
5605
5783
|
* @category schemas
|
|
5606
5784
|
* @since 3.10.0
|
|
5607
5785
|
*/
|
|
@@ -5622,6 +5800,7 @@ export const NonEmptyString = /*#__PURE__*/String.check(/*#__PURE__*/isNonEmpty(
|
|
|
5622
5800
|
* @see {@link NonEmptyString} for strings with length greater than zero
|
|
5623
5801
|
* @see {@link isBetweenLength} for the underlying length check
|
|
5624
5802
|
*
|
|
5803
|
+
* @stability stable
|
|
5625
5804
|
* @category schemas
|
|
5626
5805
|
* @since 3.10.0
|
|
5627
5806
|
*/
|
|
@@ -5659,6 +5838,7 @@ const errorSchemaCache = [];
|
|
|
5659
5838
|
* traces are omitted by default for security. Pass `{ includeStack: true }` to
|
|
5660
5839
|
* include stack traces, or `{ excludeCause: true }` to omit causes.
|
|
5661
5840
|
*
|
|
5841
|
+
* @stability stable
|
|
5662
5842
|
* @category schemas
|
|
5663
5843
|
* @since 4.0.0
|
|
5664
5844
|
*/
|
|
@@ -5723,6 +5903,7 @@ const defectSchemaCache = [];
|
|
|
5723
5903
|
* string representation.
|
|
5724
5904
|
*
|
|
5725
5905
|
* @see {@link ErrorInstance} for a schema that only accepts JavaScript `Error` values.
|
|
5906
|
+
* @stability stable
|
|
5726
5907
|
* @category schemas
|
|
5727
5908
|
* @since 4.0.0
|
|
5728
5909
|
*/
|
|
@@ -5740,6 +5921,7 @@ export function Defect(options) {
|
|
|
5740
5921
|
* Schema for readonly maps whose keys and values conform to the provided
|
|
5741
5922
|
* schemas.
|
|
5742
5923
|
*
|
|
5924
|
+
* @stability stable
|
|
5743
5925
|
* @category schemas
|
|
5744
5926
|
* @since 3.10.0
|
|
5745
5927
|
*/
|
|
@@ -5780,6 +5962,7 @@ export function ReadonlyMap(key, value) {
|
|
|
5780
5962
|
/**
|
|
5781
5963
|
* Schema for readonly sets whose values conform to the provided element schema.
|
|
5782
5964
|
*
|
|
5965
|
+
* @stability stable
|
|
5783
5966
|
* @category schemas
|
|
5784
5967
|
* @since 3.10.0
|
|
5785
5968
|
*/
|
|
@@ -5823,6 +6006,7 @@ export function ReadonlySet(value) {
|
|
|
5823
6006
|
*
|
|
5824
6007
|
* The default JSON serializer encodes a `RegExp` as `{ source, flags }`.
|
|
5825
6008
|
*
|
|
6009
|
+
* @stability stable
|
|
5826
6010
|
* @category schemas
|
|
5827
6011
|
* @since 4.0.0
|
|
5828
6012
|
*/
|
|
@@ -5864,6 +6048,7 @@ const URLString = /*#__PURE__*/String.annotate({
|
|
|
5864
6048
|
*
|
|
5865
6049
|
* - encodes `URL` as a `string`
|
|
5866
6050
|
*
|
|
6051
|
+
* @stability stable
|
|
5867
6052
|
* @category schemas
|
|
5868
6053
|
* @since 4.0.0
|
|
5869
6054
|
*/
|
|
@@ -5890,6 +6075,7 @@ export const URL = /*#__PURE__*/instanceOf(globalThis.URL, {
|
|
|
5890
6075
|
* Encoding:
|
|
5891
6076
|
* - A `URL` is encoded as a `string`
|
|
5892
6077
|
*
|
|
6078
|
+
* @stability stable
|
|
5893
6079
|
* @category schemas
|
|
5894
6080
|
* @since 4.0.0
|
|
5895
6081
|
*/
|
|
@@ -5922,6 +6108,7 @@ const DateString = /*#__PURE__*/String.annotate({
|
|
|
5922
6108
|
* @see {@link DateFromString} for decoding strings into Date instances
|
|
5923
6109
|
* @see {@link DateFromMillis} for decoding epoch milliseconds into Date instances
|
|
5924
6110
|
*
|
|
6111
|
+
* @stability stable
|
|
5925
6112
|
* @category schemas
|
|
5926
6113
|
* @since 4.0.0
|
|
5927
6114
|
*/
|
|
@@ -5959,6 +6146,7 @@ export const Date = /*#__PURE__*/declare(input => input instanceof globalThis.Da
|
|
|
5959
6146
|
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
5960
6147
|
* @see {@link Date} for accepting Date instances directly
|
|
5961
6148
|
*
|
|
6149
|
+
* @stability stable
|
|
5962
6150
|
* @category schemas
|
|
5963
6151
|
* @since 3.10.0
|
|
5964
6152
|
*/
|
|
@@ -5988,6 +6176,7 @@ export const DateFromString = /*#__PURE__*/DateString.pipe(/*#__PURE__*/decodeTo
|
|
|
5988
6176
|
* @see {@link DateFromString} for decoding string-encoded dates
|
|
5989
6177
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
5990
6178
|
*
|
|
6179
|
+
* @stability stable
|
|
5991
6180
|
* @category schemas
|
|
5992
6181
|
* @since 4.0.0
|
|
5993
6182
|
*/
|
|
@@ -6022,6 +6211,7 @@ const JsonString = /*#__PURE__*/String.annotate({
|
|
|
6022
6211
|
* Schema.encodeSync(schemaFromJsonString)({ a: 1 }) // => "{\n \"a\": 1\n}"
|
|
6023
6212
|
* ```
|
|
6024
6213
|
*
|
|
6214
|
+
* @stability stable
|
|
6025
6215
|
* @category schemas
|
|
6026
6216
|
* @since 4.0.0
|
|
6027
6217
|
*/
|
|
@@ -6038,6 +6228,7 @@ export const UnknownFromJsonString = /*#__PURE__*/fromJsonString(Unknown);
|
|
|
6038
6228
|
* The default JSON serializer encodes a `File` as `{ data, type, name, lastModified }`
|
|
6039
6229
|
* where `data` is base64-encoded.
|
|
6040
6230
|
*
|
|
6231
|
+
* @stability stable
|
|
6041
6232
|
* @category schemas
|
|
6042
6233
|
* @since 4.0.0
|
|
6043
6234
|
*/
|
|
@@ -6093,6 +6284,7 @@ export const File = /*#__PURE__*/instanceOf(globalThis.File, {
|
|
|
6093
6284
|
* The default JSON serializer encodes a `FormData` as an array of `[key, entry]`
|
|
6094
6285
|
* pairs where each entry is tagged as `"String"` or `"File"`.
|
|
6095
6286
|
*
|
|
6287
|
+
* @stability stable
|
|
6096
6288
|
* @category schemas
|
|
6097
6289
|
* @since 4.0.0
|
|
6098
6290
|
*/
|
|
@@ -6216,6 +6408,7 @@ export const FormData = /*#__PURE__*/instanceOf(globalThis.FormData, {
|
|
|
6216
6408
|
* Schema.decodeUnknownSync(schema)(formData) // => { a: 1 }
|
|
6217
6409
|
* ```
|
|
6218
6410
|
*
|
|
6411
|
+
* @stability stable
|
|
6219
6412
|
* @category decoding
|
|
6220
6413
|
* @since 4.0.0
|
|
6221
6414
|
*/
|
|
@@ -6229,6 +6422,7 @@ export function fromFormData(schema) {
|
|
|
6229
6422
|
*
|
|
6230
6423
|
* The default JSON serializer encodes a `URLSearchParams` as a query string.
|
|
6231
6424
|
*
|
|
6425
|
+
* @stability stable
|
|
6232
6426
|
* @category schemas
|
|
6233
6427
|
* @since 4.0.0
|
|
6234
6428
|
*/
|
|
@@ -6323,6 +6517,7 @@ export const URLSearchParams = /*#__PURE__*/instanceOf(globalThis.URLSearchParam
|
|
|
6323
6517
|
* Schema.decodeUnknownSync(schema)(urlSearchParams) // => { a: 1 }
|
|
6324
6518
|
* ```
|
|
6325
6519
|
*
|
|
6520
|
+
* @stability stable
|
|
6326
6521
|
* @category decoding
|
|
6327
6522
|
* @since 4.0.0
|
|
6328
6523
|
*/
|
|
@@ -6343,6 +6538,7 @@ export function fromURLSearchParams(schema) {
|
|
|
6343
6538
|
* Encoding:
|
|
6344
6539
|
* A number is encoded as a `string`.
|
|
6345
6540
|
*
|
|
6541
|
+
* @stability stable
|
|
6346
6542
|
* @category schemas
|
|
6347
6543
|
* @since 3.10.0
|
|
6348
6544
|
*/
|
|
@@ -6361,6 +6557,7 @@ export const NumberFromString = /*#__PURE__*/String.annotate({
|
|
|
6361
6557
|
* Encoding:
|
|
6362
6558
|
* - A finite number is encoded as a `string`.
|
|
6363
6559
|
*
|
|
6560
|
+
* @stability stable
|
|
6364
6561
|
* @category schemas
|
|
6365
6562
|
* @since 4.0.0
|
|
6366
6563
|
*/
|
|
@@ -6392,6 +6589,7 @@ export const FiniteFromString = /*#__PURE__*/String.annotate({
|
|
|
6392
6589
|
* @see {@link NumberFromString} for parsing JavaScript number strings, including non-finite values
|
|
6393
6590
|
* @see {@link BigDecimalFromString} for parsing decimal number strings
|
|
6394
6591
|
*
|
|
6592
|
+
* @stability stable
|
|
6395
6593
|
* @category schemas
|
|
6396
6594
|
* @since 4.0.0
|
|
6397
6595
|
*/
|
|
@@ -6399,6 +6597,7 @@ export const BigIntFromString = /*#__PURE__*/make(SchemaAST.bigIntString).pipe(/
|
|
|
6399
6597
|
/**
|
|
6400
6598
|
* Schema for strings that contains no leading or trailing whitespaces.
|
|
6401
6599
|
*
|
|
6600
|
+
* @stability stable
|
|
6402
6601
|
* @category schemas
|
|
6403
6602
|
* @since 3.10.0
|
|
6404
6603
|
*/
|
|
@@ -6414,6 +6613,7 @@ export const Trimmed = /*#__PURE__*/String.check(/*#__PURE__*/isTrimmed());
|
|
|
6414
6613
|
* Encoding:
|
|
6415
6614
|
* - The trimmed string is encoded as is.
|
|
6416
6615
|
*
|
|
6616
|
+
* @stability stable
|
|
6417
6617
|
* @category schemas
|
|
6418
6618
|
* @since 3.10.0
|
|
6419
6619
|
*/
|
|
@@ -6431,6 +6631,7 @@ export const Trim = /*#__PURE__*/String.annotate({
|
|
|
6431
6631
|
* Encoding:
|
|
6432
6632
|
* - A `string` is encoded as a base64-encoded string.
|
|
6433
6633
|
*
|
|
6634
|
+
* @stability stable
|
|
6434
6635
|
* @category schemas
|
|
6435
6636
|
* @since 3.10.0
|
|
6436
6637
|
*/
|
|
@@ -6448,6 +6649,7 @@ export const StringFromBase64 = /*#__PURE__*/String.annotate({
|
|
|
6448
6649
|
* Encoding:
|
|
6449
6650
|
* - A `string` is encoded as a base64 (URL) encoded string.
|
|
6450
6651
|
*
|
|
6652
|
+
* @stability stable
|
|
6451
6653
|
* @category schemas
|
|
6452
6654
|
* @since 3.10.0
|
|
6453
6655
|
*/
|
|
@@ -6465,6 +6667,7 @@ export const StringFromBase64Url = /*#__PURE__*/String.annotate({
|
|
|
6465
6667
|
* Encoding:
|
|
6466
6668
|
* - A `string` is encoded as a hex string.
|
|
6467
6669
|
*
|
|
6670
|
+
* @stability stable
|
|
6468
6671
|
* @category schemas
|
|
6469
6672
|
* @since 3.10.0
|
|
6470
6673
|
*/
|
|
@@ -6500,6 +6703,7 @@ export const StringFromHex = /*#__PURE__*/String.annotate({
|
|
|
6500
6703
|
* Schema.encodeSync(UrlSchema)({ maxItemPerPage: 10, page: 1 }) // => "%7B%22maxItemPerPage%22%3A10%2C%22page%22%3A1%7D"
|
|
6501
6704
|
* ```
|
|
6502
6705
|
*
|
|
6706
|
+
* @stability stable
|
|
6503
6707
|
* @category schemas
|
|
6504
6708
|
* @since 3.12.0
|
|
6505
6709
|
*/
|
|
@@ -6510,6 +6714,7 @@ export const StringFromUriComponent = /*#__PURE__*/String.annotate({
|
|
|
6510
6714
|
* Schema for property keys accepted by Effect schemas: finite `number`,
|
|
6511
6715
|
* `symbol`, or `string`.
|
|
6512
6716
|
*
|
|
6717
|
+
* @stability stable
|
|
6513
6718
|
* @category schemas
|
|
6514
6719
|
* @since 4.0.0
|
|
6515
6720
|
*/
|
|
@@ -6522,6 +6727,7 @@ export const PropertyKey = /*#__PURE__*/Union([Finite, Symbol, String]);
|
|
|
6522
6727
|
* The result contains an `issues` array where each issue has a message and an
|
|
6523
6728
|
* optional path made of property keys or keyed path segments.
|
|
6524
6729
|
*
|
|
6730
|
+
* @stability stable
|
|
6525
6731
|
* @category schemas
|
|
6526
6732
|
* @since 4.0.0
|
|
6527
6733
|
*/
|
|
@@ -6549,6 +6755,7 @@ export const StandardSchemaV1FailureResult = /*#__PURE__*/Struct({
|
|
|
6549
6755
|
* @see {@link Boolean} for validating values that are already booleans
|
|
6550
6756
|
* @see {@link Literals} for keeping bit literals instead of decoding them
|
|
6551
6757
|
*
|
|
6758
|
+
* @stability stable
|
|
6552
6759
|
* @category schemas
|
|
6553
6760
|
* @since 4.0.0
|
|
6554
6761
|
*/
|
|
@@ -6570,6 +6777,7 @@ const Base64String = /*#__PURE__*/String.annotate({
|
|
|
6570
6777
|
*
|
|
6571
6778
|
* The default JSON serializer encodes Uint8Array as a Base64 encoded string.
|
|
6572
6779
|
*
|
|
6780
|
+
* @stability stable
|
|
6573
6781
|
* @category schemas
|
|
6574
6782
|
* @since 4.0.0
|
|
6575
6783
|
*/
|
|
@@ -6597,6 +6805,7 @@ export const Uint8Array = /*#__PURE__*/instanceOf(globalThis.Uint8Array, {
|
|
|
6597
6805
|
* Encoding:
|
|
6598
6806
|
* - A `Uint8Array` is encoded as a base64-encoded string.
|
|
6599
6807
|
*
|
|
6808
|
+
* @stability stable
|
|
6600
6809
|
* @category schemas
|
|
6601
6810
|
* @since 3.10.0
|
|
6602
6811
|
*/
|
|
@@ -6613,6 +6822,7 @@ export const Uint8ArrayFromBase64 = /*#__PURE__*/Base64String.pipe(/*#__PURE__*/
|
|
|
6613
6822
|
* Encoding:
|
|
6614
6823
|
* - A `Uint8Array` is encoded as a base64 (URL) encoded string.
|
|
6615
6824
|
*
|
|
6825
|
+
* @stability stable
|
|
6616
6826
|
* @category schemas
|
|
6617
6827
|
* @since 3.10.0
|
|
6618
6828
|
*/
|
|
@@ -6634,6 +6844,7 @@ export const Uint8ArrayFromBase64Url = /*#__PURE__*/String.annotate({
|
|
|
6634
6844
|
* Encoding:
|
|
6635
6845
|
* - A `Uint8Array` is encoded as a hex encoded string.
|
|
6636
6846
|
*
|
|
6847
|
+
* @stability stable
|
|
6637
6848
|
* @category schemas
|
|
6638
6849
|
* @since 3.10.0
|
|
6639
6850
|
*/
|
|
@@ -6658,6 +6869,7 @@ const bigDecimalFromString = /*#__PURE__*/SchemaTransformation.transformEffect({
|
|
|
6658
6869
|
/**
|
|
6659
6870
|
* Validates that a BigDecimal is greater than the specified value (exclusive).
|
|
6660
6871
|
*
|
|
6872
|
+
* @stability stable
|
|
6661
6873
|
* @category validation
|
|
6662
6874
|
* @since 4.0.0
|
|
6663
6875
|
*/
|
|
@@ -6669,6 +6881,7 @@ export const isGreaterThanBigDecimal = /*#__PURE__*/makeIsGreaterThan({
|
|
|
6669
6881
|
* Validates that a BigDecimal is greater than or equal to the specified value
|
|
6670
6882
|
* (inclusive).
|
|
6671
6883
|
*
|
|
6884
|
+
* @stability stable
|
|
6672
6885
|
* @category validation
|
|
6673
6886
|
* @since 4.0.0
|
|
6674
6887
|
*/
|
|
@@ -6679,6 +6892,7 @@ export const isGreaterThanOrEqualToBigDecimal = /*#__PURE__*/makeIsGreaterThanOr
|
|
|
6679
6892
|
/**
|
|
6680
6893
|
* Validates that a BigDecimal is less than the specified value (exclusive).
|
|
6681
6894
|
*
|
|
6895
|
+
* @stability stable
|
|
6682
6896
|
* @category validation
|
|
6683
6897
|
* @since 4.0.0
|
|
6684
6898
|
*/
|
|
@@ -6690,6 +6904,7 @@ export const isLessThanBigDecimal = /*#__PURE__*/makeIsLessThan({
|
|
|
6690
6904
|
* Validates that a BigDecimal is less than or equal to the specified value
|
|
6691
6905
|
* (inclusive).
|
|
6692
6906
|
*
|
|
6907
|
+
* @stability stable
|
|
6693
6908
|
* @category validation
|
|
6694
6909
|
* @since 4.0.0
|
|
6695
6910
|
*/
|
|
@@ -6705,6 +6920,7 @@ export const isLessThanOrEqualToBigDecimal = /*#__PURE__*/makeIsLessThanOrEqualT
|
|
|
6705
6920
|
* The minimum and maximum boundaries are inclusive by default. Pass
|
|
6706
6921
|
* `exclusiveMinimum` or `exclusiveMaximum` to exclude either boundary.
|
|
6707
6922
|
*
|
|
6923
|
+
* @stability stable
|
|
6708
6924
|
* @category validation
|
|
6709
6925
|
* @since 4.0.0
|
|
6710
6926
|
*/
|
|
@@ -6731,6 +6947,7 @@ const BigDecimalString = /*#__PURE__*/String.annotate({
|
|
|
6731
6947
|
*
|
|
6732
6948
|
* @see {@link BigDecimalFromString} for parsing string input into a BigDecimal
|
|
6733
6949
|
*
|
|
6950
|
+
* @stability stable
|
|
6734
6951
|
* @category schemas
|
|
6735
6952
|
* @since 3.10.0
|
|
6736
6953
|
*/
|
|
@@ -6772,6 +6989,7 @@ export const BigDecimal = /*#__PURE__*/declare(BigDecimal_.isBigDecimal, {
|
|
|
6772
6989
|
* @see {@link BigIntFromString} for parsing base-10 integer strings into bigint values
|
|
6773
6990
|
* @see {@link NumberFromString} for parsing JavaScript number strings
|
|
6774
6991
|
*
|
|
6992
|
+
* @stability stable
|
|
6775
6993
|
* @category schemas
|
|
6776
6994
|
* @since 4.0.0
|
|
6777
6995
|
*/
|
|
@@ -6785,6 +7003,7 @@ export const BigDecimalFromString = /*#__PURE__*/BigDecimalString.pipe(/*#__PURE
|
|
|
6785
7003
|
* beyond JavaScript's safe-integer range. The StringTree codec uses the
|
|
6786
7004
|
* human-readable byte-size syntax exposed by {@link ByteSizeFromString}.
|
|
6787
7005
|
*
|
|
7006
|
+
* @stability unstable
|
|
6788
7007
|
* @category schemas
|
|
6789
7008
|
* @since 4.0.0
|
|
6790
7009
|
*/
|
|
@@ -6834,6 +7053,7 @@ const ByteSizeString = /*#__PURE__*/String.annotate({
|
|
|
6834
7053
|
* A unit is required. Signs, exponent notation, digit separators, and ambiguous
|
|
6835
7054
|
* unit spellings such as `KB`, `mb`, `Mb`, or `b` are rejected.
|
|
6836
7055
|
*
|
|
7056
|
+
* @stability unstable
|
|
6837
7057
|
* @category schemas
|
|
6838
7058
|
* @since 4.0.0
|
|
6839
7059
|
*/
|
|
@@ -6841,6 +7061,7 @@ export const ByteSizeFromString = /*#__PURE__*/ByteSizeString.pipe(/*#__PURE__*/
|
|
|
6841
7061
|
/**
|
|
6842
7062
|
* Schema that decodes non-negative bigint byte counts.
|
|
6843
7063
|
*
|
|
7064
|
+
* @stability unstable
|
|
6844
7065
|
* @category schemas
|
|
6845
7066
|
* @since 4.0.0
|
|
6846
7067
|
*/
|
|
@@ -6852,6 +7073,7 @@ export const ByteSizeFromBigInt = /*#__PURE__*/BigInt.pipe(/*#__PURE__*/decodeTo
|
|
|
6852
7073
|
*
|
|
6853
7074
|
* Encoding fails when the byte count exceeds `Number.MAX_SAFE_INTEGER`.
|
|
6854
7075
|
*
|
|
7076
|
+
* @stability unstable
|
|
6855
7077
|
* @category schemas
|
|
6856
7078
|
* @since 4.0.0
|
|
6857
7079
|
*/
|
|
@@ -6873,6 +7095,7 @@ export const ByteSizeFromNumber = /*#__PURE__*/Number.pipe(/*#__PURE__*/decodeTo
|
|
|
6873
7095
|
* @see {@link Cause} for constructing schemas for full Cause values
|
|
6874
7096
|
* @see {@link CauseReasonIso} for the ISO shape of each cause reason
|
|
6875
7097
|
*
|
|
7098
|
+
* @stability stable
|
|
6876
7099
|
* @category schemas
|
|
6877
7100
|
* @since 4.0.0
|
|
6878
7101
|
*/
|
|
@@ -6972,6 +7195,7 @@ export function CauseReason(error, defect) {
|
|
|
6972
7195
|
* @see {@link CauseReason} for the schema used by each individual cause reason
|
|
6973
7196
|
* @see {@link CauseIso} for the ordered array representation used by the schema ISO
|
|
6974
7197
|
*
|
|
7198
|
+
* @stability stable
|
|
6975
7199
|
* @category schemas
|
|
6976
7200
|
* @since 3.10.0
|
|
6977
7201
|
*/
|
|
@@ -7024,6 +7248,7 @@ function chunkLink(values) {
|
|
|
7024
7248
|
/**
|
|
7025
7249
|
* Schema for chunks whose values conform to the provided element schema.
|
|
7026
7250
|
*
|
|
7251
|
+
* @stability stable
|
|
7027
7252
|
* @category schemas
|
|
7028
7253
|
* @since 3.10.0
|
|
7029
7254
|
*/
|
|
@@ -7162,6 +7387,7 @@ function timeZoneArbitrarySchema() {
|
|
|
7162
7387
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
7163
7388
|
* @see {@link DateTimeZoned} for preserving zoned DateTime values
|
|
7164
7389
|
*
|
|
7390
|
+
* @stability stable
|
|
7165
7391
|
* @category schemas
|
|
7166
7392
|
* @since 3.10.0
|
|
7167
7393
|
*/
|
|
@@ -7206,6 +7432,7 @@ export const DateTimeUtc = /*#__PURE__*/declare(u => DateTime.isDateTime(u) && D
|
|
|
7206
7432
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
7207
7433
|
* @see {@link Date} for validating Date instances without converting them
|
|
7208
7434
|
*
|
|
7435
|
+
* @stability stable
|
|
7209
7436
|
* @category schemas
|
|
7210
7437
|
* @since 3.12.0
|
|
7211
7438
|
*/
|
|
@@ -7231,6 +7458,7 @@ export const DateTimeUtcFromDate = /*#__PURE__*/Date.pipe(/*#__PURE__*/decodeTo(
|
|
|
7231
7458
|
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
7232
7459
|
* @see {@link DateFromString} for decoding strings into JavaScript Date instances
|
|
7233
7460
|
*
|
|
7461
|
+
* @stability stable
|
|
7234
7462
|
* @category schemas
|
|
7235
7463
|
* @since 4.0.0
|
|
7236
7464
|
*/
|
|
@@ -7252,6 +7480,7 @@ export const DateTimeUtcFromString = /*#__PURE__*/String.annotate({
|
|
|
7252
7480
|
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
7253
7481
|
* @see {@link DateFromMillis} for decoding epoch milliseconds into JavaScript Date instances
|
|
7254
7482
|
*
|
|
7483
|
+
* @stability stable
|
|
7255
7484
|
* @category schemas
|
|
7256
7485
|
* @since 4.0.0
|
|
7257
7486
|
*/
|
|
@@ -7268,6 +7497,7 @@ export const DateTimeUtcFromMillis = /*#__PURE__*/Int.pipe(/*#__PURE__*/decodeTo
|
|
|
7268
7497
|
*
|
|
7269
7498
|
* - encodes `DateTime.TimeZone.Offset` as a number (offset in milliseconds)
|
|
7270
7499
|
*
|
|
7500
|
+
* @stability stable
|
|
7271
7501
|
* @category schemas
|
|
7272
7502
|
* @since 3.10.0
|
|
7273
7503
|
*/
|
|
@@ -7297,6 +7527,7 @@ const TimeZoneNamedString = /*#__PURE__*/String.annotate({
|
|
|
7297
7527
|
*
|
|
7298
7528
|
* - encodes `DateTime.TimeZone.Named` as a string (IANA time zone identifier)
|
|
7299
7529
|
*
|
|
7530
|
+
* @stability stable
|
|
7300
7531
|
* @category schemas
|
|
7301
7532
|
* @since 3.10.0
|
|
7302
7533
|
*/
|
|
@@ -7326,6 +7557,7 @@ export const TimeZoneNamed = /*#__PURE__*/declare(DateTime.isTimeZoneNamed, {
|
|
|
7326
7557
|
* Encoding:
|
|
7327
7558
|
* - A `DateTime.TimeZone.Named` is encoded as a `string`.
|
|
7328
7559
|
*
|
|
7560
|
+
* @stability stable
|
|
7329
7561
|
* @category schemas
|
|
7330
7562
|
* @since 4.0.0
|
|
7331
7563
|
*/
|
|
@@ -7343,6 +7575,7 @@ const TimeZoneString = /*#__PURE__*/String.annotate({
|
|
|
7343
7575
|
* - encodes `DateTime.TimeZone` as a string (IANA identifier or offset like
|
|
7344
7576
|
* `+03:00`)
|
|
7345
7577
|
*
|
|
7578
|
+
* @stability stable
|
|
7346
7579
|
* @category schemas
|
|
7347
7580
|
* @since 3.10.0
|
|
7348
7581
|
*/
|
|
@@ -7372,6 +7605,7 @@ export const TimeZone = /*#__PURE__*/declare(DateTime.isTimeZone, {
|
|
|
7372
7605
|
* Encoding:
|
|
7373
7606
|
* - A `DateTime.TimeZone` is encoded as a `string`.
|
|
7374
7607
|
*
|
|
7608
|
+
* @stability stable
|
|
7375
7609
|
* @category schemas
|
|
7376
7610
|
* @since 4.0.0
|
|
7377
7611
|
*/
|
|
@@ -7391,6 +7625,7 @@ const DateTimeZonedString = /*#__PURE__*/String.annotate({
|
|
|
7391
7625
|
* - encodes named zones by appending the IANA identifier in brackets, such as
|
|
7392
7626
|
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`
|
|
7393
7627
|
*
|
|
7628
|
+
* @stability stable
|
|
7394
7629
|
* @category schemas
|
|
7395
7630
|
* @since 3.10.0
|
|
7396
7631
|
*/
|
|
@@ -7434,6 +7669,7 @@ export const DateTimeZoned = /*#__PURE__*/declare(u => DateTime.isDateTime(u) &&
|
|
|
7434
7669
|
* Encoding:
|
|
7435
7670
|
* - A `DateTime.Zoned` is encoded as a `string`.
|
|
7436
7671
|
*
|
|
7672
|
+
* @stability stable
|
|
7437
7673
|
* @category schemas
|
|
7438
7674
|
* @since 4.0.0
|
|
7439
7675
|
*/
|
|
@@ -7965,6 +8201,7 @@ const durationFromMillis = /*#__PURE__*/SchemaTransformation.transform({
|
|
|
7965
8201
|
* Schema.decodeUnknownSync(Schema.Duration)(Duration.seconds(5)) // => Duration.seconds(5)
|
|
7966
8202
|
* ```
|
|
7967
8203
|
*
|
|
8204
|
+
* @stability stable
|
|
7968
8205
|
* @category schemas
|
|
7969
8206
|
*
|
|
7970
8207
|
* @since 3.10.0
|
|
@@ -8042,6 +8279,7 @@ const DurationString = /*#__PURE__*/String.annotate({
|
|
|
8042
8279
|
* Encoding:
|
|
8043
8280
|
* - A `Duration` is encoded as a parseable `string`.
|
|
8044
8281
|
*
|
|
8282
|
+
* @stability stable
|
|
8045
8283
|
* @category schemas
|
|
8046
8284
|
* @since 4.0.0
|
|
8047
8285
|
*/
|
|
@@ -8060,6 +8298,7 @@ export const DurationFromString = /*#__PURE__*/DurationString.pipe(/*#__PURE__*/
|
|
|
8060
8298
|
* fails when the duration cannot be represented as nanoseconds, such as
|
|
8061
8299
|
* `Duration.infinity` or `Duration.negativeInfinity`.
|
|
8062
8300
|
*
|
|
8301
|
+
* @stability stable
|
|
8063
8302
|
* @category schemas
|
|
8064
8303
|
* @since 3.10.0
|
|
8065
8304
|
*/
|
|
@@ -8080,6 +8319,7 @@ export const DurationFromNanos = /*#__PURE__*/BigInt.pipe(/*#__PURE__*/decodeTo(
|
|
|
8080
8319
|
*
|
|
8081
8320
|
* `NaN` is decoded as `Duration.zero`, matching `Duration.millis`.
|
|
8082
8321
|
*
|
|
8322
|
+
* @stability stable
|
|
8083
8323
|
* @category schemas
|
|
8084
8324
|
* @since 3.10.0
|
|
8085
8325
|
*/
|
|
@@ -8093,6 +8333,7 @@ export const DurationFromMillis = /*#__PURE__*/Number.pipe(/*#__PURE__*/decodeTo
|
|
|
8093
8333
|
* Use when serializing or validating an effect outcome where success, typed
|
|
8094
8334
|
* failure, and defects each need their own schema.
|
|
8095
8335
|
*
|
|
8336
|
+
* @stability stable
|
|
8096
8337
|
* @category schemas
|
|
8097
8338
|
* @since 3.10.0
|
|
8098
8339
|
*/
|
|
@@ -8302,6 +8543,7 @@ function hashMapLink(entries) {
|
|
|
8302
8543
|
/**
|
|
8303
8544
|
* Schema for hash maps whose keys and values conform to the provided schemas.
|
|
8304
8545
|
*
|
|
8546
|
+
* @stability stable
|
|
8305
8547
|
* @category schemas
|
|
8306
8548
|
* @since 3.10.0
|
|
8307
8549
|
*/
|
|
@@ -8354,6 +8596,7 @@ function hashSetLink(values) {
|
|
|
8354
8596
|
/**
|
|
8355
8597
|
* Schema for hash sets whose values conform to the provided element schema.
|
|
8356
8598
|
*
|
|
8599
|
+
* @stability stable
|
|
8357
8600
|
* @category schemas
|
|
8358
8601
|
* @since 3.10.0
|
|
8359
8602
|
*/
|
|
@@ -8395,6 +8638,7 @@ export function HashSet(value) {
|
|
|
8395
8638
|
/**
|
|
8396
8639
|
* Schema for `Option<A>` values.
|
|
8397
8640
|
*
|
|
8641
|
+
* @stability stable
|
|
8398
8642
|
* @category schemas
|
|
8399
8643
|
* @since 3.10.0
|
|
8400
8644
|
*/
|
|
@@ -8450,6 +8694,7 @@ export function Option(value) {
|
|
|
8450
8694
|
* Decoding maps `null` to `None` and all other values to `Some`. Encoding maps
|
|
8451
8695
|
* `None` to `null` and maps `Some` to its value.
|
|
8452
8696
|
*
|
|
8697
|
+
* @stability stable
|
|
8453
8698
|
* @category schemas
|
|
8454
8699
|
* @since 3.10.0
|
|
8455
8700
|
*/
|
|
@@ -8465,6 +8710,7 @@ export function OptionFromNullOr(schema) {
|
|
|
8465
8710
|
* Decoding maps `undefined` to `None` and all other values to `Some`. Encoding
|
|
8466
8711
|
* maps `None` to `undefined` and maps `Some` to its value.
|
|
8467
8712
|
*
|
|
8713
|
+
* @stability stable
|
|
8468
8714
|
* @category schemas
|
|
8469
8715
|
* @since 3.10.0
|
|
8470
8716
|
*/
|
|
@@ -8481,6 +8727,7 @@ export function OptionFromUndefinedOr(schema) {
|
|
|
8481
8727
|
* `options.onNoneEncoding`, which defaults to `undefined`, and maps `Some` to
|
|
8482
8728
|
* its value.
|
|
8483
8729
|
*
|
|
8730
|
+
* @stability stable
|
|
8484
8731
|
* @category schemas
|
|
8485
8732
|
* @since 3.10.0
|
|
8486
8733
|
*/
|
|
@@ -8687,6 +8934,7 @@ export const RecordFromUrlParams = /*#__PURE__*/UrlParams.pipe(/*#__PURE__*/deco
|
|
|
8687
8934
|
* Decoding maps a missing key to `None` and a present value to `Some`.
|
|
8688
8935
|
* Encoding maps `None` to a missing key and maps `Some` to its value.
|
|
8689
8936
|
*
|
|
8937
|
+
* @stability stable
|
|
8690
8938
|
* @category schemas
|
|
8691
8939
|
* @since 4.0.0
|
|
8692
8940
|
*/
|
|
@@ -8703,6 +8951,7 @@ export function OptionFromOptionalKey(schema) {
|
|
|
8703
8951
|
* maps all other values to `Some`. Encoding maps `None` to a missing key and
|
|
8704
8952
|
* maps `Some` to its value.
|
|
8705
8953
|
*
|
|
8954
|
+
* @stability stable
|
|
8706
8955
|
* @category schemas
|
|
8707
8956
|
* @since 4.0.0
|
|
8708
8957
|
*/
|
|
@@ -8720,6 +8969,7 @@ export function OptionFromOptional(schema) {
|
|
|
8720
8969
|
* according to `options.onNoneEncoding`: `"omit"` encodes a missing key,
|
|
8721
8970
|
* `null` encodes `null`, and `undefined` encodes `undefined`.
|
|
8722
8971
|
*
|
|
8972
|
+
* @stability stable
|
|
8723
8973
|
* @category schemas
|
|
8724
8974
|
* @since 4.0.0
|
|
8725
8975
|
*/
|
|
@@ -8748,6 +8998,7 @@ export function OptionFromOptionalNullOr(schema, options) {
|
|
|
8748
8998
|
* sensitive and should not be exposed in JSON.
|
|
8749
8999
|
*
|
|
8750
9000
|
* @see {@link RedactedFromValue} for decoding raw values and wrapping them in `Redacted`.
|
|
9001
|
+
* @stability stable
|
|
8751
9002
|
* @category schemas
|
|
8752
9003
|
* @since 3.10.0
|
|
8753
9004
|
*/
|
|
@@ -8807,6 +9058,7 @@ export function Redacted(value, options) {
|
|
|
8807
9058
|
* the raw value and wraps it.
|
|
8808
9059
|
*
|
|
8809
9060
|
* @see {@link Redacted} for schemas whose input is already a `Redacted` value.
|
|
9061
|
+
* @stability stable
|
|
8810
9062
|
* @category schemas
|
|
8811
9063
|
* @since 4.0.0
|
|
8812
9064
|
*/
|
|
@@ -8824,6 +9076,7 @@ export function RedactedFromValue(value, options) {
|
|
|
8824
9076
|
/**
|
|
8825
9077
|
* Schema for `Result<A, E>` values.
|
|
8826
9078
|
*
|
|
9079
|
+
* @stability stable
|
|
8827
9080
|
* @category schemas
|
|
8828
9081
|
* @since 4.0.0
|
|
8829
9082
|
*/
|
|
@@ -9060,6 +9313,7 @@ function isStruct(schema) {
|
|
|
9060
9313
|
* @see {@link Error} for defining schema-backed error classes
|
|
9061
9314
|
* @see {@link TaggedError} for defining tagged schema-backed error classes
|
|
9062
9315
|
*
|
|
9316
|
+
* @stability stable
|
|
9063
9317
|
* @category constructors
|
|
9064
9318
|
* @since 3.10.0
|
|
9065
9319
|
*/
|
|
@@ -9100,6 +9354,7 @@ export const Class = identifier => (schema, annotations) => {
|
|
|
9100
9354
|
* c.radius // => 5
|
|
9101
9355
|
* ```
|
|
9102
9356
|
*
|
|
9357
|
+
* @stability stable
|
|
9103
9358
|
* @category constructors
|
|
9104
9359
|
* @since 3.10.0
|
|
9105
9360
|
*/
|
|
@@ -9136,6 +9391,7 @@ export const TaggedClass = identifier => {
|
|
|
9136
9391
|
* error.id // => 1
|
|
9137
9392
|
* ```
|
|
9138
9393
|
*
|
|
9394
|
+
* @stability stable
|
|
9139
9395
|
* @category constructors
|
|
9140
9396
|
* @since 4.0.0
|
|
9141
9397
|
*/
|
|
@@ -9172,6 +9428,7 @@ export const Error = identifier => (schema, annotations) => {
|
|
|
9172
9428
|
* error.id // => 42
|
|
9173
9429
|
* ```
|
|
9174
9430
|
*
|
|
9431
|
+
* @stability stable
|
|
9175
9432
|
* @category constructors
|
|
9176
9433
|
* @since 3.10.0
|
|
9177
9434
|
*/
|
|
@@ -9195,6 +9452,7 @@ export const TaggedError = identifier => {
|
|
|
9195
9452
|
* The annotation is applied through this helper because adding it directly to
|
|
9196
9453
|
* `Annotations.Bottom` would make schemas invariant.
|
|
9197
9454
|
*
|
|
9455
|
+
* @stability stable
|
|
9198
9456
|
* @category formatting
|
|
9199
9457
|
* @since 4.0.0
|
|
9200
9458
|
*/
|
|
@@ -9213,6 +9471,7 @@ export function overrideToFormatter(toFormatter) {
|
|
|
9213
9471
|
* The optional `onBefore` hook lets you intercept specific AST nodes before
|
|
9214
9472
|
* the default formatting logic runs.
|
|
9215
9473
|
*
|
|
9474
|
+
* @stability stable
|
|
9216
9475
|
* @category formatting
|
|
9217
9476
|
* @since 4.0.0
|
|
9218
9477
|
*/
|
|
@@ -9228,6 +9487,7 @@ export function toFormatter(schema, options) {
|
|
|
9228
9487
|
* Use when you need a custom equivalence instead of the default structural
|
|
9229
9488
|
* equivalence derived by {@link toEquivalence}.
|
|
9230
9489
|
*
|
|
9490
|
+
* @stability stable
|
|
9231
9491
|
* @category instances
|
|
9232
9492
|
* @since 4.0.0
|
|
9233
9493
|
*/
|
|
@@ -9252,6 +9512,7 @@ export function overrideToEquivalence(toEquivalence) {
|
|
|
9252
9512
|
* eq({ id: 1, name: "Alice" }, { id: 2, name: "Alice" }) // => false
|
|
9253
9513
|
* ```
|
|
9254
9514
|
*
|
|
9515
|
+
* @stability stable
|
|
9255
9516
|
* @category instances
|
|
9256
9517
|
* @since 4.0.0
|
|
9257
9518
|
*/
|
|
@@ -9276,6 +9537,7 @@ export function toEquivalence(schema) {
|
|
|
9276
9537
|
*
|
|
9277
9538
|
* @see {@link SchemaRepresentation.toRepresentation} for converting a `SchemaAST.AST` directly
|
|
9278
9539
|
*
|
|
9540
|
+
* @stability stable
|
|
9279
9541
|
* @category converting
|
|
9280
9542
|
* @since 4.0.0
|
|
9281
9543
|
*/
|
|
@@ -9350,6 +9612,7 @@ export function toRepresentation(schema, options) {
|
|
|
9350
9612
|
* @see {@link toCodecJson} for decoding and encoding the canonical JSON representation
|
|
9351
9613
|
* @see {@link SchemaRepresentation.toJsonSchemaDocument} for compiling an existing live representation document
|
|
9352
9614
|
*
|
|
9615
|
+
* @stability stable
|
|
9353
9616
|
* @category converting
|
|
9354
9617
|
* @since 4.0.0
|
|
9355
9618
|
*/
|
|
@@ -9378,6 +9641,7 @@ export function toJsonSchemaDocument(schema, options) {
|
|
|
9378
9641
|
* checks and annotations remain on its source node rather than being copied to
|
|
9379
9642
|
* the JSON target. Source checks still run after the transformation.
|
|
9380
9643
|
*
|
|
9644
|
+
* @stability stable
|
|
9381
9645
|
* @category converting
|
|
9382
9646
|
* @since 4.0.0
|
|
9383
9647
|
*/
|
|
@@ -9396,6 +9660,7 @@ export const toCodecJson = InternalToCodec.toCodecJson;
|
|
|
9396
9660
|
* Links cannot require services because the returned `Codec` does not expose
|
|
9397
9661
|
* service requirements.
|
|
9398
9662
|
*
|
|
9663
|
+
* @stability stable
|
|
9399
9664
|
* @category converting
|
|
9400
9665
|
* @since 4.0.0
|
|
9401
9666
|
*/
|
|
@@ -9417,6 +9682,7 @@ export const toCodecIso = InternalToCodec.toCodecIso;
|
|
|
9417
9682
|
* `toCodec` encoding. A callback can return `undefined` when the declaration is
|
|
9418
9683
|
* already in canonical StringTree form.
|
|
9419
9684
|
*
|
|
9685
|
+
* @stability stable
|
|
9420
9686
|
* @category converting
|
|
9421
9687
|
* @since 4.0.0
|
|
9422
9688
|
*/
|
|
@@ -9436,6 +9702,7 @@ export const toCodecStringTree = InternalToCodec.toCodecStringTree;
|
|
|
9436
9702
|
* decoding convenience rather than a canonical StringTree representation. It
|
|
9437
9703
|
* does not parse comma-separated strings.
|
|
9438
9704
|
*
|
|
9705
|
+
* @stability stable
|
|
9439
9706
|
* @category converting
|
|
9440
9707
|
* @since 4.0.0
|
|
9441
9708
|
*/
|
|
@@ -9449,6 +9716,7 @@ export const toCodecArrayFromSingle = InternalToCodec.toCodecArrayFromSingle;
|
|
|
9449
9716
|
* an `Effect` that succeeds with the XML string or fails with a
|
|
9450
9717
|
* {@link SchemaIssue.Issue} if codec encoding fails.
|
|
9451
9718
|
*
|
|
9719
|
+
* @stability stable
|
|
9452
9720
|
* @category encoding
|
|
9453
9721
|
* @since 4.0.0
|
|
9454
9722
|
*/
|
|
@@ -9472,6 +9740,7 @@ export function toEncoderXml(codec, options) {
|
|
|
9472
9740
|
* `SchemaIssue.makeFormatterDefault()`. Consume {@link toCodecIso} with an
|
|
9473
9741
|
* effectful parser for asynchronous execution or explicit failure handling.
|
|
9474
9742
|
*
|
|
9743
|
+
* @stability stable
|
|
9475
9744
|
* @category converting
|
|
9476
9745
|
* @since 4.0.0
|
|
9477
9746
|
*/
|
|
@@ -9481,6 +9750,7 @@ export function toIso(schema) {
|
|
|
9481
9750
|
/**
|
|
9482
9751
|
* Returns an identity `Iso` over the schema's source (`Type`) side.
|
|
9483
9752
|
*
|
|
9753
|
+
* @stability stable
|
|
9484
9754
|
* @category constructors
|
|
9485
9755
|
* @since 4.0.0
|
|
9486
9756
|
*/
|
|
@@ -9490,6 +9760,7 @@ export function toIsoSource(schema) {
|
|
|
9490
9760
|
/**
|
|
9491
9761
|
* Returns an identity `Iso` over the schema's focus (`Iso`) side.
|
|
9492
9762
|
*
|
|
9763
|
+
* @stability stable
|
|
9493
9764
|
* @category constructors
|
|
9494
9765
|
* @since 4.0.0
|
|
9495
9766
|
*/
|
|
@@ -9510,6 +9781,7 @@ export function toIsoFocus(schema) {
|
|
|
9510
9781
|
* provided `decode` and `encode` getters to transform between the schema type
|
|
9511
9782
|
* and the target codec.
|
|
9512
9783
|
*
|
|
9784
|
+
* @stability stable
|
|
9513
9785
|
* @category transforming
|
|
9514
9786
|
* @since 4.0.0
|
|
9515
9787
|
*/
|
|
@@ -9540,6 +9812,7 @@ export function overrideToCodecIso(to, transformation) {
|
|
|
9540
9812
|
* `SchemaIssue.makeFormatterDefault()`. Invalid patch operations instead produce
|
|
9541
9813
|
* {@link JsonPatch.apply} errors.
|
|
9542
9814
|
*
|
|
9815
|
+
* @stability stable
|
|
9543
9816
|
* @category converting
|
|
9544
9817
|
* @since 4.0.0
|
|
9545
9818
|
*/
|
|
@@ -9551,6 +9824,7 @@ export function toDifferJsonPatch(schema) {
|
|
|
9551
9824
|
* The resulting schema accepts a single node value, an array of trees, or an
|
|
9552
9825
|
* object whose values are trees.
|
|
9553
9826
|
*
|
|
9827
|
+
* @stability stable
|
|
9554
9828
|
* @category schemas
|
|
9555
9829
|
* @since 4.0.0
|
|
9556
9830
|
*/
|
|
@@ -9570,6 +9844,7 @@ export function Tree(node) {
|
|
|
9570
9844
|
* Schema.decodeUnknownOption(Schema.Json)({ key: [1, true, null] }) // => Option.some({ key: [1, true, null] })
|
|
9571
9845
|
* ```
|
|
9572
9846
|
*
|
|
9847
|
+
* @stability stable
|
|
9573
9848
|
* @category schemas
|
|
9574
9849
|
* @since 4.0.0
|
|
9575
9850
|
*/
|
|
@@ -9596,6 +9871,7 @@ export const Json = /*#__PURE__*/make(/*#__PURE__*/SchemaAST.annotate(SchemaAST.
|
|
|
9596
9871
|
* ```
|
|
9597
9872
|
*
|
|
9598
9873
|
* @see {@link Json} for a schema that also accepts JSON arrays and primitive values
|
|
9874
|
+
* @stability stable
|
|
9599
9875
|
* @category schemas
|
|
9600
9876
|
* @since 4.0.0
|
|
9601
9877
|
*/
|
|
@@ -9610,6 +9886,7 @@ const JsonError = /*#__PURE__*/Struct({
|
|
|
9610
9886
|
* Schema that accepts any mutable JSON-compatible value. See {@link Json} for
|
|
9611
9887
|
* the immutable variant.
|
|
9612
9888
|
*
|
|
9889
|
+
* @stability stable
|
|
9613
9890
|
* @category schemas
|
|
9614
9891
|
* @since 4.0.0
|
|
9615
9892
|
*/
|
|
@@ -9625,6 +9902,7 @@ export const MutableJson = /*#__PURE__*/make(/*#__PURE__*/SchemaAST.annotate(Sch
|
|
|
9625
9902
|
* annotations are taken from the last check; otherwise they are taken from
|
|
9626
9903
|
* the base schema instance.
|
|
9627
9904
|
*
|
|
9905
|
+
* @stability stable
|
|
9628
9906
|
* @category getters
|
|
9629
9907
|
* @since 4.0.0
|
|
9630
9908
|
*/
|
|
@@ -9636,6 +9914,7 @@ export function resolveAnnotations(schema) {
|
|
|
9636
9914
|
* annotations are those attached via `annotateKey` and live on the AST's
|
|
9637
9915
|
* `context` rather than on the schema node itself.
|
|
9638
9916
|
*
|
|
9917
|
+
* @stability stable
|
|
9639
9918
|
* @category getters
|
|
9640
9919
|
* @since 4.0.0
|
|
9641
9920
|
*/
|