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/Predicate.ts
CHANGED
|
@@ -27,7 +27,7 @@ import type { TupleOf, TupleOfAtLeast } from "./Types.ts"
|
|
|
27
27
|
* A predicate returns `true` or `false` and never throws by itself. It does not
|
|
28
28
|
* narrow types unless you use `Refinement`.
|
|
29
29
|
*
|
|
30
|
-
* **Example** (
|
|
30
|
+
* **Example** (Defining a predicate)
|
|
31
31
|
*
|
|
32
32
|
* ```ts
|
|
33
33
|
* import { Predicate } from "effect"
|
|
@@ -91,7 +91,7 @@ export interface PredicateTypeLambda extends TypeLambda {
|
|
|
91
91
|
* A refinement returns a type predicate (`a is B`). Use it with `if` or
|
|
92
92
|
* `filter` to narrow types.
|
|
93
93
|
*
|
|
94
|
-
* **Example** (
|
|
94
|
+
* **Example** (Narrowing unknown values)
|
|
95
95
|
*
|
|
96
96
|
* ```ts
|
|
97
97
|
* import { Predicate } from "effect"
|
|
@@ -127,7 +127,7 @@ export interface Refinement<in A, out B extends A> {
|
|
|
127
127
|
* These utilities are type-only, create no runtime values, and the namespace is
|
|
128
128
|
* erased at runtime.
|
|
129
129
|
*
|
|
130
|
-
* **Example** (
|
|
130
|
+
* **Example** (Extracting predicate input)
|
|
131
131
|
*
|
|
132
132
|
* ```ts
|
|
133
133
|
* import { Predicate } from "effect"
|
|
@@ -154,7 +154,7 @@ export declare namespace Predicate {
|
|
|
154
154
|
* This is type-only and creates no runtime value. It resolves to `never` if
|
|
155
155
|
* the type does not match `Predicate`.
|
|
156
156
|
*
|
|
157
|
-
* **Example** (
|
|
157
|
+
* **Example** (Inferring the input type)
|
|
158
158
|
*
|
|
159
159
|
* ```ts
|
|
160
160
|
* import { Predicate } from "effect"
|
|
@@ -181,7 +181,7 @@ export declare namespace Predicate {
|
|
|
181
181
|
*
|
|
182
182
|
* This is type-only and creates no runtime value.
|
|
183
183
|
*
|
|
184
|
-
* **Example** (
|
|
184
|
+
* **Example** (Using generic constraints)
|
|
185
185
|
*
|
|
186
186
|
* ```ts
|
|
187
187
|
* import { Predicate } from "effect"
|
|
@@ -209,7 +209,7 @@ export declare namespace Predicate {
|
|
|
209
209
|
* These utilities are type-only, create no runtime values, and the namespace is
|
|
210
210
|
* erased at runtime.
|
|
211
211
|
*
|
|
212
|
-
* **Example** (
|
|
212
|
+
* **Example** (Extracting refinement types)
|
|
213
213
|
*
|
|
214
214
|
* ```ts
|
|
215
215
|
* import { Predicate } from "effect"
|
|
@@ -236,7 +236,7 @@ export declare namespace Refinement {
|
|
|
236
236
|
* This is type-only and creates no runtime value. It resolves to `never` if
|
|
237
237
|
* the type does not match `Refinement`.
|
|
238
238
|
*
|
|
239
|
-
* **Example** (
|
|
239
|
+
* **Example** (Inferring the input type)
|
|
240
240
|
*
|
|
241
241
|
* ```ts
|
|
242
242
|
* import { Predicate } from "effect"
|
|
@@ -265,7 +265,7 @@ export declare namespace Refinement {
|
|
|
265
265
|
* This is type-only and creates no runtime value. It resolves to `never` if
|
|
266
266
|
* the type does not match `Refinement`.
|
|
267
267
|
*
|
|
268
|
-
* **Example** (
|
|
268
|
+
* **Example** (Inferring the output type)
|
|
269
269
|
*
|
|
270
270
|
* ```ts
|
|
271
271
|
* import { Predicate } from "effect"
|
|
@@ -291,7 +291,7 @@ export declare namespace Refinement {
|
|
|
291
291
|
*
|
|
292
292
|
* This is type-only and creates no runtime value.
|
|
293
293
|
*
|
|
294
|
-
* **Example** (
|
|
294
|
+
* **Example** (Using generic constraints)
|
|
295
295
|
*
|
|
296
296
|
* ```ts
|
|
297
297
|
* import { Predicate } from "effect"
|
|
@@ -320,7 +320,7 @@ export declare namespace Refinement {
|
|
|
320
320
|
* Returns a new predicate that applies `f` before `self`. There is no
|
|
321
321
|
* additional short-circuiting beyond what `self` does.
|
|
322
322
|
*
|
|
323
|
-
* **Example** (
|
|
323
|
+
* **Example** (Checking string length)
|
|
324
324
|
*
|
|
325
325
|
* ```ts
|
|
326
326
|
* import { Predicate } from "effect"
|
|
@@ -352,7 +352,7 @@ export const mapInput: {
|
|
|
352
352
|
* Returns a new predicate that applies `f` before `self`. There is no
|
|
353
353
|
* additional short-circuiting beyond what `self` does.
|
|
354
354
|
*
|
|
355
|
-
* **Example** (
|
|
355
|
+
* **Example** (Checking string length)
|
|
356
356
|
*
|
|
357
357
|
* ```ts
|
|
358
358
|
* import { Predicate } from "effect"
|
|
@@ -384,7 +384,7 @@ export const mapInput: {
|
|
|
384
384
|
* Returns a new predicate that applies `f` before `self`. There is no
|
|
385
385
|
* additional short-circuiting beyond what `self` does.
|
|
386
386
|
*
|
|
387
|
-
* **Example** (
|
|
387
|
+
* **Example** (Checking string length)
|
|
388
388
|
*
|
|
389
389
|
* ```ts
|
|
390
390
|
* import { Predicate } from "effect"
|
|
@@ -418,7 +418,7 @@ export const mapInput: {
|
|
|
418
418
|
* This only checks length, not element types, and returns a refinement on the
|
|
419
419
|
* array type.
|
|
420
420
|
*
|
|
421
|
-
* **Example** (
|
|
421
|
+
* **Example** (Checking exact length)
|
|
422
422
|
*
|
|
423
423
|
* ```ts
|
|
424
424
|
* import { Predicate } from "effect"
|
|
@@ -447,7 +447,7 @@ export const isTupleOf: {
|
|
|
447
447
|
* This only checks length, not element types, and returns a refinement on the
|
|
448
448
|
* array type.
|
|
449
449
|
*
|
|
450
|
-
* **Example** (
|
|
450
|
+
* **Example** (Checking exact length)
|
|
451
451
|
*
|
|
452
452
|
* ```ts
|
|
453
453
|
* import { Predicate } from "effect"
|
|
@@ -476,7 +476,7 @@ export const isTupleOf: {
|
|
|
476
476
|
* This only checks length, not element types, and returns a refinement on the
|
|
477
477
|
* array type.
|
|
478
478
|
*
|
|
479
|
-
* **Example** (
|
|
479
|
+
* **Example** (Checking exact length)
|
|
480
480
|
*
|
|
481
481
|
* ```ts
|
|
482
482
|
* import { Predicate } from "effect"
|
|
@@ -507,7 +507,7 @@ export const isTupleOf: {
|
|
|
507
507
|
* This only checks length, not element types, and returns a refinement on the
|
|
508
508
|
* array type.
|
|
509
509
|
*
|
|
510
|
-
* **Example** (
|
|
510
|
+
* **Example** (Checking minimum length)
|
|
511
511
|
*
|
|
512
512
|
* ```ts
|
|
513
513
|
* import { Predicate } from "effect"
|
|
@@ -536,7 +536,7 @@ export const isTupleOfAtLeast: {
|
|
|
536
536
|
* This only checks length, not element types, and returns a refinement on the
|
|
537
537
|
* array type.
|
|
538
538
|
*
|
|
539
|
-
* **Example** (
|
|
539
|
+
* **Example** (Checking minimum length)
|
|
540
540
|
*
|
|
541
541
|
* ```ts
|
|
542
542
|
* import { Predicate } from "effect"
|
|
@@ -565,7 +565,7 @@ export const isTupleOfAtLeast: {
|
|
|
565
565
|
* This only checks length, not element types, and returns a refinement on the
|
|
566
566
|
* array type.
|
|
567
567
|
*
|
|
568
|
-
* **Example** (
|
|
568
|
+
* **Example** (Checking minimum length)
|
|
569
569
|
*
|
|
570
570
|
* ```ts
|
|
571
571
|
* import { Predicate } from "effect"
|
|
@@ -596,7 +596,7 @@ export const isTupleOfAtLeast: {
|
|
|
596
596
|
* This uses `!!input` and treats `0`, `""`, `false`, `null`, and `undefined`
|
|
597
597
|
* as false.
|
|
598
598
|
*
|
|
599
|
-
* **Example** (
|
|
599
|
+
* **Example** (Filtering truthy values)
|
|
600
600
|
*
|
|
601
601
|
* ```ts
|
|
602
602
|
* import { Predicate } from "effect"
|
|
@@ -627,7 +627,7 @@ export function isTruthy(input: unknown): boolean {
|
|
|
627
627
|
*
|
|
628
628
|
* Uses `instanceof Set`.
|
|
629
629
|
*
|
|
630
|
-
* **Example** (
|
|
630
|
+
* **Example** (Guarding a Set)
|
|
631
631
|
*
|
|
632
632
|
* ```ts
|
|
633
633
|
* import { Predicate } from "effect"
|
|
@@ -659,7 +659,7 @@ export function isSet(input: unknown): input is Set<unknown> {
|
|
|
659
659
|
*
|
|
660
660
|
* Uses `instanceof Map`.
|
|
661
661
|
*
|
|
662
|
-
* **Example** (
|
|
662
|
+
* **Example** (Guarding a Map)
|
|
663
663
|
*
|
|
664
664
|
* ```ts
|
|
665
665
|
* import { Predicate } from "effect"
|
|
@@ -692,7 +692,7 @@ export function isMap(input: unknown): input is Map<unknown, unknown> {
|
|
|
692
692
|
*
|
|
693
693
|
* Uses `typeof input === "string"`.
|
|
694
694
|
*
|
|
695
|
-
* **Example** (
|
|
695
|
+
* **Example** (Guarding strings)
|
|
696
696
|
*
|
|
697
697
|
* ```ts
|
|
698
698
|
* import { Predicate } from "effect"
|
|
@@ -726,7 +726,7 @@ export function isString(input: unknown): input is string {
|
|
|
726
726
|
*
|
|
727
727
|
* Uses `typeof input === "number"` and does not exclude `NaN` or `Infinity`.
|
|
728
728
|
*
|
|
729
|
-
* **Example** (
|
|
729
|
+
* **Example** (Guarding numbers)
|
|
730
730
|
*
|
|
731
731
|
* ```ts
|
|
732
732
|
* import { Predicate } from "effect"
|
|
@@ -759,7 +759,7 @@ export function isNumber(input: unknown): input is number {
|
|
|
759
759
|
*
|
|
760
760
|
* Uses `typeof input === "boolean"`.
|
|
761
761
|
*
|
|
762
|
-
* **Example** (
|
|
762
|
+
* **Example** (Guarding booleans)
|
|
763
763
|
*
|
|
764
764
|
* ```ts
|
|
765
765
|
* import { Predicate } from "effect"
|
|
@@ -792,7 +792,7 @@ export function isBoolean(input: unknown): input is boolean {
|
|
|
792
792
|
*
|
|
793
793
|
* Uses `typeof input === "bigint"`.
|
|
794
794
|
*
|
|
795
|
-
* **Example** (
|
|
795
|
+
* **Example** (Guarding bigints)
|
|
796
796
|
*
|
|
797
797
|
* ```ts
|
|
798
798
|
* import { Predicate } from "effect"
|
|
@@ -824,7 +824,7 @@ export function isBigInt(input: unknown): input is bigint {
|
|
|
824
824
|
*
|
|
825
825
|
* Uses `typeof input === "symbol"`.
|
|
826
826
|
*
|
|
827
|
-
* **Example** (
|
|
827
|
+
* **Example** (Guarding symbols)
|
|
828
828
|
*
|
|
829
829
|
* ```ts
|
|
830
830
|
* import { Predicate } from "effect"
|
|
@@ -856,7 +856,7 @@ export function isSymbol(input: unknown): input is symbol {
|
|
|
856
856
|
*
|
|
857
857
|
* Uses `isString`, `isNumber`, and `isSymbol`.
|
|
858
858
|
*
|
|
859
|
-
* **Example** (
|
|
859
|
+
* **Example** (Guarding property keys)
|
|
860
860
|
*
|
|
861
861
|
* ```ts
|
|
862
862
|
* import { Predicate } from "effect"
|
|
@@ -891,7 +891,7 @@ export function isPropertyKey(u: unknown): u is PropertyKey {
|
|
|
891
891
|
*
|
|
892
892
|
* Uses `typeof input === "function"`.
|
|
893
893
|
*
|
|
894
|
-
* **Example** (
|
|
894
|
+
* **Example** (Guarding functions)
|
|
895
895
|
*
|
|
896
896
|
* ```ts
|
|
897
897
|
* import { Predicate } from "effect"
|
|
@@ -923,7 +923,7 @@ export function isFunction(input: unknown): input is Function {
|
|
|
923
923
|
*
|
|
924
924
|
* Uses `input === undefined`.
|
|
925
925
|
*
|
|
926
|
-
* **Example** (
|
|
926
|
+
* **Example** (Guarding undefined values)
|
|
927
927
|
*
|
|
928
928
|
* ```ts
|
|
929
929
|
* import { Predicate } from "effect"
|
|
@@ -954,7 +954,7 @@ export function isUndefined(input: unknown): input is undefined {
|
|
|
954
954
|
*
|
|
955
955
|
* Returns a refinement that excludes `undefined`.
|
|
956
956
|
*
|
|
957
|
-
* **Example** (
|
|
957
|
+
* **Example** (Filtering undefined values)
|
|
958
958
|
*
|
|
959
959
|
* ```ts
|
|
960
960
|
* import { Predicate } from "effect"
|
|
@@ -985,7 +985,7 @@ export function isNotUndefined<A>(input: A): input is Exclude<A, undefined> {
|
|
|
985
985
|
*
|
|
986
986
|
* Uses `input === null`.
|
|
987
987
|
*
|
|
988
|
-
* **Example** (
|
|
988
|
+
* **Example** (Guarding null values)
|
|
989
989
|
*
|
|
990
990
|
* ```ts
|
|
991
991
|
* import { Predicate } from "effect"
|
|
@@ -1016,7 +1016,7 @@ export function isNull(input: unknown): input is null {
|
|
|
1016
1016
|
*
|
|
1017
1017
|
* Returns a refinement that excludes `null`.
|
|
1018
1018
|
*
|
|
1019
|
-
* **Example** (
|
|
1019
|
+
* **Example** (Filtering null values)
|
|
1020
1020
|
*
|
|
1021
1021
|
* ```ts
|
|
1022
1022
|
* import { Predicate } from "effect"
|
|
@@ -1047,7 +1047,7 @@ export function isNotNull<A>(input: A): input is Exclude<A, null> {
|
|
|
1047
1047
|
*
|
|
1048
1048
|
* Uses `input === null || input === undefined`.
|
|
1049
1049
|
*
|
|
1050
|
-
* **Example** (
|
|
1050
|
+
* **Example** (Guarding nullish values)
|
|
1051
1051
|
*
|
|
1052
1052
|
* ```ts
|
|
1053
1053
|
* import { Predicate } from "effect"
|
|
@@ -1080,7 +1080,7 @@ export function isNullish<A>(input: A): input is A & (null | undefined) {
|
|
|
1080
1080
|
*
|
|
1081
1081
|
* Uses `input != null`.
|
|
1082
1082
|
*
|
|
1083
|
-
* **Example** (
|
|
1083
|
+
* **Example** (Filtering non-nullish values)
|
|
1084
1084
|
*
|
|
1085
1085
|
* ```ts
|
|
1086
1086
|
* import { Predicate } from "effect"
|
|
@@ -1108,7 +1108,7 @@ export function isNotNullish<A>(input: A): input is NonNullable<A> {
|
|
|
1108
1108
|
*
|
|
1109
1109
|
* Use when you need a `Predicate` that never accepts, e.g. in default branches.
|
|
1110
1110
|
*
|
|
1111
|
-
* **Example** (
|
|
1111
|
+
* **Example** (Matching no values)
|
|
1112
1112
|
*
|
|
1113
1113
|
* ```ts
|
|
1114
1114
|
* import { Predicate } from "effect"
|
|
@@ -1131,7 +1131,7 @@ export function isNever(_: unknown): _ is never {
|
|
|
1131
1131
|
*
|
|
1132
1132
|
* Use when you need a `Predicate` that always accepts, e.g. as a placeholder.
|
|
1133
1133
|
*
|
|
1134
|
-
* **Example** (
|
|
1134
|
+
* **Example** (Matching every value)
|
|
1135
1135
|
*
|
|
1136
1136
|
* ```ts
|
|
1137
1137
|
* import { Predicate } from "effect"
|
|
@@ -1159,7 +1159,7 @@ export function isUnknown(_: unknown): _ is unknown {
|
|
|
1159
1159
|
*
|
|
1160
1160
|
* Uses `typeof input === "object" && input !== null` and includes arrays.
|
|
1161
1161
|
*
|
|
1162
|
-
* **Example** (
|
|
1162
|
+
* **Example** (Checking objects or arrays)
|
|
1163
1163
|
*
|
|
1164
1164
|
* ```ts
|
|
1165
1165
|
* import { Predicate } from "effect"
|
|
@@ -1190,7 +1190,7 @@ export function isObjectOrArray(input: unknown): input is { [x: PropertyKey]: un
|
|
|
1190
1190
|
* also accepts object instances such as `Date`, `Map`, class instances, and
|
|
1191
1191
|
* typed arrays. It excludes `null` and arrays.
|
|
1192
1192
|
*
|
|
1193
|
-
* **Example** (
|
|
1193
|
+
* **Example** (Guarding objects)
|
|
1194
1194
|
*
|
|
1195
1195
|
* ```ts
|
|
1196
1196
|
* import { Predicate } from "effect"
|
|
@@ -1223,7 +1223,7 @@ export function isObject(input: unknown): input is { [x: PropertyKey]: unknown }
|
|
|
1223
1223
|
* runtime. This delegates to `isObject`, so class instances and built-in object
|
|
1224
1224
|
* instances are accepted.
|
|
1225
1225
|
*
|
|
1226
|
-
* **Example** (
|
|
1226
|
+
* **Example** (Checking readonly objects)
|
|
1227
1227
|
*
|
|
1228
1228
|
* ```ts
|
|
1229
1229
|
* import { Predicate } from "effect"
|
|
@@ -1253,7 +1253,7 @@ export function isReadonlyObject(input: unknown): input is { readonly [x: Proper
|
|
|
1253
1253
|
*
|
|
1254
1254
|
* Returns `true` for arrays and functions, and `false` for `null`.
|
|
1255
1255
|
*
|
|
1256
|
-
* **Example** (
|
|
1256
|
+
* **Example** (Checking object keywords)
|
|
1257
1257
|
*
|
|
1258
1258
|
* ```ts
|
|
1259
1259
|
* import { Predicate } from "effect"
|
|
@@ -1284,7 +1284,7 @@ export function isObjectKeyword(input: unknown): input is object {
|
|
|
1284
1284
|
* Uses the `in` operator and `isObjectKeyword`. This does not check property
|
|
1285
1285
|
* value types.
|
|
1286
1286
|
*
|
|
1287
|
-
* **Example** (
|
|
1287
|
+
* **Example** (Guarding object properties)
|
|
1288
1288
|
*
|
|
1289
1289
|
* ```ts
|
|
1290
1290
|
* import { Predicate } from "effect"
|
|
@@ -1316,7 +1316,7 @@ export const hasProperty: {
|
|
|
1316
1316
|
* Uses the `in` operator and `isObjectKeyword`. This does not check property
|
|
1317
1317
|
* value types.
|
|
1318
1318
|
*
|
|
1319
|
-
* **Example** (
|
|
1319
|
+
* **Example** (Guarding object properties)
|
|
1320
1320
|
*
|
|
1321
1321
|
* ```ts
|
|
1322
1322
|
* import { Predicate } from "effect"
|
|
@@ -1348,7 +1348,7 @@ export const hasProperty: {
|
|
|
1348
1348
|
* Uses the `in` operator and `isObjectKeyword`. This does not check property
|
|
1349
1349
|
* value types.
|
|
1350
1350
|
*
|
|
1351
|
-
* **Example** (
|
|
1351
|
+
* **Example** (Guarding object properties)
|
|
1352
1352
|
*
|
|
1353
1353
|
* ```ts
|
|
1354
1354
|
* import { Predicate } from "effect"
|
|
@@ -1385,7 +1385,7 @@ export const hasProperty: {
|
|
|
1385
1385
|
*
|
|
1386
1386
|
* Uses `hasProperty` and strict equality on `_tag`.
|
|
1387
1387
|
*
|
|
1388
|
-
* **Example** (
|
|
1388
|
+
* **Example** (Guarding tagged values)
|
|
1389
1389
|
*
|
|
1390
1390
|
* ```ts
|
|
1391
1391
|
* import { Predicate } from "effect"
|
|
@@ -1412,7 +1412,7 @@ export const isTagged: {
|
|
|
1412
1412
|
*
|
|
1413
1413
|
* Uses `hasProperty` and strict equality on `_tag`.
|
|
1414
1414
|
*
|
|
1415
|
-
* **Example** (
|
|
1415
|
+
* **Example** (Guarding tagged values)
|
|
1416
1416
|
*
|
|
1417
1417
|
* ```ts
|
|
1418
1418
|
* import { Predicate } from "effect"
|
|
@@ -1439,7 +1439,7 @@ export const isTagged: {
|
|
|
1439
1439
|
*
|
|
1440
1440
|
* Uses `hasProperty` and strict equality on `_tag`.
|
|
1441
1441
|
*
|
|
1442
|
-
* **Example** (
|
|
1442
|
+
* **Example** (Guarding tagged values)
|
|
1443
1443
|
*
|
|
1444
1444
|
* ```ts
|
|
1445
1445
|
* import { Predicate } from "effect"
|
|
@@ -1470,7 +1470,7 @@ export const isTagged: {
|
|
|
1470
1470
|
*
|
|
1471
1471
|
* Uses `instanceof Error`.
|
|
1472
1472
|
*
|
|
1473
|
-
* **Example** (
|
|
1473
|
+
* **Example** (Guarding errors)
|
|
1474
1474
|
*
|
|
1475
1475
|
* ```ts
|
|
1476
1476
|
* import { Predicate } from "effect"
|
|
@@ -1499,7 +1499,7 @@ export function isError(input: unknown): input is Error {
|
|
|
1499
1499
|
*
|
|
1500
1500
|
* Uses `instanceof Uint8Array`.
|
|
1501
1501
|
*
|
|
1502
|
-
* **Example** (
|
|
1502
|
+
* **Example** (Guarding Uint8Array values)
|
|
1503
1503
|
*
|
|
1504
1504
|
* ```ts
|
|
1505
1505
|
* import { Predicate } from "effect"
|
|
@@ -1529,7 +1529,7 @@ export function isUint8Array(input: unknown): input is Uint8Array {
|
|
|
1529
1529
|
*
|
|
1530
1530
|
* Uses `instanceof Date`.
|
|
1531
1531
|
*
|
|
1532
|
-
* **Example** (
|
|
1532
|
+
* **Example** (Guarding Date values)
|
|
1533
1533
|
*
|
|
1534
1534
|
* ```ts
|
|
1535
1535
|
* import { Predicate } from "effect"
|
|
@@ -1558,7 +1558,7 @@ export function isDate(input: unknown): input is Date {
|
|
|
1558
1558
|
*
|
|
1559
1559
|
* Accepts strings as iterable and uses `hasProperty` for `Symbol.iterator`.
|
|
1560
1560
|
*
|
|
1561
|
-
* **Example** (
|
|
1561
|
+
* **Example** (Guarding iterables)
|
|
1562
1562
|
*
|
|
1563
1563
|
* ```ts
|
|
1564
1564
|
* import { Predicate } from "effect"
|
|
@@ -1588,7 +1588,7 @@ export function isIterable(input: unknown): input is Iterable<unknown> {
|
|
|
1588
1588
|
*
|
|
1589
1589
|
* Performs a structural check for `then` and `catch` functions.
|
|
1590
1590
|
*
|
|
1591
|
-
* **Example** (
|
|
1591
|
+
* **Example** (Guarding promises)
|
|
1592
1592
|
*
|
|
1593
1593
|
* ```ts
|
|
1594
1594
|
* import { Predicate } from "effect"
|
|
@@ -1618,7 +1618,7 @@ export function isPromise(input: unknown): input is Promise<unknown> {
|
|
|
1618
1618
|
*
|
|
1619
1619
|
* Performs a structural check for a callable `then`.
|
|
1620
1620
|
*
|
|
1621
|
-
* **Example** (
|
|
1621
|
+
* **Example** (Guarding promise-like values)
|
|
1622
1622
|
*
|
|
1623
1623
|
* ```ts
|
|
1624
1624
|
* import { Predicate } from "effect"
|
|
@@ -1647,7 +1647,7 @@ export function isPromiseLike(input: unknown): input is PromiseLike<unknown> {
|
|
|
1647
1647
|
*
|
|
1648
1648
|
* Uses `instanceof RegExp`.
|
|
1649
1649
|
*
|
|
1650
|
-
* **Example** (
|
|
1650
|
+
* **Example** (Guarding RegExp values)
|
|
1651
1651
|
*
|
|
1652
1652
|
* ```ts
|
|
1653
1653
|
* import { Predicate } from "effect"
|
|
@@ -1678,7 +1678,7 @@ export function isRegExp(input: unknown): input is RegExp {
|
|
|
1678
1678
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1679
1679
|
* short-circuits on the first `false`.
|
|
1680
1680
|
*
|
|
1681
|
-
* **Example** (
|
|
1681
|
+
* **Example** (Composing refinements)
|
|
1682
1682
|
*
|
|
1683
1683
|
* ```ts
|
|
1684
1684
|
* import { Predicate } from "effect"
|
|
@@ -1710,7 +1710,7 @@ export const compose: {
|
|
|
1710
1710
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1711
1711
|
* short-circuits on the first `false`.
|
|
1712
1712
|
*
|
|
1713
|
-
* **Example** (
|
|
1713
|
+
* **Example** (Composing refinements)
|
|
1714
1714
|
*
|
|
1715
1715
|
* ```ts
|
|
1716
1716
|
* import { Predicate } from "effect"
|
|
@@ -1742,7 +1742,7 @@ export const compose: {
|
|
|
1742
1742
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1743
1743
|
* short-circuits on the first `false`.
|
|
1744
1744
|
*
|
|
1745
|
-
* **Example** (
|
|
1745
|
+
* **Example** (Composing refinements)
|
|
1746
1746
|
*
|
|
1747
1747
|
* ```ts
|
|
1748
1748
|
* import { Predicate } from "effect"
|
|
@@ -1774,7 +1774,7 @@ export const compose: {
|
|
|
1774
1774
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1775
1775
|
* short-circuits on the first `false`.
|
|
1776
1776
|
*
|
|
1777
|
-
* **Example** (
|
|
1777
|
+
* **Example** (Composing refinements)
|
|
1778
1778
|
*
|
|
1779
1779
|
* ```ts
|
|
1780
1780
|
* import { Predicate } from "effect"
|
|
@@ -1806,7 +1806,7 @@ export const compose: {
|
|
|
1806
1806
|
* For refinements, the output type is narrowed by both checks. Evaluation
|
|
1807
1807
|
* short-circuits on the first `false`.
|
|
1808
1808
|
*
|
|
1809
|
-
* **Example** (
|
|
1809
|
+
* **Example** (Composing refinements)
|
|
1810
1810
|
*
|
|
1811
1811
|
* ```ts
|
|
1812
1812
|
* import { Predicate } from "effect"
|
|
@@ -1844,7 +1844,7 @@ export const compose: {
|
|
|
1844
1844
|
* Returns a refinement if any element predicate is a refinement. Evaluation
|
|
1845
1845
|
* stops at the first failing element.
|
|
1846
1846
|
*
|
|
1847
|
-
* **Example** (
|
|
1847
|
+
* **Example** (Checking tuples)
|
|
1848
1848
|
*
|
|
1849
1849
|
* ```ts
|
|
1850
1850
|
* import { Predicate } from "effect"
|
|
@@ -1890,7 +1890,7 @@ export function Tuple<const T extends ReadonlyArray<Predicate.Any>>(
|
|
|
1890
1890
|
* Returns a refinement if any field predicate is a refinement. Only the
|
|
1891
1891
|
* specified keys are checked, and extra keys are ignored.
|
|
1892
1892
|
*
|
|
1893
|
-
* **Example** (
|
|
1893
|
+
* **Example** (Checking structs)
|
|
1894
1894
|
*
|
|
1895
1895
|
* ```ts
|
|
1896
1896
|
* import { Predicate } from "effect"
|
|
@@ -1938,7 +1938,7 @@ export function Struct<R extends Record<string, Predicate.Any>>(
|
|
|
1938
1938
|
*
|
|
1939
1939
|
* Returns a new predicate that flips the boolean result.
|
|
1940
1940
|
*
|
|
1941
|
-
* **Example** (
|
|
1941
|
+
* **Example** (Negating a predicate)
|
|
1942
1942
|
*
|
|
1943
1943
|
* ```ts
|
|
1944
1944
|
* import { Predicate } from "effect"
|
|
@@ -1971,7 +1971,7 @@ export function not<A>(self: Predicate<A>): Predicate<A> {
|
|
|
1971
1971
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
1972
1972
|
* type is a union.
|
|
1973
1973
|
*
|
|
1974
|
-
* **Example** (
|
|
1974
|
+
* **Example** (Checking either condition)
|
|
1975
1975
|
*
|
|
1976
1976
|
* ```ts
|
|
1977
1977
|
* import { Predicate } from "effect"
|
|
@@ -2000,7 +2000,7 @@ export const or: {
|
|
|
2000
2000
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
2001
2001
|
* type is a union.
|
|
2002
2002
|
*
|
|
2003
|
-
* **Example** (
|
|
2003
|
+
* **Example** (Checking either condition)
|
|
2004
2004
|
*
|
|
2005
2005
|
* ```ts
|
|
2006
2006
|
* import { Predicate } from "effect"
|
|
@@ -2029,7 +2029,7 @@ export const or: {
|
|
|
2029
2029
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
2030
2030
|
* type is a union.
|
|
2031
2031
|
*
|
|
2032
|
-
* **Example** (
|
|
2032
|
+
* **Example** (Checking either condition)
|
|
2033
2033
|
*
|
|
2034
2034
|
* ```ts
|
|
2035
2035
|
* import { Predicate } from "effect"
|
|
@@ -2058,7 +2058,7 @@ export const or: {
|
|
|
2058
2058
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
2059
2059
|
* type is a union.
|
|
2060
2060
|
*
|
|
2061
|
-
* **Example** (
|
|
2061
|
+
* **Example** (Checking either condition)
|
|
2062
2062
|
*
|
|
2063
2063
|
* ```ts
|
|
2064
2064
|
* import { Predicate } from "effect"
|
|
@@ -2087,7 +2087,7 @@ export const or: {
|
|
|
2087
2087
|
* Evaluation short-circuits on the first `true`. For refinements, the output
|
|
2088
2088
|
* type is a union.
|
|
2089
2089
|
*
|
|
2090
|
-
* **Example** (
|
|
2090
|
+
* **Example** (Checking either condition)
|
|
2091
2091
|
*
|
|
2092
2092
|
* ```ts
|
|
2093
2093
|
* import { Predicate } from "effect"
|
|
@@ -2119,7 +2119,7 @@ export const or: {
|
|
|
2119
2119
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2120
2120
|
* type is an intersection.
|
|
2121
2121
|
*
|
|
2122
|
-
* **Example** (
|
|
2122
|
+
* **Example** (Checking both conditions)
|
|
2123
2123
|
*
|
|
2124
2124
|
* ```ts
|
|
2125
2125
|
* import { Predicate } from "effect"
|
|
@@ -2157,7 +2157,7 @@ export const and: {
|
|
|
2157
2157
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2158
2158
|
* type is an intersection.
|
|
2159
2159
|
*
|
|
2160
|
-
* **Example** (
|
|
2160
|
+
* **Example** (Checking both conditions)
|
|
2161
2161
|
*
|
|
2162
2162
|
* ```ts
|
|
2163
2163
|
* import { Predicate } from "effect"
|
|
@@ -2195,7 +2195,7 @@ export const and: {
|
|
|
2195
2195
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2196
2196
|
* type is an intersection.
|
|
2197
2197
|
*
|
|
2198
|
-
* **Example** (
|
|
2198
|
+
* **Example** (Checking both conditions)
|
|
2199
2199
|
*
|
|
2200
2200
|
* ```ts
|
|
2201
2201
|
* import { Predicate } from "effect"
|
|
@@ -2233,7 +2233,7 @@ export const and: {
|
|
|
2233
2233
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2234
2234
|
* type is an intersection.
|
|
2235
2235
|
*
|
|
2236
|
-
* **Example** (
|
|
2236
|
+
* **Example** (Checking both conditions)
|
|
2237
2237
|
*
|
|
2238
2238
|
* ```ts
|
|
2239
2239
|
* import { Predicate } from "effect"
|
|
@@ -2271,7 +2271,7 @@ export const and: {
|
|
|
2271
2271
|
* Evaluation short-circuits on the first `false`. For refinements, the output
|
|
2272
2272
|
* type is an intersection.
|
|
2273
2273
|
*
|
|
2274
|
-
* **Example** (
|
|
2274
|
+
* **Example** (Checking both conditions)
|
|
2275
2275
|
*
|
|
2276
2276
|
* ```ts
|
|
2277
2277
|
* import { Predicate } from "effect"
|
|
@@ -2308,7 +2308,7 @@ export const and: {
|
|
|
2308
2308
|
*
|
|
2309
2309
|
* Returns `true` when results differ.
|
|
2310
2310
|
*
|
|
2311
|
-
* **Example** (
|
|
2311
|
+
* **Example** (Checking exclusive-or conditions)
|
|
2312
2312
|
*
|
|
2313
2313
|
* ```ts
|
|
2314
2314
|
* import { Predicate } from "effect"
|
|
@@ -2337,7 +2337,7 @@ export const xor: {
|
|
|
2337
2337
|
*
|
|
2338
2338
|
* Returns `true` when results differ.
|
|
2339
2339
|
*
|
|
2340
|
-
* **Example** (
|
|
2340
|
+
* **Example** (Checking exclusive-or conditions)
|
|
2341
2341
|
*
|
|
2342
2342
|
* ```ts
|
|
2343
2343
|
* import { Predicate } from "effect"
|
|
@@ -2366,7 +2366,7 @@ export const xor: {
|
|
|
2366
2366
|
*
|
|
2367
2367
|
* Returns `true` when results differ.
|
|
2368
2368
|
*
|
|
2369
|
-
* **Example** (
|
|
2369
|
+
* **Example** (Checking exclusive-or conditions)
|
|
2370
2370
|
*
|
|
2371
2371
|
* ```ts
|
|
2372
2372
|
* import { Predicate } from "effect"
|
|
@@ -2397,7 +2397,7 @@ export const xor: {
|
|
|
2397
2397
|
*
|
|
2398
2398
|
* Returns `true` when both results are equal.
|
|
2399
2399
|
*
|
|
2400
|
-
* **Example** (
|
|
2400
|
+
* **Example** (Defining equivalence)
|
|
2401
2401
|
*
|
|
2402
2402
|
* ```ts
|
|
2403
2403
|
* import { Predicate } from "effect"
|
|
@@ -2424,7 +2424,7 @@ export const eqv: {
|
|
|
2424
2424
|
*
|
|
2425
2425
|
* Returns `true` when both results are equal.
|
|
2426
2426
|
*
|
|
2427
|
-
* **Example** (
|
|
2427
|
+
* **Example** (Defining equivalence)
|
|
2428
2428
|
*
|
|
2429
2429
|
* ```ts
|
|
2430
2430
|
* import { Predicate } from "effect"
|
|
@@ -2451,7 +2451,7 @@ export const eqv: {
|
|
|
2451
2451
|
*
|
|
2452
2452
|
* Returns `true` when both results are equal.
|
|
2453
2453
|
*
|
|
2454
|
-
* **Example** (
|
|
2454
|
+
* **Example** (Defining equivalence)
|
|
2455
2455
|
*
|
|
2456
2456
|
* ```ts
|
|
2457
2457
|
* import { Predicate } from "effect"
|
|
@@ -2482,7 +2482,7 @@ export const eqv: {
|
|
|
2482
2482
|
* Models constraints like "if A then B" and returns `true` when the antecedent
|
|
2483
2483
|
* is `false`.
|
|
2484
2484
|
*
|
|
2485
|
-
* **Example** (
|
|
2485
|
+
* **Example** (Checking implication)
|
|
2486
2486
|
*
|
|
2487
2487
|
* ```ts
|
|
2488
2488
|
* import { Predicate } from "effect"
|
|
@@ -2513,7 +2513,7 @@ export const implies: {
|
|
|
2513
2513
|
* Models constraints like "if A then B" and returns `true` when the antecedent
|
|
2514
2514
|
* is `false`.
|
|
2515
2515
|
*
|
|
2516
|
-
* **Example** (
|
|
2516
|
+
* **Example** (Checking implication)
|
|
2517
2517
|
*
|
|
2518
2518
|
* ```ts
|
|
2519
2519
|
* import { Predicate } from "effect"
|
|
@@ -2544,7 +2544,7 @@ export const implies: {
|
|
|
2544
2544
|
* Models constraints like "if A then B" and returns `true` when the antecedent
|
|
2545
2545
|
* is `false`.
|
|
2546
2546
|
*
|
|
2547
|
-
* **Example** (
|
|
2547
|
+
* **Example** (Checking implication)
|
|
2548
2548
|
*
|
|
2549
2549
|
* ```ts
|
|
2550
2550
|
* import { Predicate } from "effect"
|
|
@@ -2578,7 +2578,7 @@ export const implies: {
|
|
|
2578
2578
|
*
|
|
2579
2579
|
* Returns the negation of `or`.
|
|
2580
2580
|
*
|
|
2581
|
-
* **Example** (NOR)
|
|
2581
|
+
* **Example** (Checking NOR conditions)
|
|
2582
2582
|
*
|
|
2583
2583
|
* ```ts
|
|
2584
2584
|
* import { Predicate } from "effect"
|
|
@@ -2605,7 +2605,7 @@ export const nor: {
|
|
|
2605
2605
|
*
|
|
2606
2606
|
* Returns the negation of `or`.
|
|
2607
2607
|
*
|
|
2608
|
-
* **Example** (NOR)
|
|
2608
|
+
* **Example** (Checking NOR conditions)
|
|
2609
2609
|
*
|
|
2610
2610
|
* ```ts
|
|
2611
2611
|
* import { Predicate } from "effect"
|
|
@@ -2632,7 +2632,7 @@ export const nor: {
|
|
|
2632
2632
|
*
|
|
2633
2633
|
* Returns the negation of `or`.
|
|
2634
2634
|
*
|
|
2635
|
-
* **Example** (NOR)
|
|
2635
|
+
* **Example** (Checking NOR conditions)
|
|
2636
2636
|
*
|
|
2637
2637
|
* ```ts
|
|
2638
2638
|
* import { Predicate } from "effect"
|
|
@@ -2664,7 +2664,7 @@ export const nor: {
|
|
|
2664
2664
|
*
|
|
2665
2665
|
* Returns the negation of `and`.
|
|
2666
2666
|
*
|
|
2667
|
-
* **Example** (NAND)
|
|
2667
|
+
* **Example** (Checking NAND conditions)
|
|
2668
2668
|
*
|
|
2669
2669
|
* ```ts
|
|
2670
2670
|
* import { Predicate } from "effect"
|
|
@@ -2691,7 +2691,7 @@ export const nand: {
|
|
|
2691
2691
|
*
|
|
2692
2692
|
* Returns the negation of `and`.
|
|
2693
2693
|
*
|
|
2694
|
-
* **Example** (NAND)
|
|
2694
|
+
* **Example** (Checking NAND conditions)
|
|
2695
2695
|
*
|
|
2696
2696
|
* ```ts
|
|
2697
2697
|
* import { Predicate } from "effect"
|
|
@@ -2718,7 +2718,7 @@ export const nand: {
|
|
|
2718
2718
|
*
|
|
2719
2719
|
* Returns the negation of `and`.
|
|
2720
2720
|
*
|
|
2721
|
-
* **Example** (NAND)
|
|
2721
|
+
* **Example** (Checking NAND conditions)
|
|
2722
2722
|
*
|
|
2723
2723
|
* ```ts
|
|
2724
2724
|
* import { Predicate } from "effect"
|
|
@@ -2751,7 +2751,7 @@ export const nand: {
|
|
|
2751
2751
|
* Evaluation short-circuits on the first `false`. The collection is iterated
|
|
2752
2752
|
* each time the predicate is called.
|
|
2753
2753
|
*
|
|
2754
|
-
* **Example** (
|
|
2754
|
+
* **Example** (Checking all predicates)
|
|
2755
2755
|
*
|
|
2756
2756
|
* ```ts
|
|
2757
2757
|
* import { Predicate } from "effect"
|
|
@@ -2789,7 +2789,7 @@ export function every<A>(collection: Iterable<Predicate<A>>): Predicate<A> {
|
|
|
2789
2789
|
* Evaluation short-circuits on the first `true`. The collection is iterated
|
|
2790
2790
|
* each time the predicate is called.
|
|
2791
2791
|
*
|
|
2792
|
-
* **Example** (
|
|
2792
|
+
* **Example** (Checking any predicate)
|
|
2793
2793
|
*
|
|
2794
2794
|
* ```ts
|
|
2795
2795
|
* import { Predicate } from "effect"
|