effect 3.13.9 → 3.13.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Arbitrary.js +38 -22
- package/dist/cjs/Arbitrary.js.map +1 -1
- package/dist/cjs/Array.js +50 -50
- package/dist/cjs/Array.js.map +1 -1
- package/dist/cjs/Brand.js +9 -4
- package/dist/cjs/Brand.js.map +1 -1
- package/dist/cjs/Cause.js +1 -0
- package/dist/cjs/Cause.js.map +1 -1
- package/dist/cjs/Chunk.js +25 -23
- package/dist/cjs/Chunk.js.map +1 -1
- package/dist/cjs/Config.js +2 -1
- package/dist/cjs/Config.js.map +1 -1
- package/dist/cjs/Context.js +4 -4
- package/dist/cjs/Effect.js +823 -632
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Either.js +12 -12
- package/dist/cjs/Either.js.map +1 -1
- package/dist/cjs/LogLevel.js +1 -1
- package/dist/cjs/Logger.js +12 -12
- package/dist/cjs/Match.js +26 -26
- package/dist/cjs/Option.js +43 -43
- package/dist/cjs/Predicate.js +6 -2
- package/dist/cjs/Predicate.js.map +1 -1
- package/dist/cjs/Schema.js +21 -17
- package/dist/cjs/Schema.js.map +1 -1
- package/dist/cjs/SchemaAST.js +49 -25
- package/dist/cjs/SchemaAST.js.map +1 -1
- package/dist/cjs/Scope.js +2 -0
- package/dist/cjs/Scope.js.map +1 -1
- package/dist/cjs/Stream.js +93 -93
- package/dist/cjs/internal/core.js +1 -1
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/schema/util.js +23 -14
- package/dist/cjs/internal/schema/util.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/Array.d.ts +47 -47
- package/dist/dts/Array.d.ts.map +1 -1
- package/dist/dts/Brand.d.ts +14 -6
- package/dist/dts/Brand.d.ts.map +1 -1
- package/dist/dts/Cause.d.ts +1 -0
- package/dist/dts/Cause.d.ts.map +1 -1
- package/dist/dts/Chunk.d.ts +91 -89
- package/dist/dts/Chunk.d.ts.map +1 -1
- package/dist/dts/Config.d.ts +2 -1
- package/dist/dts/Config.d.ts.map +1 -1
- package/dist/dts/Context.d.ts +4 -4
- package/dist/dts/Effect.d.ts +2107 -1621
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Either.d.ts +33 -33
- package/dist/dts/LogLevel.d.ts +3 -3
- package/dist/dts/Logger.d.ts +16 -16
- package/dist/dts/Match.d.ts +26 -26
- package/dist/dts/Option.d.ts +84 -84
- package/dist/dts/Predicate.d.ts.map +1 -1
- package/dist/dts/Schema.d.ts +53 -21
- package/dist/dts/Schema.d.ts.map +1 -1
- package/dist/dts/SchemaAST.d.ts.map +1 -1
- package/dist/dts/Scope.d.ts +2 -0
- package/dist/dts/Scope.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +229 -229
- package/dist/esm/Arbitrary.js +38 -22
- package/dist/esm/Arbitrary.js.map +1 -1
- package/dist/esm/Array.js +50 -50
- package/dist/esm/Array.js.map +1 -1
- package/dist/esm/Brand.js +9 -4
- package/dist/esm/Brand.js.map +1 -1
- package/dist/esm/Cause.js +1 -0
- package/dist/esm/Cause.js.map +1 -1
- package/dist/esm/Chunk.js +25 -23
- package/dist/esm/Chunk.js.map +1 -1
- package/dist/esm/Config.js +2 -1
- package/dist/esm/Config.js.map +1 -1
- package/dist/esm/Context.js +4 -4
- package/dist/esm/Effect.js +845 -648
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Either.js +17 -17
- package/dist/esm/Either.js.map +1 -1
- package/dist/esm/LogLevel.js +1 -1
- package/dist/esm/Logger.js +12 -12
- package/dist/esm/Match.js +26 -26
- package/dist/esm/Option.js +48 -48
- package/dist/esm/Predicate.js +3 -0
- package/dist/esm/Predicate.js.map +1 -1
- package/dist/esm/Schema.js +21 -17
- package/dist/esm/Schema.js.map +1 -1
- package/dist/esm/SchemaAST.js +46 -22
- package/dist/esm/SchemaAST.js.map +1 -1
- package/dist/esm/Scope.js +2 -0
- package/dist/esm/Scope.js.map +1 -1
- package/dist/esm/Stream.js +101 -101
- package/dist/esm/internal/core.js +1 -1
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/schema/util.js +23 -14
- package/dist/esm/internal/schema/util.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/dist/esm/internal/version.js.map +1 -1
- package/package.json +1 -1
- package/src/Arbitrary.ts +39 -24
- package/src/Array.ts +116 -113
- package/src/Brand.ts +14 -6
- package/src/Cause.ts +1 -0
- package/src/Chunk.ts +97 -95
- package/src/Config.ts +2 -1
- package/src/Context.ts +4 -4
- package/src/Effect.ts +2107 -1621
- package/src/Either.ts +34 -34
- package/src/LogLevel.ts +3 -3
- package/src/Logger.ts +16 -16
- package/src/Match.ts +26 -26
- package/src/Option.ts +84 -84
- package/src/Predicate.ts +4 -0
- package/src/Schema.ts +87 -41
- package/src/SchemaAST.ts +47 -22
- package/src/Scope.ts +2 -0
- package/src/Stream.ts +229 -229
- package/src/internal/core.ts +2 -1
- package/src/internal/schema/util.ts +34 -25
- package/src/internal/version.ts +1 -1
package/dist/esm/Option.js
CHANGED
|
@@ -18,11 +18,9 @@ export const TypeId = /*#__PURE__*/Symbol.for("effect/Option");
|
|
|
18
18
|
* This means you can use it in place of any `Option<A>` regardless of the type
|
|
19
19
|
* `A`.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* **Example** (Creating an Option with No Value)
|
|
22
22
|
*
|
|
23
|
-
* @example
|
|
24
23
|
* ```ts
|
|
25
|
-
* // Title: Creating an Option with No Value
|
|
26
24
|
* import { Option } from "effect"
|
|
27
25
|
*
|
|
28
26
|
* // An Option holding no value
|
|
@@ -35,6 +33,8 @@ export const TypeId = /*#__PURE__*/Symbol.for("effect/Option");
|
|
|
35
33
|
* // Output: { _id: 'Option', _tag: 'None' }
|
|
36
34
|
* ```
|
|
37
35
|
*
|
|
36
|
+
* @see {@link some} for the opposite operation.
|
|
37
|
+
*
|
|
38
38
|
* @category Constructors
|
|
39
39
|
* @since 2.0.0
|
|
40
40
|
*/
|
|
@@ -42,11 +42,9 @@ export const none = () => option.none;
|
|
|
42
42
|
/**
|
|
43
43
|
* Wraps the given value into an `Option` to represent its presence.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
45
|
+
* **Example** (Creating an Option with a Value)
|
|
46
46
|
*
|
|
47
|
-
* @example
|
|
48
47
|
* ```ts
|
|
49
|
-
* // Title: Creating an Option with a Value
|
|
50
48
|
* import { Option } from "effect"
|
|
51
49
|
*
|
|
52
50
|
* // An Option holding the number 1
|
|
@@ -59,6 +57,8 @@ export const none = () => option.none;
|
|
|
59
57
|
* // Output: { _id: 'Option', _tag: 'Some', value: 1 }
|
|
60
58
|
* ```
|
|
61
59
|
*
|
|
60
|
+
* @see {@link none} for the opposite operation.
|
|
61
|
+
*
|
|
62
62
|
* @category Constructors
|
|
63
63
|
* @since 2.0.0
|
|
64
64
|
*/
|
|
@@ -94,8 +94,6 @@ export const isOption = option.isOption;
|
|
|
94
94
|
/**
|
|
95
95
|
* Checks whether an `Option` represents the absence of a value (`None`).
|
|
96
96
|
*
|
|
97
|
-
* @see {@link isSome} for the opposite check.
|
|
98
|
-
*
|
|
99
97
|
* @example
|
|
100
98
|
* ```ts
|
|
101
99
|
* import { Option } from "effect"
|
|
@@ -107,6 +105,8 @@ export const isOption = option.isOption;
|
|
|
107
105
|
* // Output: true
|
|
108
106
|
* ```
|
|
109
107
|
*
|
|
108
|
+
* @see {@link isSome} for the opposite check.
|
|
109
|
+
*
|
|
110
110
|
* @category Guards
|
|
111
111
|
* @since 2.0.0
|
|
112
112
|
*/
|
|
@@ -114,8 +114,6 @@ export const isNone = option.isNone;
|
|
|
114
114
|
/**
|
|
115
115
|
* Checks whether an `Option` contains a value (`Some`).
|
|
116
116
|
*
|
|
117
|
-
* @see {@link isNone} for the opposite check.
|
|
118
|
-
*
|
|
119
117
|
* @example
|
|
120
118
|
* ```ts
|
|
121
119
|
* import { Option } from "effect"
|
|
@@ -127,6 +125,8 @@ export const isNone = option.isNone;
|
|
|
127
125
|
* // Output: false
|
|
128
126
|
* ```
|
|
129
127
|
*
|
|
128
|
+
* @see {@link isNone} for the opposite check.
|
|
129
|
+
*
|
|
130
130
|
* @category Guards
|
|
131
131
|
* @since 2.0.0
|
|
132
132
|
*/
|
|
@@ -151,9 +151,9 @@ export const isSome = option.isSome;
|
|
|
151
151
|
* without resorting to `if` or manual checks, making your code more declarative
|
|
152
152
|
* and readable.
|
|
153
153
|
*
|
|
154
|
-
*
|
|
154
|
+
* **Example** (Pattern Matching with Option)
|
|
155
|
+
*
|
|
155
156
|
* ```ts
|
|
156
|
-
* // Title: Pattern Matching with Option
|
|
157
157
|
* import { Option } from "effect"
|
|
158
158
|
*
|
|
159
159
|
* const foo = Option.some(1)
|
|
@@ -271,8 +271,6 @@ export const fromIterable = collection => {
|
|
|
271
271
|
* using this function, you can convert `Either` into a simpler structure for
|
|
272
272
|
* cases where error handling is not required.
|
|
273
273
|
*
|
|
274
|
-
* @see {@link getLeft} for the opposite operation.
|
|
275
|
-
*
|
|
276
274
|
* @example
|
|
277
275
|
* ```ts
|
|
278
276
|
* import { Either, Option } from "effect"
|
|
@@ -284,6 +282,8 @@ export const fromIterable = collection => {
|
|
|
284
282
|
* // Output: { _id: 'Option', _tag: 'None' }
|
|
285
283
|
* ```
|
|
286
284
|
*
|
|
285
|
+
* @see {@link getLeft} for the opposite operation.
|
|
286
|
+
*
|
|
287
287
|
* @category Conversions
|
|
288
288
|
* @since 2.0.0
|
|
289
289
|
*/
|
|
@@ -304,8 +304,6 @@ export const getRight = either.getRight;
|
|
|
304
304
|
* `Either` and want to handle it as an `Option`. By discarding the right value,
|
|
305
305
|
* it simplifies error-focused workflows.
|
|
306
306
|
*
|
|
307
|
-
* @see {@link getRight} for the opposite operation.
|
|
308
|
-
*
|
|
309
307
|
* @example
|
|
310
308
|
* ```ts
|
|
311
309
|
* import { Either, Option } from "effect"
|
|
@@ -317,6 +315,8 @@ export const getRight = either.getRight;
|
|
|
317
315
|
* // Output: { _id: 'Option', _tag: 'Some', value: 'err' }
|
|
318
316
|
* ```
|
|
319
317
|
*
|
|
318
|
+
* @see {@link getRight} for the opposite operation.
|
|
319
|
+
*
|
|
320
320
|
* @category Conversions
|
|
321
321
|
* @since 2.0.0
|
|
322
322
|
*/
|
|
@@ -337,9 +337,6 @@ export const getLeft = either.getLeft;
|
|
|
337
337
|
* value. It is particularly useful for providing default values or alternative
|
|
338
338
|
* logic when working with optional values.
|
|
339
339
|
*
|
|
340
|
-
* @see {@link getOrNull} for a version that returns `null` instead of executing a function.
|
|
341
|
-
* @see {@link getOrUndefined} for a version that returns `undefined` instead of executing a function.
|
|
342
|
-
*
|
|
343
340
|
* @example
|
|
344
341
|
* ```ts
|
|
345
342
|
* import { Option } from "effect"
|
|
@@ -351,6 +348,9 @@ export const getLeft = either.getLeft;
|
|
|
351
348
|
* // Output: 0
|
|
352
349
|
* ```
|
|
353
350
|
*
|
|
351
|
+
* @see {@link getOrNull} for a version that returns `null` instead of executing a function.
|
|
352
|
+
* @see {@link getOrUndefined} for a version that returns `undefined` instead of executing a function.
|
|
353
|
+
*
|
|
354
354
|
* @category Getters
|
|
355
355
|
* @since 2.0.0
|
|
356
356
|
*/
|
|
@@ -644,8 +644,6 @@ export const liftThrowable = f => (...a) => {
|
|
|
644
644
|
* a fail-fast behavior for empty `Option` values and want to provide a custom
|
|
645
645
|
* error message or object.
|
|
646
646
|
*
|
|
647
|
-
* @see {@link getOrThrow} for a version that throws a default error.
|
|
648
|
-
*
|
|
649
647
|
* @example
|
|
650
648
|
* ```ts
|
|
651
649
|
* import * as assert from "node:assert"
|
|
@@ -658,6 +656,8 @@ export const liftThrowable = f => (...a) => {
|
|
|
658
656
|
* assert.throws(() => Option.getOrThrowWith(Option.none(), () => new Error('Unexpected None')))
|
|
659
657
|
* ```
|
|
660
658
|
*
|
|
659
|
+
* @see {@link getOrThrow} for a version that throws a default error.
|
|
660
|
+
*
|
|
661
661
|
* @category Conversions
|
|
662
662
|
* @since 2.0.0
|
|
663
663
|
*/
|
|
@@ -678,8 +678,6 @@ export const getOrThrowWith = /*#__PURE__*/dual(2, (self, onNone) => {
|
|
|
678
678
|
* scenarios where the absence of a value is treated as an exceptional case and
|
|
679
679
|
* a default error is sufficient.
|
|
680
680
|
*
|
|
681
|
-
* @see {@link getOrThrowWith} for a version that allows you to provide a custom error.
|
|
682
|
-
*
|
|
683
681
|
* @example
|
|
684
682
|
* ```ts
|
|
685
683
|
* import * as assert from "node:assert"
|
|
@@ -689,6 +687,8 @@ export const getOrThrowWith = /*#__PURE__*/dual(2, (self, onNone) => {
|
|
|
689
687
|
* assert.throws(() => Option.getOrThrow(Option.none()))
|
|
690
688
|
* ```
|
|
691
689
|
*
|
|
690
|
+
* @see {@link getOrThrowWith} for a version that allows you to provide a custom error.
|
|
691
|
+
*
|
|
692
692
|
* @category Conversions
|
|
693
693
|
* @since 2.0.0
|
|
694
694
|
*/
|
|
@@ -1351,9 +1351,9 @@ export const filter = /*#__PURE__*/dual(2, (self, predicate) => filterMap(self,
|
|
|
1351
1351
|
* - Two `Some` values are equivalent if their inner values are equivalent
|
|
1352
1352
|
* according to the provided `Equivalence`.
|
|
1353
1353
|
*
|
|
1354
|
-
*
|
|
1354
|
+
* **Example** (Comparing Optional Numbers for Equivalence)
|
|
1355
|
+
*
|
|
1355
1356
|
* ```ts
|
|
1356
|
-
* // Title: Comparing Optional Numbers for Equivalence
|
|
1357
1357
|
* import { Number, Option } from "effect"
|
|
1358
1358
|
*
|
|
1359
1359
|
* const isEquivalent = Option.getEquivalence(Number.Equivalence)
|
|
@@ -1497,8 +1497,6 @@ export const liftPredicate = /*#__PURE__*/dual(2, (b, predicate) => predicate(b)
|
|
|
1497
1497
|
* equivalence function returns `true`, the result is `true`. If the `Option` is
|
|
1498
1498
|
* `None` or the values are not equivalent, the result is `false`.
|
|
1499
1499
|
*
|
|
1500
|
-
* @see {@link contains} for a version that uses the default `Equivalence`.
|
|
1501
|
-
*
|
|
1502
1500
|
* @example
|
|
1503
1501
|
* ```ts
|
|
1504
1502
|
* import { Number, Option } from "effect"
|
|
@@ -1515,6 +1513,8 @@ export const liftPredicate = /*#__PURE__*/dual(2, (b, predicate) => predicate(b)
|
|
|
1515
1513
|
* // Output: false
|
|
1516
1514
|
* ```
|
|
1517
1515
|
*
|
|
1516
|
+
* @see {@link contains} for a version that uses the default `Equivalence`.
|
|
1517
|
+
*
|
|
1518
1518
|
* @category Elements
|
|
1519
1519
|
* @since 2.0.0
|
|
1520
1520
|
*/
|
|
@@ -1532,8 +1532,6 @@ const _equivalence = /*#__PURE__*/Equal.equivalence();
|
|
|
1532
1532
|
* result is `true`. If the `Option` is `None` or the values are not equivalent,
|
|
1533
1533
|
* the result is `false`.
|
|
1534
1534
|
*
|
|
1535
|
-
* @see {@link containsWith} for a version that allows you to specify a custom equivalence function.
|
|
1536
|
-
*
|
|
1537
1535
|
* @example
|
|
1538
1536
|
* ```ts
|
|
1539
1537
|
* import { Option } from "effect"
|
|
@@ -1548,6 +1546,8 @@ const _equivalence = /*#__PURE__*/Equal.equivalence();
|
|
|
1548
1546
|
* // Output: false
|
|
1549
1547
|
* ```
|
|
1550
1548
|
*
|
|
1549
|
+
* @see {@link containsWith} for a version that allows you to specify a custom equivalence function.
|
|
1550
|
+
*
|
|
1551
1551
|
* @category Elements
|
|
1552
1552
|
* @since 2.0.0
|
|
1553
1553
|
*/
|
|
@@ -1599,10 +1599,6 @@ export const exists = /*#__PURE__*/dual(2, (self, refinement) => isNone(self) ?
|
|
|
1599
1599
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
1600
1600
|
* 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
|
|
1601
1601
|
*
|
|
1602
|
-
* @see {@link Do}
|
|
1603
|
-
* @see {@link bind}
|
|
1604
|
-
* @see {@link let_ let}
|
|
1605
|
-
*
|
|
1606
1602
|
* @example
|
|
1607
1603
|
* ```ts
|
|
1608
1604
|
* import * as assert from "node:assert"
|
|
@@ -1618,6 +1614,10 @@ export const exists = /*#__PURE__*/dual(2, (self, refinement) => isNone(self) ?
|
|
|
1618
1614
|
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1619
1615
|
* ```
|
|
1620
1616
|
*
|
|
1617
|
+
* @see {@link Do}
|
|
1618
|
+
* @see {@link bind}
|
|
1619
|
+
* @see {@link let_ let}
|
|
1620
|
+
*
|
|
1621
1621
|
* @category Do notation
|
|
1622
1622
|
* @since 2.0.0
|
|
1623
1623
|
*/
|
|
@@ -1635,10 +1635,6 @@ export {
|
|
|
1635
1635
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
1636
1636
|
* 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
|
|
1637
1637
|
*
|
|
1638
|
-
* @see {@link Do}
|
|
1639
|
-
* @see {@link bind}
|
|
1640
|
-
* @see {@link bindTo}
|
|
1641
|
-
*
|
|
1642
1638
|
* @example
|
|
1643
1639
|
* ```ts
|
|
1644
1640
|
* import * as assert from "node:assert"
|
|
@@ -1652,8 +1648,12 @@ export {
|
|
|
1652
1648
|
* Option.filter(({ x, y }) => x * y > 5)
|
|
1653
1649
|
* )
|
|
1654
1650
|
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1655
|
-
*
|
|
1656
1651
|
* ```
|
|
1652
|
+
*
|
|
1653
|
+
* @see {@link Do}
|
|
1654
|
+
* @see {@link bind}
|
|
1655
|
+
* @see {@link bindTo}
|
|
1656
|
+
*
|
|
1657
1657
|
* @category Do notation
|
|
1658
1658
|
* @since 2.0.0
|
|
1659
1659
|
*/
|
|
@@ -1669,10 +1669,6 @@ let_ as let };
|
|
|
1669
1669
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
1670
1670
|
* 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
|
|
1671
1671
|
*
|
|
1672
|
-
* @see {@link Do}
|
|
1673
|
-
* @see {@link bindTo}
|
|
1674
|
-
* @see {@link let_ let}
|
|
1675
|
-
*
|
|
1676
1672
|
* @example
|
|
1677
1673
|
* ```ts
|
|
1678
1674
|
* import * as assert from "node:assert"
|
|
@@ -1688,6 +1684,10 @@ let_ as let };
|
|
|
1688
1684
|
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1689
1685
|
* ```
|
|
1690
1686
|
*
|
|
1687
|
+
* @see {@link Do}
|
|
1688
|
+
* @see {@link bindTo}
|
|
1689
|
+
* @see {@link let_ let}
|
|
1690
|
+
*
|
|
1691
1691
|
* @category Do notation
|
|
1692
1692
|
* @since 2.0.0
|
|
1693
1693
|
*/
|
|
@@ -1703,10 +1703,6 @@ export const bind = /*#__PURE__*/doNotation.bind(map, flatMap);
|
|
|
1703
1703
|
* 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
|
|
1704
1704
|
* 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
|
|
1705
1705
|
*
|
|
1706
|
-
* @see {@link bindTo}
|
|
1707
|
-
* @see {@link bind}
|
|
1708
|
-
* @see {@link let_ let}
|
|
1709
|
-
*
|
|
1710
1706
|
* @example
|
|
1711
1707
|
* ```ts
|
|
1712
1708
|
* import * as assert from "node:assert"
|
|
@@ -1722,6 +1718,10 @@ export const bind = /*#__PURE__*/doNotation.bind(map, flatMap);
|
|
|
1722
1718
|
* assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))
|
|
1723
1719
|
* ```
|
|
1724
1720
|
*
|
|
1721
|
+
* @see {@link bindTo}
|
|
1722
|
+
* @see {@link bind}
|
|
1723
|
+
* @see {@link let_ let}
|
|
1724
|
+
*
|
|
1725
1725
|
* @category Do notation
|
|
1726
1726
|
* @since 2.0.0
|
|
1727
1727
|
*/
|
|
@@ -1733,9 +1733,9 @@ const adapter = /*#__PURE__*/Gen.adapter();
|
|
|
1733
1733
|
* involves `Option` easier to write and understand. This approach is similar to
|
|
1734
1734
|
* using `async/await` but tailored for `Option`.
|
|
1735
1735
|
*
|
|
1736
|
-
*
|
|
1736
|
+
* **Example** (Using `Option.gen` to Create a Combined Value)
|
|
1737
|
+
*
|
|
1737
1738
|
* ```ts
|
|
1738
|
-
* // Title: Using Option.gen to Create a Combined Value
|
|
1739
1739
|
* import { Option } from "effect"
|
|
1740
1740
|
*
|
|
1741
1741
|
* const maybeName: Option.Option<string> = Option.some("John")
|
package/dist/esm/Predicate.js
CHANGED
|
@@ -211,6 +211,9 @@ export const isBigInt = input => typeof input === "bigint";
|
|
|
211
211
|
* @since 2.0.0
|
|
212
212
|
*/
|
|
213
213
|
export const isSymbol = input => typeof input === "symbol";
|
|
214
|
+
// TODO: make public
|
|
215
|
+
/** @internal */
|
|
216
|
+
export const isPropertyKey = u => isString(u) || isNumber(u) || isSymbol(u);
|
|
214
217
|
/**
|
|
215
218
|
* Tests if a value is a `function`.
|
|
216
219
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Predicate.js","names":["dual","isFunction","isFunction_","mapInput","self","f","b","isTupleOf","n","length","isTupleOfAtLeast","isTruthy","input","isSet","Set","isMap","Map","isString","isNumber","isBoolean","isBigInt","isSymbol","isUndefined","undefined","isNotUndefined","isNull","isNotNull","isNever","_","isUnknown","isRecordOrArray","isObject","hasProperty","property","isTagged","tag","isNullable","isNotNullable","isError","Error","isUint8Array","Uint8Array","isDate","Date","isIterable","Symbol","iterator","isRecord","Array","isArray","isReadonlyRecord","isPromise","then","catch","isPromiseLike","isRegExp","RegExp","compose","ab","bc","a","product","that","all","collection","as","collectionIndex","p","productMany","rest","head","tail","tuple","elements","struct","fields","keys","Object","key","not","or","and","xor","eqv","implies","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K,SAAS;AAEzF;;;;;;;;;;;;;;;;AAgBA,OAAO,MAAMQ,QAAQ,GAAIR,KAAc,IAAsB,OAAOA,KAAK,KAAK,QAAQ;AAEtF;;;;;;;;;;;;;;;;AAgBA,OAAO,MAAMS,QAAQ,GAAIT,KAAc,IAAsB,OAAOA,KAAK,KAAK,QAAQ;AAEtF;;;;;;;;;;;;;;;;AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"Predicate.js","names":["dual","isFunction","isFunction_","mapInput","self","f","b","isTupleOf","n","length","isTupleOfAtLeast","isTruthy","input","isSet","Set","isMap","Map","isString","isNumber","isBoolean","isBigInt","isSymbol","isPropertyKey","u","isUndefined","undefined","isNotUndefined","isNull","isNotNull","isNever","_","isUnknown","isRecordOrArray","isObject","hasProperty","property","isTagged","tag","isNullable","isNotNullable","isError","Error","isUint8Array","Uint8Array","isDate","Date","isIterable","Symbol","iterator","isRecord","Array","isArray","isReadonlyRecord","isPromise","then","catch","isPromiseLike","isRegExp","RegExp","compose","ab","bc","a","product","that","all","collection","as","collectionIndex","p","productMany","rest","head","tail","tuple","elements","struct","fields","keys","Object","key","not","or","and","xor","eqv","implies","antecedent","consequent","nor","nand","every","some"],"sources":["../../src/Predicate.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,SAASA,IAAI,EAAEC,UAAU,IAAIC,WAAW,QAAQ,eAAe;AAmE/D;;;;;;;;;;;;;;;;;;;AAmBA,OAAO,MAAMC,QAAQ,gBAyCjBH,IAAI,CAAC,CAAC,EAAE,CAAOI,IAAkB,EAAEC,CAAc,KAAoBC,CAAC,IAAKF,IAAI,CAACC,CAAC,CAACC,CAAC,CAAC,CAAC,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,SAAS,gBAmDlBP,IAAI,CAAC,CAAC,EAAE,CAAsBI,IAAsB,EAAEI,CAAI,KAA4BJ,IAAI,CAACK,MAAM,KAAKD,CAAC,CAAC;AAE5G;;;;;;;;;;;;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AiGhBtF,IAAI,CACN,CAAC,EACD,CAAIuF,UAAwB,EAAEC,UAAwB,KAAoB1B,CAAC,IAAKyB,UAAU,CAACzB,CAAC,CAAC,GAAG0B,UAAU,CAAC1B,CAAC,CAAC,GAAG,IAAI,CACrH;AAED;;;;AAIA,OAAO,MAAM2B,GAAG,gBAWZzF,IAAI,CACN,CAAC,EACD,CAAII,IAAkB,EAAE4D,IAAkB,KAAoBF,CAAC,IAAK,EAAE1D,IAAI,CAAC0D,CAAC,CAAC,IAAIE,IAAI,CAACF,CAAC,CAAC,CAAC,CAC1F;AAED;;;;AAIA,OAAO,MAAM4B,IAAI,gBAWb1F,IAAI,CACN,CAAC,EACD,CAAII,IAAkB,EAAE4D,IAAkB,KAAoBF,CAAC,IAAK,EAAE1D,IAAI,CAAC0D,CAAC,CAAC,IAAIE,IAAI,CAACF,CAAC,CAAC,CAAC,CAC1F;AAED;;;;AAIA,OAAO,MAAM6B,KAAK,GAAOzB,UAAkC,IAAoBJ,CAAI,IAAI;EACrF,KAAK,MAAMO,CAAC,IAAIH,UAAU,EAAE;IAC1B,IAAI,CAACG,CAAC,CAACP,CAAC,CAAC,EAAE;MACT,OAAO,KAAK;IACd;EACF;EACA,OAAO,IAAI;AACb,CAAC;AAED;;;;AAIA,OAAO,MAAM8B,IAAI,GAAO1B,UAAkC,IAAoBJ,CAAC,IAAI;EACjF,KAAK,MAAMO,CAAC,IAAIH,UAAU,EAAE;IAC1B,IAAIG,CAAC,CAACP,CAAC,CAAC,EAAE;MACR,OAAO,IAAI;IACb;EACF;EACA,OAAO,KAAK;AACd,CAAC","ignoreList":[]}
|
package/dist/esm/Schema.js
CHANGED
|
@@ -1297,7 +1297,7 @@ const lazilyMergeDefaults = (fields, out) => {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
return out;
|
|
1299
1299
|
};
|
|
1300
|
-
|
|
1300
|
+
function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fields, records)) {
|
|
1301
1301
|
return class TypeLiteralClass extends make(ast) {
|
|
1302
1302
|
static annotations(annotations) {
|
|
1303
1303
|
return makeTypeLiteralClass(this.fields, this.records, mergeSchemaAnnotations(this.ast, annotations));
|
|
@@ -1319,7 +1319,7 @@ const makeTypeLiteralClass = (fields, records, ast = getDefaultTypeLiteralAST(fi
|
|
|
1319
1319
|
return Struct(struct_.omit(fields, ...keys));
|
|
1320
1320
|
}
|
|
1321
1321
|
};
|
|
1322
|
-
}
|
|
1322
|
+
}
|
|
1323
1323
|
export function Struct(fields, ...records) {
|
|
1324
1324
|
return makeTypeLiteralClass(fields, records);
|
|
1325
1325
|
}
|
|
@@ -1328,8 +1328,6 @@ export function Struct(fields, ...records) {
|
|
|
1328
1328
|
* A tag is a literal value that is used to distinguish between different types of objects.
|
|
1329
1329
|
* The tag is optional when using the `make` method.
|
|
1330
1330
|
*
|
|
1331
|
-
* @see {@link TaggedStruct}
|
|
1332
|
-
*
|
|
1333
1331
|
* @example
|
|
1334
1332
|
* ```ts
|
|
1335
1333
|
* import * as assert from "node:assert"
|
|
@@ -1344,6 +1342,8 @@ export function Struct(fields, ...records) {
|
|
|
1344
1342
|
* assert.deepStrictEqual(User.make({ name: "John", age: 44 }), { _tag: "User", name: "John", age: 44 })
|
|
1345
1343
|
* ```
|
|
1346
1344
|
*
|
|
1345
|
+
* @see {@link TaggedStruct}
|
|
1346
|
+
*
|
|
1347
1347
|
* @since 3.10.0
|
|
1348
1348
|
*/
|
|
1349
1349
|
export const tag = tag => Literal(tag).pipe(propertySignature, withConstructorDefault(() => tag));
|
|
@@ -1372,16 +1372,18 @@ export const TaggedStruct = (value, fields) => Struct({
|
|
|
1372
1372
|
_tag: tag(value),
|
|
1373
1373
|
...fields
|
|
1374
1374
|
});
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1375
|
+
function makeRecordClass(key, value, ast) {
|
|
1376
|
+
return class RecordClass extends makeTypeLiteralClass({}, [{
|
|
1377
|
+
key,
|
|
1378
|
+
value
|
|
1379
|
+
}], ast) {
|
|
1380
|
+
static annotations(annotations) {
|
|
1381
|
+
return makeRecordClass(key, value, mergeSchemaAnnotations(this.ast, annotations));
|
|
1382
|
+
}
|
|
1383
|
+
static key = key;
|
|
1384
|
+
static value = value;
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1385
1387
|
/**
|
|
1386
1388
|
* @category constructors
|
|
1387
1389
|
* @since 3.10.0
|
|
@@ -4979,7 +4981,8 @@ const makeClass = ({
|
|
|
4979
4981
|
value() {
|
|
4980
4982
|
return `${identifier}({ ${util_.ownKeys(fields).map(p => `${util_.formatPropertyKey(p)}: ${util_.formatUnknown(this[p])}`).join(", ")} })`;
|
|
4981
4983
|
},
|
|
4982
|
-
configurable: true
|
|
4984
|
+
configurable: true,
|
|
4985
|
+
writable: true
|
|
4983
4986
|
});
|
|
4984
4987
|
}
|
|
4985
4988
|
return klass;
|
|
@@ -5530,6 +5533,7 @@ export function SortedSet(value, ordA) {
|
|
|
5530
5533
|
* Uses `!!val` to coerce the value to a `boolean`.
|
|
5531
5534
|
*
|
|
5532
5535
|
* @see https://developer.mozilla.org/docs/Glossary/Truthy
|
|
5536
|
+
*
|
|
5533
5537
|
* @category boolean constructors
|
|
5534
5538
|
* @since 3.10.0
|
|
5535
5539
|
*/
|
|
@@ -5836,8 +5840,8 @@ const go = (ast, path) => {
|
|
|
5836
5840
|
let bStringKeys;
|
|
5837
5841
|
for (let i = 0; i < indexSignatures.length; i++) {
|
|
5838
5842
|
const is = ast.indexSignatures[i];
|
|
5839
|
-
const
|
|
5840
|
-
const isSymbol = AST.isSymbolKeyword(
|
|
5843
|
+
const encodedParameter = AST.getEncodedParameter(is.parameter);
|
|
5844
|
+
const isSymbol = AST.isSymbolKeyword(encodedParameter);
|
|
5841
5845
|
if (isSymbol) {
|
|
5842
5846
|
bSymbolKeys = bSymbolKeys || Object.getOwnPropertySymbols(b);
|
|
5843
5847
|
if (aSymbolKeys.length !== bSymbolKeys.length) {
|