effect 4.0.0-beta.83 → 4.0.0-beta.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +64 -64
- package/dist/Array.js +26 -26
- package/dist/Cache.d.ts +1 -1
- package/dist/Cache.js +1 -1
- package/dist/Cause.d.ts +68 -68
- package/dist/Cause.js +47 -47
- package/dist/Channel.d.ts +5 -5
- package/dist/Channel.js +3 -3
- package/dist/Clock.d.ts +1 -1
- package/dist/Clock.js +1 -1
- package/dist/Combiner.d.ts +9 -9
- package/dist/Combiner.js +8 -8
- package/dist/Config.d.ts +15 -94
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +22 -70
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +58 -74
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +66 -41
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +1 -1
- package/dist/Console.js +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +4 -3
- package/dist/Context.js.map +1 -1
- package/dist/Data.d.ts +15 -15
- package/dist/Data.js +3 -3
- package/dist/DateTime.d.ts +6 -6
- package/dist/DateTime.js +2 -2
- package/dist/Duration.d.ts +3 -3
- package/dist/Duration.js +3 -3
- package/dist/Effect.d.ts +84 -45
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +72 -33
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts +7 -7
- package/dist/Equal.js +5 -5
- package/dist/Equivalence.d.ts +17 -17
- package/dist/Equivalence.js +13 -13
- package/dist/Exit.d.ts +3 -3
- package/dist/Exit.js +3 -3
- package/dist/Formatter.d.ts +5 -5
- package/dist/Formatter.js +4 -4
- package/dist/Function.d.ts +10 -10
- package/dist/Function.js +3 -3
- package/dist/HashMap.d.ts +3 -3
- package/dist/HashMap.js +1 -1
- package/dist/Iterable.d.ts +6 -6
- package/dist/Iterable.js +2 -2
- package/dist/JsonPatch.d.ts +2 -2
- package/dist/Layer.d.ts +1 -1
- package/dist/Layer.js +5 -4
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +4 -3
- package/dist/LayerMap.js.map +1 -1
- package/dist/Logger.d.ts +1 -1
- package/dist/Logger.js +1 -1
- package/dist/Match.d.ts +8 -8
- package/dist/Match.js +8 -8
- package/dist/Metric.d.ts +3 -3
- package/dist/Metric.js +3 -3
- package/dist/Optic.d.ts +30 -30
- package/dist/Optic.js +12 -12
- package/dist/Option.d.ts +7 -7
- package/dist/Option.js +7 -7
- package/dist/Order.d.ts +23 -23
- package/dist/Order.js +20 -20
- package/dist/Pool.d.ts +1 -1
- package/dist/Pool.js +1 -1
- package/dist/Predicate.d.ts +88 -88
- package/dist/Predicate.js +47 -47
- package/dist/PubSub.d.ts +3 -3
- package/dist/PubSub.js +3 -3
- package/dist/Random.d.ts +31 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +32 -0
- package/dist/Random.js.map +1 -1
- package/dist/Reducer.d.ts +1 -1
- package/dist/Reducer.js +1 -1
- package/dist/Result.d.ts +18 -18
- package/dist/Result.js +8 -8
- package/dist/Runtime.d.ts +1 -1
- package/dist/Runtime.js +1 -1
- package/dist/Schema.d.ts +313 -126
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +316 -127
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +9 -8
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +203 -140
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +48 -48
- package/dist/SchemaGetter.js +44 -44
- package/dist/SchemaIssue.d.ts +3 -3
- package/dist/SchemaIssue.js +3 -3
- package/dist/SchemaParser.d.ts +122 -22
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +186 -50
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +1 -1
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +96 -2
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +20 -20
- package/dist/SchemaTransformation.js +18 -18
- package/dist/Stream.d.ts +3 -3
- package/dist/Stream.js +2 -2
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +1 -1
- package/dist/String.js +1 -1
- package/dist/Struct.d.ts +1 -1
- package/dist/Struct.js +1 -1
- package/dist/Types.d.ts +13 -13
- package/dist/internal/effect.js +33 -20
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +17 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/cause.d.ts +2 -0
- package/dist/internal/schema/cause.d.ts.map +1 -0
- package/dist/internal/schema/cause.js +24 -0
- package/dist/internal/schema/cause.js.map +1 -0
- package/dist/internal/schema/schema.d.ts +8 -4
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +21 -8
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/stackTraceLimit.d.ts +2 -0
- package/dist/internal/stackTraceLimit.d.ts.map +1 -0
- package/dist/internal/stackTraceLimit.js +40 -0
- package/dist/internal/stackTraceLimit.js.map +1 -0
- package/dist/internal/tracer.d.ts.map +1 -1
- package/dist/internal/tracer.js +4 -3
- package/dist/internal/tracer.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +3 -3
- package/dist/testing/TestSchema.js +1 -1
- package/dist/unstable/ai/AiError.d.ts +1 -1
- package/dist/unstable/ai/AiError.js +1 -1
- package/dist/unstable/ai/Chat.d.ts +1 -1
- package/dist/unstable/ai/Chat.js +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +4 -5
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +2 -2
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +4 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/persistence/PersistedQueue.js +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.js +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -4
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +4 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +15 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -0
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +1 -0
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +65 -65
- package/src/Cache.ts +1 -1
- package/src/Cause.ts +68 -68
- package/src/Channel.ts +5 -5
- package/src/Clock.ts +1 -1
- package/src/Combiner.ts +9 -9
- package/src/Config.ts +40 -108
- package/src/ConfigProvider.ts +139 -100
- package/src/Console.ts +1 -1
- package/src/Context.ts +4 -5
- package/src/Data.ts +15 -15
- package/src/DateTime.ts +6 -6
- package/src/Duration.ts +3 -3
- package/src/Effect.ts +89 -45
- package/src/Equal.ts +7 -7
- package/src/Equivalence.ts +17 -17
- package/src/Exit.ts +3 -3
- package/src/Formatter.ts +5 -5
- package/src/Function.ts +10 -10
- package/src/HashMap.ts +3 -3
- package/src/Iterable.ts +6 -6
- package/src/JsonPatch.ts +2 -2
- package/src/Layer.ts +5 -5
- package/src/LayerMap.ts +4 -3
- package/src/Logger.ts +1 -1
- package/src/Match.ts +8 -8
- package/src/Metric.ts +3 -3
- package/src/Optic.ts +30 -30
- package/src/Option.ts +7 -7
- package/src/Order.ts +23 -23
- package/src/Pool.ts +1 -1
- package/src/Predicate.ts +88 -88
- package/src/PubSub.ts +3 -3
- package/src/Random.ts +42 -0
- package/src/Reducer.ts +1 -1
- package/src/Result.ts +20 -20
- package/src/Runtime.ts +1 -1
- package/src/Schema.ts +389 -153
- package/src/SchemaAST.ts +237 -148
- package/src/SchemaGetter.ts +48 -48
- package/src/SchemaIssue.ts +3 -3
- package/src/SchemaParser.ts +197 -58
- package/src/SchemaRepresentation.ts +73 -3
- package/src/SchemaTransformation.ts +20 -20
- package/src/Stream.ts +4 -4
- package/src/String.ts +1 -1
- package/src/Struct.ts +1 -1
- package/src/Types.ts +13 -13
- package/src/internal/effect.ts +40 -21
- package/src/internal/schema/arbitrary.ts +23 -2
- package/src/internal/schema/cause.ts +26 -0
- package/src/internal/schema/schema.ts +36 -10
- package/src/internal/stackTraceLimit.ts +63 -0
- package/src/internal/tracer.ts +4 -3
- package/src/testing/TestSchema.ts +3 -3
- package/src/unstable/ai/AiError.ts +1 -1
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/Tool.ts +4 -3
- package/src/unstable/cli/Prompt.ts +1 -1
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -3
- package/src/unstable/httpapi/HttpApiScalar.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +1 -1
- package/src/unstable/rpc/RpcGroup.ts +3 -4
- package/src/unstable/rpc/RpcMiddleware.ts +4 -3
- package/src/unstable/sql/SqlResolver.ts +15 -2
- package/src/unstable/workflow/Activity.ts +2 -0
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
package/src/Order.ts
CHANGED
|
@@ -29,7 +29,7 @@ import * as Reducer from "./Reducer.ts"
|
|
|
29
29
|
* is greater than the second. It must satisfy total ordering laws: totality,
|
|
30
30
|
* antisymmetry, and transitivity.
|
|
31
31
|
*
|
|
32
|
-
* **Example** (
|
|
32
|
+
* **Example** (Defining a custom Order)
|
|
33
33
|
*
|
|
34
34
|
* ```ts
|
|
35
35
|
* import { Order } from "effect"
|
|
@@ -126,7 +126,7 @@ export function make<A>(
|
|
|
126
126
|
* Uses lexicographic dictionary ordering. The empty string is less than any
|
|
127
127
|
* non-empty string, and comparisons are case-sensitive.
|
|
128
128
|
*
|
|
129
|
-
* **Example** (
|
|
129
|
+
* **Example** (Ordering strings)
|
|
130
130
|
*
|
|
131
131
|
* ```ts
|
|
132
132
|
* import { Order } from "effect"
|
|
@@ -156,7 +156,7 @@ export const String: Order<string> = make((self, that) => self < that ? -1 : 1)
|
|
|
156
156
|
* each other, and any `NaN` is considered less than any non-`NaN` number. All
|
|
157
157
|
* other values use standard numeric comparison.
|
|
158
158
|
*
|
|
159
|
-
* **Example** (
|
|
159
|
+
* **Example** (Ordering numbers)
|
|
160
160
|
*
|
|
161
161
|
* ```ts
|
|
162
162
|
* import { Order } from "effect"
|
|
@@ -192,7 +192,7 @@ export const Number: Order<number> = make((self, that) => {
|
|
|
192
192
|
*
|
|
193
193
|
* `false` is less than `true`, and equal values return `0`.
|
|
194
194
|
*
|
|
195
|
-
* **Example** (
|
|
195
|
+
* **Example** (Ordering booleans)
|
|
196
196
|
*
|
|
197
197
|
* ```ts
|
|
198
198
|
* import { Order } from "effect"
|
|
@@ -220,7 +220,7 @@ export const Boolean: Order<boolean> = make((self, that) => self < that ? -1 : 1
|
|
|
220
220
|
* Uses standard numeric comparison for bigint values and handles arbitrarily
|
|
221
221
|
* large integers.
|
|
222
222
|
*
|
|
223
|
-
* **Example** (
|
|
223
|
+
* **Example** (Ordering BigInts)
|
|
224
224
|
*
|
|
225
225
|
* ```ts
|
|
226
226
|
* import { Order } from "effect"
|
|
@@ -250,7 +250,7 @@ export const BigInt: Order<bigint> = make((self, that) => self < that ? -1 : 1)
|
|
|
250
250
|
* original order returns `-1`, the flipped order returns `1`, and vice versa.
|
|
251
251
|
* Equal comparisons remain `0`.
|
|
252
252
|
*
|
|
253
|
-
* **Example** (Reversing Order)
|
|
253
|
+
* **Example** (Reversing an Order)
|
|
254
254
|
*
|
|
255
255
|
* ```ts
|
|
256
256
|
* import { Order } from "effect"
|
|
@@ -284,7 +284,7 @@ export function flip<A>(O: Order<A>): Order<A> {
|
|
|
284
284
|
* returned; otherwise, the second order is applied. The result is the first
|
|
285
285
|
* non-zero comparison result, or `0` if both orders return `0`.
|
|
286
286
|
*
|
|
287
|
-
* **Example** (Combining Orders)
|
|
287
|
+
* **Example** (Combining two Orders)
|
|
288
288
|
*
|
|
289
289
|
* ```ts
|
|
290
290
|
* import { Order } from "effect"
|
|
@@ -327,7 +327,7 @@ export const combine: {
|
|
|
327
327
|
* returned; otherwise, the second order is applied. The result is the first
|
|
328
328
|
* non-zero comparison result, or `0` if both orders return `0`.
|
|
329
329
|
*
|
|
330
|
-
* **Example** (Combining Orders)
|
|
330
|
+
* **Example** (Combining two Orders)
|
|
331
331
|
*
|
|
332
332
|
* ```ts
|
|
333
333
|
* import { Order } from "effect"
|
|
@@ -370,7 +370,7 @@ export const combine: {
|
|
|
370
370
|
* returned; otherwise, the second order is applied. The result is the first
|
|
371
371
|
* non-zero comparison result, or `0` if both orders return `0`.
|
|
372
372
|
*
|
|
373
|
-
* **Example** (Combining Orders)
|
|
373
|
+
* **Example** (Combining two Orders)
|
|
374
374
|
*
|
|
375
375
|
* ```ts
|
|
376
376
|
* import { Order } from "effect"
|
|
@@ -420,7 +420,7 @@ export const combine: {
|
|
|
420
420
|
* Always returns `0` regardless of input values, making it useful as a neutral
|
|
421
421
|
* element in order composition.
|
|
422
422
|
*
|
|
423
|
-
* **Example** (
|
|
423
|
+
* **Example** (Ordering with an always-equal Order)
|
|
424
424
|
*
|
|
425
425
|
* ```ts
|
|
426
426
|
* import { Order } from "effect"
|
|
@@ -453,7 +453,7 @@ export function alwaysEqual<A>(): Order<A> {
|
|
|
453
453
|
* Applies orders in iteration order and short-circuits on the first non-zero
|
|
454
454
|
* result. It returns `0` only if all orders return `0`.
|
|
455
455
|
*
|
|
456
|
-
* **Example** (Combining
|
|
456
|
+
* **Example** (Combining multiple Orders)
|
|
457
457
|
*
|
|
458
458
|
* ```ts
|
|
459
459
|
* import { Order } from "effect"
|
|
@@ -610,7 +610,7 @@ export const mapInput: {
|
|
|
610
610
|
* Earlier dates are less than later dates. Invalid dates are compared through
|
|
611
611
|
* their `getTime()` result.
|
|
612
612
|
*
|
|
613
|
-
* **Example** (
|
|
613
|
+
* **Example** (Ordering Dates)
|
|
614
614
|
*
|
|
615
615
|
* ```ts
|
|
616
616
|
* import { Order } from "effect"
|
|
@@ -642,7 +642,7 @@ export const Date: Order<Date> = mapInput(Number, (date) => date.getTime())
|
|
|
642
642
|
* the first non-zero comparison result. Tuples must have the same length as the
|
|
643
643
|
* order collection, and the result is `0` only if all elements are equal.
|
|
644
644
|
*
|
|
645
|
-
* **Example** (
|
|
645
|
+
* **Example** (Ordering tuples)
|
|
646
646
|
*
|
|
647
647
|
* ```ts
|
|
648
648
|
* import { Order } from "effect"
|
|
@@ -706,7 +706,7 @@ export {
|
|
|
706
706
|
* are less than longer arrays. The result is `0` only if arrays have the same
|
|
707
707
|
* length and all elements are equal.
|
|
708
708
|
*
|
|
709
|
-
* **Example** (
|
|
709
|
+
* **Example** (Ordering array elements)
|
|
710
710
|
*
|
|
711
711
|
* ```ts
|
|
712
712
|
* import { Order } from "effect"
|
|
@@ -739,7 +739,7 @@ export {
|
|
|
739
739
|
* stops at the first non-zero comparison result. Field order matters: earlier
|
|
740
740
|
* fields take precedence. The result is `0` only if all fields are equal.
|
|
741
741
|
*
|
|
742
|
-
* **Example** (
|
|
742
|
+
* **Example** (Ordering structs)
|
|
743
743
|
*
|
|
744
744
|
* ```ts
|
|
745
745
|
* import { Order } from "effect"
|
|
@@ -790,7 +790,7 @@ export function Struct<const R extends { readonly [x: string]: Order<any> }>(
|
|
|
790
790
|
* Returns `true` if the order returns `-1`, meaning the first value is less
|
|
791
791
|
* than the second. Equal or greater values return `false`.
|
|
792
792
|
*
|
|
793
|
-
* **Example** (
|
|
793
|
+
* **Example** (Checking less-than comparisons)
|
|
794
794
|
*
|
|
795
795
|
* ```ts
|
|
796
796
|
* import { Order } from "effect"
|
|
@@ -824,7 +824,7 @@ export const isLessThan = <A>(O: Order<A>): {
|
|
|
824
824
|
* Returns `true` if the order returns `1`, meaning the first value is greater
|
|
825
825
|
* than the second. Equal or lesser values return `false`.
|
|
826
826
|
*
|
|
827
|
-
* **Example** (
|
|
827
|
+
* **Example** (Checking greater-than comparisons)
|
|
828
828
|
*
|
|
829
829
|
* ```ts
|
|
830
830
|
* import { Order } from "effect"
|
|
@@ -858,7 +858,7 @@ export const isGreaterThan = <A>(O: Order<A>): {
|
|
|
858
858
|
* Returns `true` if the order returns `-1` or `0`, and returns `false` only if
|
|
859
859
|
* the order returns `1`.
|
|
860
860
|
*
|
|
861
|
-
* **Example** (
|
|
861
|
+
* **Example** (Checking less-than-or-equal comparisons)
|
|
862
862
|
*
|
|
863
863
|
* ```ts
|
|
864
864
|
* import { Order } from "effect"
|
|
@@ -893,7 +893,7 @@ export const isLessThanOrEqualTo = <A>(O: Order<A>): {
|
|
|
893
893
|
* Returns `true` if the order returns `1` or `0`, and returns `false` only if
|
|
894
894
|
* the order returns `-1`.
|
|
895
895
|
*
|
|
896
|
-
* **Example** (
|
|
896
|
+
* **Example** (Checking greater-than-or-equal comparisons)
|
|
897
897
|
*
|
|
898
898
|
* ```ts
|
|
899
899
|
* import { Order } from "effect"
|
|
@@ -928,7 +928,7 @@ export const isGreaterThanOrEqualTo = <A>(O: Order<A>): {
|
|
|
928
928
|
* Returns the value that compares as less than or equal to the other value. If
|
|
929
929
|
* values are equal, the first argument is returned.
|
|
930
930
|
*
|
|
931
|
-
* **Example** (
|
|
931
|
+
* **Example** (Selecting the minimum value)
|
|
932
932
|
*
|
|
933
933
|
* ```ts
|
|
934
934
|
* import { Order } from "effect"
|
|
@@ -963,7 +963,7 @@ export const min = <A>(O: Order<A>): {
|
|
|
963
963
|
* Returns the value that compares as greater than or equal to the other value.
|
|
964
964
|
* If values are equal, the first argument is returned.
|
|
965
965
|
*
|
|
966
|
-
* **Example** (
|
|
966
|
+
* **Example** (Selecting the maximum value)
|
|
967
967
|
*
|
|
968
968
|
* ```ts
|
|
969
969
|
* import { Order } from "effect"
|
|
@@ -1000,7 +1000,7 @@ export const max = <A>(O: Order<A>): {
|
|
|
1000
1000
|
* maximum. The minimum must be less than or equal to the maximum according to
|
|
1001
1001
|
* the order.
|
|
1002
1002
|
*
|
|
1003
|
-
* **Example** (Clamping
|
|
1003
|
+
* **Example** (Clamping values)
|
|
1004
1004
|
*
|
|
1005
1005
|
* ```ts
|
|
1006
1006
|
* import { Order } from "effect"
|
|
@@ -1051,7 +1051,7 @@ export const clamp = <A>(O: Order<A>): {
|
|
|
1051
1051
|
* than or equal to maximum. Values outside the range return `false`. Both
|
|
1052
1052
|
* bounds are inclusive.
|
|
1053
1053
|
*
|
|
1054
|
-
* **Example** (Checking
|
|
1054
|
+
* **Example** (Checking ranges)
|
|
1055
1055
|
*
|
|
1056
1056
|
* ```ts
|
|
1057
1057
|
* import { Order } from "effect"
|
package/src/Pool.ts
CHANGED
|
@@ -248,7 +248,7 @@ export const make = <A, E, R>(options: {
|
|
|
248
248
|
* from item creation, while `"usage"` measures from pool usage. The default is
|
|
249
249
|
* `"usage"`.
|
|
250
250
|
*
|
|
251
|
-
* **Example** (
|
|
251
|
+
* **Example** (Creating a connection pool)
|
|
252
252
|
*
|
|
253
253
|
* ```ts
|
|
254
254
|
* import { Duration, Effect, Pool } from "effect"
|