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/src/Brand.ts
CHANGED
|
@@ -192,7 +192,8 @@ export const errors: (...errors: Array<Brand.BrandErrors>) => Brand.BrandErrors
|
|
|
192
192
|
* If you don't want to perform any validation but only distinguish between two values of the same type but with different meanings,
|
|
193
193
|
* see {@link nominal}.
|
|
194
194
|
*
|
|
195
|
-
*
|
|
195
|
+
* **Example**
|
|
196
|
+
*
|
|
196
197
|
* ```ts
|
|
197
198
|
* import * as assert from "node:assert"
|
|
198
199
|
* import { Brand } from "effect"
|
|
@@ -204,7 +205,9 @@ export const errors: (...errors: Array<Brand.BrandErrors>) => Brand.BrandErrors
|
|
|
204
205
|
* (n) => Brand.error(`Expected ${n} to be an integer`)
|
|
205
206
|
* )
|
|
206
207
|
*
|
|
207
|
-
*
|
|
208
|
+
* console.log(Int(1))
|
|
209
|
+
* // 1
|
|
210
|
+
*
|
|
208
211
|
* assert.throws(() => Int(1.1))
|
|
209
212
|
* ```
|
|
210
213
|
*
|
|
@@ -246,7 +249,8 @@ export function refined<A extends Brand<any>>(
|
|
|
246
249
|
*
|
|
247
250
|
* If you also want to perform some validation, see {@link refined}.
|
|
248
251
|
*
|
|
249
|
-
*
|
|
252
|
+
* **Example**
|
|
253
|
+
*
|
|
250
254
|
* ```ts
|
|
251
255
|
* import * as assert from "node:assert"
|
|
252
256
|
* import { Brand } from "effect"
|
|
@@ -255,7 +259,8 @@ export function refined<A extends Brand<any>>(
|
|
|
255
259
|
*
|
|
256
260
|
* const UserId = Brand.nominal<UserId>()
|
|
257
261
|
*
|
|
258
|
-
*
|
|
262
|
+
* console.log(UserId(1))
|
|
263
|
+
* // 1
|
|
259
264
|
* ```
|
|
260
265
|
*
|
|
261
266
|
* @since 2.0.0
|
|
@@ -277,7 +282,8 @@ export const nominal = <A extends Brand<any>>(): Brand.Constructor<
|
|
|
277
282
|
* Combines two or more brands together to form a single branded type.
|
|
278
283
|
* This API is useful when you want to validate that the input data passes multiple brand validators.
|
|
279
284
|
*
|
|
280
|
-
*
|
|
285
|
+
* **Example**
|
|
286
|
+
*
|
|
281
287
|
* ```ts
|
|
282
288
|
* import * as assert from "node:assert"
|
|
283
289
|
* import { Brand } from "effect"
|
|
@@ -295,7 +301,9 @@ export const nominal = <A extends Brand<any>>(): Brand.Constructor<
|
|
|
295
301
|
*
|
|
296
302
|
* const PositiveInt = Brand.all(Int, Positive)
|
|
297
303
|
*
|
|
298
|
-
*
|
|
304
|
+
* console.log(PositiveInt(1))
|
|
305
|
+
* // 1
|
|
306
|
+
*
|
|
299
307
|
* assert.throws(() => PositiveInt(1.1))
|
|
300
308
|
* ```
|
|
301
309
|
*
|
package/src/Cause.ts
CHANGED
package/src/Chunk.ts
CHANGED
|
@@ -360,14 +360,16 @@ const reverseChunk = <A>(self: Chunk<A>): Chunk<A> => {
|
|
|
360
360
|
* Reverses the order of elements in a `Chunk`.
|
|
361
361
|
* Importantly, if the input chunk is a `NonEmptyChunk`, the reversed chunk will also be a `NonEmptyChunk`.
|
|
362
362
|
*
|
|
363
|
-
*
|
|
363
|
+
* **Example**
|
|
364
|
+
*
|
|
364
365
|
* ```ts
|
|
365
|
-
* import * as assert from "node:assert"
|
|
366
366
|
* import { Chunk } from "effect"
|
|
367
367
|
*
|
|
368
|
-
* const
|
|
369
|
-
* const
|
|
370
|
-
*
|
|
368
|
+
* const chunk = Chunk.make(1, 2, 3)
|
|
369
|
+
* const result = Chunk.reverse(chunk)
|
|
370
|
+
*
|
|
371
|
+
* console.log(result)
|
|
372
|
+
* // { _id: 'Chunk', values: [ 3, 2, 1 ] }
|
|
371
373
|
* ```
|
|
372
374
|
*
|
|
373
375
|
* @since 2.0.0
|
|
@@ -678,15 +680,15 @@ export const dropWhile: {
|
|
|
678
680
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
679
681
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
680
682
|
*
|
|
681
|
-
*
|
|
683
|
+
* **Example**
|
|
684
|
+
*
|
|
682
685
|
* ```ts
|
|
683
|
-
* import * as assert from "node:assert"
|
|
684
686
|
* import { Chunk } from "effect"
|
|
685
687
|
*
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
688
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
689
|
+
*
|
|
690
|
+
* console.log(result)
|
|
691
|
+
* // [ "a", "b", 1, 2 ]
|
|
690
692
|
* ```
|
|
691
693
|
*
|
|
692
694
|
* @category concatenating
|
|
@@ -697,15 +699,15 @@ export const prependAll: {
|
|
|
697
699
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
698
700
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
699
701
|
*
|
|
700
|
-
*
|
|
702
|
+
* **Example**
|
|
703
|
+
*
|
|
701
704
|
* ```ts
|
|
702
|
-
* import * as assert from "node:assert"
|
|
703
705
|
* import { Chunk } from "effect"
|
|
704
706
|
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
*
|
|
707
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
708
|
+
*
|
|
709
|
+
* console.log(result)
|
|
710
|
+
* // [ "a", "b", 1, 2 ]
|
|
709
711
|
* ```
|
|
710
712
|
*
|
|
711
713
|
* @category concatenating
|
|
@@ -716,15 +718,15 @@ export const prependAll: {
|
|
|
716
718
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
717
719
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
718
720
|
*
|
|
719
|
-
*
|
|
721
|
+
* **Example**
|
|
722
|
+
*
|
|
720
723
|
* ```ts
|
|
721
|
-
* import * as assert from "node:assert"
|
|
722
724
|
* import { Chunk } from "effect"
|
|
723
725
|
*
|
|
724
|
-
*
|
|
725
|
-
*
|
|
726
|
-
*
|
|
727
|
-
*
|
|
726
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
727
|
+
*
|
|
728
|
+
* console.log(result)
|
|
729
|
+
* // [ "a", "b", 1, 2 ]
|
|
728
730
|
* ```
|
|
729
731
|
*
|
|
730
732
|
* @category concatenating
|
|
@@ -735,15 +737,15 @@ export const prependAll: {
|
|
|
735
737
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
736
738
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
737
739
|
*
|
|
738
|
-
*
|
|
740
|
+
* **Example**
|
|
741
|
+
*
|
|
739
742
|
* ```ts
|
|
740
|
-
* import * as assert from "node:assert"
|
|
741
743
|
* import { Chunk } from "effect"
|
|
742
744
|
*
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
*
|
|
745
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
746
|
+
*
|
|
747
|
+
* console.log(result)
|
|
748
|
+
* // [ "a", "b", 1, 2 ]
|
|
747
749
|
* ```
|
|
748
750
|
*
|
|
749
751
|
* @category concatenating
|
|
@@ -754,15 +756,15 @@ export const prependAll: {
|
|
|
754
756
|
* Prepends the specified prefix chunk to the beginning of the specified chunk.
|
|
755
757
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
756
758
|
*
|
|
757
|
-
*
|
|
759
|
+
* **Example**
|
|
760
|
+
*
|
|
758
761
|
* ```ts
|
|
759
|
-
* import * as assert from "node:assert"
|
|
760
762
|
* import { Chunk } from "effect"
|
|
761
763
|
*
|
|
762
|
-
*
|
|
763
|
-
*
|
|
764
|
-
*
|
|
765
|
-
*
|
|
764
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
765
|
+
*
|
|
766
|
+
* console.log(result)
|
|
767
|
+
* // [ "a", "b", 1, 2 ]
|
|
766
768
|
* ```
|
|
767
769
|
*
|
|
768
770
|
* @category concatenating
|
|
@@ -775,15 +777,15 @@ export const prependAll: {
|
|
|
775
777
|
* Concatenates two chunks, combining their elements.
|
|
776
778
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
777
779
|
*
|
|
778
|
-
*
|
|
780
|
+
* **Example**
|
|
781
|
+
*
|
|
779
782
|
* ```ts
|
|
780
|
-
* import * as assert from "node:assert"
|
|
781
783
|
* import { Chunk } from "effect"
|
|
782
784
|
*
|
|
783
|
-
*
|
|
784
|
-
*
|
|
785
|
-
*
|
|
786
|
-
*
|
|
785
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
786
|
+
*
|
|
787
|
+
* console.log(result)
|
|
788
|
+
* // [ 1, 2, "a", "b" ]
|
|
787
789
|
* ```
|
|
788
790
|
*
|
|
789
791
|
* @category concatenating
|
|
@@ -794,15 +796,15 @@ export const appendAll: {
|
|
|
794
796
|
* Concatenates two chunks, combining their elements.
|
|
795
797
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
796
798
|
*
|
|
797
|
-
*
|
|
799
|
+
* **Example**
|
|
800
|
+
*
|
|
798
801
|
* ```ts
|
|
799
|
-
* import * as assert from "node:assert"
|
|
800
802
|
* import { Chunk } from "effect"
|
|
801
803
|
*
|
|
802
|
-
*
|
|
803
|
-
*
|
|
804
|
-
*
|
|
805
|
-
*
|
|
804
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
805
|
+
*
|
|
806
|
+
* console.log(result)
|
|
807
|
+
* // [ 1, 2, "a", "b" ]
|
|
806
808
|
* ```
|
|
807
809
|
*
|
|
808
810
|
* @category concatenating
|
|
@@ -813,15 +815,15 @@ export const appendAll: {
|
|
|
813
815
|
* Concatenates two chunks, combining their elements.
|
|
814
816
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
815
817
|
*
|
|
816
|
-
*
|
|
818
|
+
* **Example**
|
|
819
|
+
*
|
|
817
820
|
* ```ts
|
|
818
|
-
* import * as assert from "node:assert"
|
|
819
821
|
* import { Chunk } from "effect"
|
|
820
822
|
*
|
|
821
|
-
*
|
|
822
|
-
*
|
|
823
|
-
*
|
|
824
|
-
*
|
|
823
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
824
|
+
*
|
|
825
|
+
* console.log(result)
|
|
826
|
+
* // [ 1, 2, "a", "b" ]
|
|
825
827
|
* ```
|
|
826
828
|
*
|
|
827
829
|
* @category concatenating
|
|
@@ -832,15 +834,15 @@ export const appendAll: {
|
|
|
832
834
|
* Concatenates two chunks, combining their elements.
|
|
833
835
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
834
836
|
*
|
|
835
|
-
*
|
|
837
|
+
* **Example**
|
|
838
|
+
*
|
|
836
839
|
* ```ts
|
|
837
|
-
* import * as assert from "node:assert"
|
|
838
840
|
* import { Chunk } from "effect"
|
|
839
841
|
*
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
*
|
|
843
|
-
*
|
|
842
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
843
|
+
*
|
|
844
|
+
* console.log(result)
|
|
845
|
+
* // [ 1, 2, "a", "b" ]
|
|
844
846
|
* ```
|
|
845
847
|
*
|
|
846
848
|
* @category concatenating
|
|
@@ -851,15 +853,15 @@ export const appendAll: {
|
|
|
851
853
|
* Concatenates two chunks, combining their elements.
|
|
852
854
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
853
855
|
*
|
|
854
|
-
*
|
|
856
|
+
* **Example**
|
|
857
|
+
*
|
|
855
858
|
* ```ts
|
|
856
|
-
* import * as assert from "node:assert"
|
|
857
859
|
* import { Chunk } from "effect"
|
|
858
860
|
*
|
|
859
|
-
*
|
|
860
|
-
*
|
|
861
|
-
*
|
|
862
|
-
*
|
|
861
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
862
|
+
*
|
|
863
|
+
* console.log(result)
|
|
864
|
+
* // [ 1, 2, "a", "b" ]
|
|
863
865
|
* ```
|
|
864
866
|
*
|
|
865
867
|
* @category concatenating
|
|
@@ -879,15 +881,15 @@ export const appendAll: {
|
|
|
879
881
|
* Concatenates two chunks, combining their elements.
|
|
880
882
|
* If either chunk is non-empty, the result is also a non-empty chunk.
|
|
881
883
|
*
|
|
882
|
-
*
|
|
884
|
+
* **Example**
|
|
885
|
+
*
|
|
883
886
|
* ```ts
|
|
884
|
-
* import * as assert from "node:assert"
|
|
885
887
|
* import { Chunk } from "effect"
|
|
886
888
|
*
|
|
887
|
-
*
|
|
888
|
-
*
|
|
889
|
-
*
|
|
890
|
-
*
|
|
889
|
+
* const result = Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make("a", "b")), Chunk.toArray)
|
|
890
|
+
*
|
|
891
|
+
* console.log(result)
|
|
892
|
+
* // [ 1, 2, "a", "b" ]
|
|
891
893
|
* ```
|
|
892
894
|
*
|
|
893
895
|
* @category concatenating
|
|
@@ -1294,15 +1296,15 @@ export declare namespace Chunk {
|
|
|
1294
1296
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
1295
1297
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
1296
1298
|
*
|
|
1297
|
-
*
|
|
1299
|
+
* **Example**
|
|
1300
|
+
*
|
|
1298
1301
|
* ```ts
|
|
1299
|
-
* import * as assert from "node:assert"
|
|
1300
1302
|
* import { Chunk } from "effect"
|
|
1301
1303
|
*
|
|
1302
|
-
*
|
|
1303
|
-
*
|
|
1304
|
-
*
|
|
1305
|
-
*
|
|
1304
|
+
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
1305
|
+
*
|
|
1306
|
+
* console.log(result)
|
|
1307
|
+
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
1306
1308
|
* ```
|
|
1307
1309
|
*
|
|
1308
1310
|
* @since 2.0.0
|
|
@@ -1313,15 +1315,15 @@ export const map: {
|
|
|
1313
1315
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
1314
1316
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
1315
1317
|
*
|
|
1316
|
-
*
|
|
1318
|
+
* **Example**
|
|
1319
|
+
*
|
|
1317
1320
|
* ```ts
|
|
1318
|
-
* import * as assert from "node:assert"
|
|
1319
1321
|
* import { Chunk } from "effect"
|
|
1320
1322
|
*
|
|
1321
|
-
*
|
|
1322
|
-
*
|
|
1323
|
-
*
|
|
1324
|
-
*
|
|
1323
|
+
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
1324
|
+
*
|
|
1325
|
+
* console.log(result)
|
|
1326
|
+
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
1325
1327
|
* ```
|
|
1326
1328
|
*
|
|
1327
1329
|
* @since 2.0.0
|
|
@@ -1332,15 +1334,15 @@ export const map: {
|
|
|
1332
1334
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
1333
1335
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
1334
1336
|
*
|
|
1335
|
-
*
|
|
1337
|
+
* **Example**
|
|
1338
|
+
*
|
|
1336
1339
|
* ```ts
|
|
1337
|
-
* import * as assert from "node:assert"
|
|
1338
1340
|
* import { Chunk } from "effect"
|
|
1339
1341
|
*
|
|
1340
|
-
*
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1343
|
-
*
|
|
1342
|
+
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
1343
|
+
*
|
|
1344
|
+
* console.log(result)
|
|
1345
|
+
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
1344
1346
|
* ```
|
|
1345
1347
|
*
|
|
1346
1348
|
* @since 2.0.0
|
|
@@ -1351,15 +1353,15 @@ export const map: {
|
|
|
1351
1353
|
* Transforms the elements of a chunk using the specified mapping function.
|
|
1352
1354
|
* If the input chunk is non-empty, the resulting chunk will also be non-empty.
|
|
1353
1355
|
*
|
|
1354
|
-
*
|
|
1356
|
+
* **Example**
|
|
1357
|
+
*
|
|
1355
1358
|
* ```ts
|
|
1356
|
-
* import * as assert from "node:assert"
|
|
1357
1359
|
* import { Chunk } from "effect"
|
|
1358
1360
|
*
|
|
1359
|
-
*
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1362
|
-
*
|
|
1361
|
+
* const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)
|
|
1362
|
+
*
|
|
1363
|
+
* console.log(result)
|
|
1364
|
+
* // { _id: 'Chunk', values: [ 2, 3 ] }
|
|
1363
1365
|
* ```
|
|
1364
1366
|
*
|
|
1365
1367
|
* @since 2.0.0
|
package/src/Config.ts
CHANGED
package/src/Context.ts
CHANGED
|
@@ -792,9 +792,9 @@ export const Tag: <const Id extends string>(id: Id) => <Self, Shape>() => TagCla
|
|
|
792
792
|
* when the context is accessed, or override it with a custom implementation
|
|
793
793
|
* when needed.
|
|
794
794
|
*
|
|
795
|
-
*
|
|
795
|
+
* **Example** (Declaring a Tag with a default value)
|
|
796
|
+
*
|
|
796
797
|
* ```ts
|
|
797
|
-
* // Title: Declaring a Tag with a default value
|
|
798
798
|
* import * as assert from "node:assert"
|
|
799
799
|
* import { Context, Effect } from "effect"
|
|
800
800
|
*
|
|
@@ -815,9 +815,9 @@ export const Tag: <const Id extends string>(id: Id) => <Self, Shape>() => TagCla
|
|
|
815
815
|
* // Output: The special number is 2048
|
|
816
816
|
* ```
|
|
817
817
|
*
|
|
818
|
-
*
|
|
818
|
+
* **Example** (Overriding the default value)
|
|
819
|
+
*
|
|
819
820
|
* ```ts
|
|
820
|
-
* // Title: Overriding the default value
|
|
821
821
|
* import { Context, Effect } from "effect"
|
|
822
822
|
*
|
|
823
823
|
* class SpecialNumber extends Context.Reference<SpecialNumber>()(
|