effect 3.14.15 → 3.14.17
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/.index/package.json +6 -0
- package/Arbitrary/package.json +2 -2
- package/Array/package.json +2 -2
- package/BigDecimal/package.json +2 -2
- package/BigInt/package.json +2 -2
- package/Boolean/package.json +2 -2
- package/Brand/package.json +2 -2
- package/Cache/package.json +2 -2
- package/Cause/package.json +2 -2
- package/Channel/package.json +2 -2
- package/ChildExecutorDecision/package.json +2 -2
- package/Chunk/package.json +2 -2
- package/Clock/package.json +2 -2
- package/Config/package.json +2 -2
- package/ConfigError/package.json +2 -2
- package/ConfigProvider/package.json +2 -2
- package/ConfigProviderPathPatch/package.json +2 -2
- package/Console/package.json +2 -2
- package/Context/package.json +2 -2
- package/Cron/package.json +2 -2
- package/Data/package.json +2 -2
- package/DateTime/package.json +2 -2
- package/DefaultServices/package.json +2 -2
- package/Deferred/package.json +2 -2
- package/Differ/package.json +2 -2
- package/Duration/package.json +2 -2
- package/Effect/package.json +2 -2
- package/Effectable/package.json +2 -2
- package/Either/package.json +2 -2
- package/Encoding/package.json +2 -2
- package/Equal/package.json +2 -2
- package/Equivalence/package.json +2 -2
- package/ExecutionStrategy/package.json +2 -2
- package/Exit/package.json +2 -2
- package/FastCheck/package.json +2 -2
- package/Fiber/package.json +2 -2
- package/FiberHandle/package.json +2 -2
- package/FiberId/package.json +2 -2
- package/FiberMap/package.json +2 -2
- package/FiberRef/package.json +2 -2
- package/FiberRefs/package.json +2 -2
- package/FiberRefsPatch/package.json +2 -2
- package/FiberSet/package.json +2 -2
- package/FiberStatus/package.json +2 -2
- package/Function/package.json +2 -2
- package/GlobalValue/package.json +2 -2
- package/GroupBy/package.json +2 -2
- package/HKT/package.json +2 -2
- package/Hash/package.json +2 -2
- package/HashMap/package.json +2 -2
- package/HashSet/package.json +2 -2
- package/Inspectable/package.json +2 -2
- package/Iterable/package.json +2 -2
- package/JSONSchema/package.json +2 -2
- package/KeyedPool/package.json +2 -2
- package/Layer/package.json +2 -2
- package/LayerMap/package.json +2 -2
- package/List/package.json +2 -2
- package/LogLevel/package.json +2 -2
- package/LogSpan/package.json +2 -2
- package/Logger/package.json +2 -2
- package/Mailbox/package.json +2 -2
- package/ManagedRuntime/package.json +2 -2
- package/Match/package.json +2 -2
- package/MergeDecision/package.json +2 -2
- package/MergeState/package.json +2 -2
- package/MergeStrategy/package.json +2 -2
- package/Metric/package.json +2 -2
- package/MetricBoundaries/package.json +2 -2
- package/MetricHook/package.json +2 -2
- package/MetricKey/package.json +2 -2
- package/MetricKeyType/package.json +2 -2
- package/MetricLabel/package.json +2 -2
- package/MetricPair/package.json +2 -2
- package/MetricPolling/package.json +2 -2
- package/MetricRegistry/package.json +2 -2
- package/MetricState/package.json +2 -2
- package/Micro/package.json +2 -2
- package/ModuleVersion/package.json +2 -2
- package/MutableHashMap/package.json +2 -2
- package/MutableHashSet/package.json +2 -2
- package/MutableList/package.json +2 -2
- package/MutableQueue/package.json +2 -2
- package/MutableRef/package.json +2 -2
- package/NonEmptyIterable/package.json +2 -2
- package/Number/package.json +2 -2
- package/Option/package.json +2 -2
- package/Order/package.json +2 -2
- package/Ordering/package.json +2 -2
- package/ParseResult/package.json +2 -2
- package/Pipeable/package.json +2 -2
- package/Pool/package.json +2 -2
- package/Predicate/package.json +2 -2
- package/Pretty/package.json +2 -2
- package/PrimaryKey/package.json +2 -2
- package/PubSub/package.json +2 -2
- package/Queue/package.json +2 -2
- package/Random/package.json +2 -2
- package/RateLimiter/package.json +2 -2
- package/RcMap/package.json +2 -2
- package/RcRef/package.json +2 -2
- package/Readable/package.json +2 -2
- package/Record/package.json +2 -2
- package/RedBlackTree/package.json +2 -2
- package/Redacted/package.json +2 -2
- package/Ref/package.json +2 -2
- package/RegExp/package.json +2 -2
- package/Reloadable/package.json +2 -2
- package/Request/package.json +2 -2
- package/RequestBlock/package.json +2 -2
- package/RequestResolver/package.json +2 -2
- package/Resource/package.json +2 -2
- package/Runtime/package.json +2 -2
- package/RuntimeFlags/package.json +2 -2
- package/RuntimeFlagsPatch/package.json +2 -2
- package/STM/package.json +2 -2
- package/Schedule/package.json +2 -2
- package/ScheduleDecision/package.json +2 -2
- package/ScheduleInterval/package.json +2 -2
- package/ScheduleIntervals/package.json +2 -2
- package/Scheduler/package.json +2 -2
- package/Schema/package.json +2 -2
- package/SchemaAST/package.json +2 -2
- package/Scope/package.json +2 -2
- package/ScopedCache/package.json +2 -2
- package/ScopedRef/package.json +2 -2
- package/Secret/package.json +2 -2
- package/SingleProducerAsyncInput/package.json +2 -2
- package/Sink/package.json +2 -2
- package/SortedMap/package.json +2 -2
- package/SortedSet/package.json +2 -2
- package/Stream/package.json +2 -2
- package/StreamEmit/package.json +2 -2
- package/StreamHaltStrategy/package.json +2 -2
- package/Streamable/package.json +2 -2
- package/String/package.json +2 -2
- package/Struct/package.json +2 -2
- package/Subscribable/package.json +2 -2
- package/SubscriptionRef/package.json +2 -2
- package/Supervisor/package.json +2 -2
- package/Symbol/package.json +2 -2
- package/SynchronizedRef/package.json +2 -2
- package/TArray/package.json +2 -2
- package/TDeferred/package.json +2 -2
- package/TMap/package.json +2 -2
- package/TPriorityQueue/package.json +2 -2
- package/TPubSub/package.json +2 -2
- package/TQueue/package.json +2 -2
- package/TRandom/package.json +2 -2
- package/TReentrantLock/package.json +2 -2
- package/TRef/package.json +2 -2
- package/TSemaphore/package.json +2 -2
- package/TSet/package.json +2 -2
- package/TSubscriptionRef/package.json +2 -2
- package/Take/package.json +2 -2
- package/TestAnnotation/package.json +2 -2
- package/TestAnnotationMap/package.json +2 -2
- package/TestAnnotations/package.json +2 -2
- package/TestClock/package.json +2 -2
- package/TestConfig/package.json +2 -2
- package/TestContext/package.json +2 -2
- package/TestLive/package.json +2 -2
- package/TestServices/package.json +2 -2
- package/TestSized/package.json +2 -2
- package/Tracer/package.json +2 -2
- package/Trie/package.json +2 -2
- package/Tuple/package.json +2 -2
- package/Types/package.json +2 -2
- package/Unify/package.json +2 -2
- package/UpstreamPullRequest/package.json +2 -2
- package/UpstreamPullStrategy/package.json +2 -2
- package/Utils/package.json +2 -2
- package/dist/cjs/Data.js +27 -23
- package/dist/cjs/Data.js.map +1 -1
- package/dist/cjs/Effect.js +5 -1
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/String.js.map +1 -1
- package/dist/cjs/Utils.js +13 -8
- package/dist/cjs/Utils.js.map +1 -1
- package/dist/cjs/internal/cause.js +4 -1
- package/dist/cjs/internal/cause.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Data.d.ts.map +1 -1
- package/dist/dts/DateTime.d.ts +6 -6
- package/dist/dts/DateTime.d.ts.map +1 -1
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Match.d.ts +6 -5
- package/dist/dts/Match.d.ts.map +1 -1
- package/dist/dts/String.d.ts +3 -3
- package/dist/dts/String.d.ts.map +1 -1
- package/dist/dts/Utils.d.ts +1 -1
- package/dist/dts/Utils.d.ts.map +1 -1
- package/dist/esm/Data.js +27 -23
- package/dist/esm/Data.js.map +1 -1
- package/dist/esm/Effect.js +5 -1
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/String.js.map +1 -1
- package/dist/esm/Utils.js +13 -8
- package/dist/esm/Utils.js.map +1 -1
- package/dist/esm/internal/cause.js +4 -1
- package/dist/esm/internal/cause.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/index/package.json +6 -0
- package/package.json +18 -1
- package/src/Data.ts +20 -15
- package/src/DateTime.ts +6 -6
- package/src/Effect.ts +5 -1
- package/src/Match.ts +35 -31
- package/src/String.ts +3 -3
- package/src/Utils.ts +15 -7
- package/src/internal/cause.ts +4 -1
- package/src/internal/dateTime.ts +9 -9
- package/src/internal/version.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.17",
|
|
4
4
|
"description": "The missing standard library for TypeScript, for writing production-grade software.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"directory": "packages/effect"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": [],
|
|
12
|
+
"homepage": "https://effect.website",
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"@standard-schema/spec": "^1.0.0",
|
|
14
15
|
"fast-check": "^3.23.1"
|
|
@@ -26,6 +27,11 @@
|
|
|
26
27
|
"import": "./dist/esm/index.js",
|
|
27
28
|
"default": "./dist/cjs/index.js"
|
|
28
29
|
},
|
|
30
|
+
"./.index": {
|
|
31
|
+
"types": "./dist/dts/.index.d.ts",
|
|
32
|
+
"import": "./dist/esm/.index.js",
|
|
33
|
+
"default": "./dist/cjs/.index.js"
|
|
34
|
+
},
|
|
29
35
|
"./Arbitrary": {
|
|
30
36
|
"types": "./dist/dts/Arbitrary.d.ts",
|
|
31
37
|
"import": "./dist/esm/Arbitrary.js",
|
|
@@ -880,10 +886,18 @@
|
|
|
880
886
|
"types": "./dist/dts/Utils.d.ts",
|
|
881
887
|
"import": "./dist/esm/Utils.js",
|
|
882
888
|
"default": "./dist/cjs/Utils.js"
|
|
889
|
+
},
|
|
890
|
+
"./index": {
|
|
891
|
+
"types": "./dist/dts/index.d.ts",
|
|
892
|
+
"import": "./dist/esm/index.js",
|
|
893
|
+
"default": "./dist/cjs/index.js"
|
|
883
894
|
}
|
|
884
895
|
},
|
|
885
896
|
"typesVersions": {
|
|
886
897
|
"*": {
|
|
898
|
+
".index": [
|
|
899
|
+
"./dist/dts/.index.d.ts"
|
|
900
|
+
],
|
|
887
901
|
"Arbitrary": [
|
|
888
902
|
"./dist/dts/Arbitrary.d.ts"
|
|
889
903
|
],
|
|
@@ -1396,6 +1410,9 @@
|
|
|
1396
1410
|
],
|
|
1397
1411
|
"Utils": [
|
|
1398
1412
|
"./dist/dts/Utils.d.ts"
|
|
1413
|
+
],
|
|
1414
|
+
"index": [
|
|
1415
|
+
"./dist/dts/index.d.ts"
|
|
1399
1416
|
]
|
|
1400
1417
|
}
|
|
1401
1418
|
}
|
package/src/Data.ts
CHANGED
|
@@ -730,18 +730,21 @@ export const Error: new<A extends Record<string, any> = {}>(
|
|
|
730
730
|
: { readonly [P in keyof A]: A[P] }
|
|
731
731
|
) => Cause.YieldableError & Readonly<A> = (function() {
|
|
732
732
|
const plainArgsSymbol = Symbol.for("effect/Data/Error/plainArgs")
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
733
|
+
const O = {
|
|
734
|
+
BaseEffectError: class extends core.YieldableError {
|
|
735
|
+
constructor(args: any) {
|
|
736
|
+
super(args?.message, args?.cause ? { cause: args.cause } : undefined)
|
|
737
|
+
if (args) {
|
|
738
|
+
Object.assign(this, args)
|
|
739
|
+
Object.defineProperty(this, plainArgsSymbol, { value: args, enumerable: false })
|
|
740
|
+
}
|
|
739
741
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
}
|
|
744
|
-
}
|
|
742
|
+
toJSON() {
|
|
743
|
+
return { ...(this as any)[plainArgsSymbol], ...this }
|
|
744
|
+
}
|
|
745
|
+
} as any
|
|
746
|
+
}
|
|
747
|
+
return O.BaseEffectError
|
|
745
748
|
})()
|
|
746
749
|
|
|
747
750
|
/**
|
|
@@ -752,9 +755,11 @@ export const TaggedError = <Tag extends string>(tag: Tag): new<A extends Record<
|
|
|
752
755
|
args: Types.Equals<A, {}> extends true ? void
|
|
753
756
|
: { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }
|
|
754
757
|
) => Cause.YieldableError & { readonly _tag: Tag } & Readonly<A> => {
|
|
755
|
-
|
|
756
|
-
|
|
758
|
+
const O = {
|
|
759
|
+
BaseEffectError: class extends Error<{}> {
|
|
760
|
+
readonly _tag = tag
|
|
761
|
+
}
|
|
757
762
|
}
|
|
758
|
-
;(
|
|
759
|
-
return
|
|
763
|
+
;(O.BaseEffectError.prototype as any).name = tag
|
|
764
|
+
return O.BaseEffectError as any
|
|
760
765
|
}
|
package/src/DateTime.ts
CHANGED
|
@@ -2411,7 +2411,7 @@ export const format: {
|
|
|
2411
2411
|
(
|
|
2412
2412
|
options?:
|
|
2413
2413
|
| Intl.DateTimeFormatOptions & {
|
|
2414
|
-
readonly locale?:
|
|
2414
|
+
readonly locale?: Intl.LocalesArgument
|
|
2415
2415
|
}
|
|
2416
2416
|
| undefined
|
|
2417
2417
|
): (self: DateTime) => string
|
|
@@ -2434,7 +2434,7 @@ export const format: {
|
|
|
2434
2434
|
self: DateTime,
|
|
2435
2435
|
options?:
|
|
2436
2436
|
| Intl.DateTimeFormatOptions & {
|
|
2437
|
-
readonly locale?:
|
|
2437
|
+
readonly locale?: Intl.LocalesArgument
|
|
2438
2438
|
}
|
|
2439
2439
|
| undefined
|
|
2440
2440
|
): string
|
|
@@ -2460,7 +2460,7 @@ export const formatLocal: {
|
|
|
2460
2460
|
(
|
|
2461
2461
|
options?:
|
|
2462
2462
|
| Intl.DateTimeFormatOptions & {
|
|
2463
|
-
readonly locale?:
|
|
2463
|
+
readonly locale?: Intl.LocalesArgument
|
|
2464
2464
|
}
|
|
2465
2465
|
| undefined
|
|
2466
2466
|
): (self: DateTime) => string
|
|
@@ -2476,7 +2476,7 @@ export const formatLocal: {
|
|
|
2476
2476
|
self: DateTime,
|
|
2477
2477
|
options?:
|
|
2478
2478
|
| Intl.DateTimeFormatOptions & {
|
|
2479
|
-
readonly locale?:
|
|
2479
|
+
readonly locale?: Intl.LocalesArgument
|
|
2480
2480
|
}
|
|
2481
2481
|
| undefined
|
|
2482
2482
|
): string
|
|
@@ -2502,7 +2502,7 @@ export const formatUtc: {
|
|
|
2502
2502
|
(
|
|
2503
2503
|
options?:
|
|
2504
2504
|
| Intl.DateTimeFormatOptions & {
|
|
2505
|
-
readonly locale?:
|
|
2505
|
+
readonly locale?: Intl.LocalesArgument
|
|
2506
2506
|
}
|
|
2507
2507
|
| undefined
|
|
2508
2508
|
): (self: DateTime) => string
|
|
@@ -2518,7 +2518,7 @@ export const formatUtc: {
|
|
|
2518
2518
|
self: DateTime,
|
|
2519
2519
|
options?:
|
|
2520
2520
|
| Intl.DateTimeFormatOptions & {
|
|
2521
|
-
readonly locale?:
|
|
2521
|
+
readonly locale?: Intl.LocalesArgument
|
|
2522
2522
|
}
|
|
2523
2523
|
| undefined
|
|
2524
2524
|
): string
|
package/src/Effect.ts
CHANGED
|
@@ -28836,7 +28836,11 @@ function fnApply(options: {
|
|
|
28836
28836
|
if (options.errorCall.stack) {
|
|
28837
28837
|
const stackDef = options.errorDef.stack!.trim().split("\n")
|
|
28838
28838
|
const stackCall = options.errorCall.stack.trim().split("\n")
|
|
28839
|
-
|
|
28839
|
+
let endStack = stackDef.slice(2).join("\n").trim()
|
|
28840
|
+
if (!endStack.includes(`(`)) {
|
|
28841
|
+
endStack = endStack.replace(/at (.*)/, "at ($1)")
|
|
28842
|
+
}
|
|
28843
|
+
cache = `${endStack}\n${stackCall.slice(2).join("\n").trim()}`
|
|
28840
28844
|
return cache
|
|
28841
28845
|
}
|
|
28842
28846
|
}
|
package/src/Match.ts
CHANGED
|
@@ -1308,7 +1308,7 @@ export declare namespace Types {
|
|
|
1308
1308
|
*/
|
|
1309
1309
|
export type NotMatch<R, P> = Exclude<R, ExtractMatch<R, PForNotMatch<P>>>
|
|
1310
1310
|
|
|
1311
|
-
type PForNotMatch<P> = [
|
|
1311
|
+
type PForNotMatch<P> = [ToInvertedRefinement<P>] extends [infer X] ? X
|
|
1312
1312
|
: never
|
|
1313
1313
|
|
|
1314
1314
|
/**
|
|
@@ -1332,9 +1332,9 @@ export declare namespace Types {
|
|
|
1332
1332
|
: A extends Record<string, any> ? { [K in keyof A]: SafeRefinementR<A[K]> }
|
|
1333
1333
|
: A
|
|
1334
1334
|
|
|
1335
|
-
type ResolvePred<A> = A extends never ? never
|
|
1336
|
-
: A extends SafeRefinement<infer _A, infer _R> ?
|
|
1337
|
-
: A extends Predicate.Refinement<
|
|
1335
|
+
type ResolvePred<A, Input = any> = A extends never ? never
|
|
1336
|
+
: A extends SafeRefinement<infer _A, infer _R> ? _A
|
|
1337
|
+
: A extends Predicate.Refinement<Input, infer P> ? P
|
|
1338
1338
|
: A extends Predicate.Predicate<infer P> ? P
|
|
1339
1339
|
: A extends Record<string, any> ? { [K in keyof A]: ResolvePred<A[K]> }
|
|
1340
1340
|
: A
|
|
@@ -1346,6 +1346,13 @@ export declare namespace Types {
|
|
|
1346
1346
|
: A extends Record<string, any> ? { [K in keyof A]: ToSafeRefinement<A[K]> }
|
|
1347
1347
|
: NonLiteralsTo<A, never>
|
|
1348
1348
|
|
|
1349
|
+
type ToInvertedRefinement<A> = A extends never ? never
|
|
1350
|
+
: A extends Predicate.Refinement<any, infer P> ? SafeRefinement<P>
|
|
1351
|
+
: A extends Predicate.Predicate<infer _P> ? SafeRefinement<never>
|
|
1352
|
+
: A extends SafeRefinement<infer _A, infer _R> ? SafeRefinement<_R>
|
|
1353
|
+
: A extends Record<string, any> ? { [K in keyof A]: ToInvertedRefinement<A[K]> }
|
|
1354
|
+
: NonLiteralsTo<A, never>
|
|
1355
|
+
|
|
1349
1356
|
type NonLiteralsTo<A, T> = [A] extends [string | number | boolean | bigint] ? [string] extends [A] ? T
|
|
1350
1357
|
: [number] extends [A] ? T
|
|
1351
1358
|
: [boolean] extends [A] ? T
|
|
@@ -1446,35 +1453,32 @@ export declare namespace Types {
|
|
|
1446
1453
|
|
|
1447
1454
|
type Simplify<A> = { [K in keyof A]: A[K] } & {}
|
|
1448
1455
|
|
|
1449
|
-
type ExtractAndNarrow<Input, P> =
|
|
1450
|
-
P extends SafeRefinement<infer _In, infer _R>
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
: I[K]
|
|
1459
|
-
} extends infer R ? Fail extends R[keyof R] ? never
|
|
1460
|
-
: R
|
|
1461
|
-
: never
|
|
1462
|
-
: never
|
|
1463
|
-
: IsPlainObject<I> extends true ? string extends keyof I ? I extends P ? I
|
|
1464
|
-
: never
|
|
1465
|
-
: symbol extends keyof I ? I extends P ? I
|
|
1466
|
-
: never
|
|
1467
|
-
: Simplify<
|
|
1468
|
-
& { [RK in Extract<keyof I, keyof P>]-?: ExtractAndNarrow<I[RK], P[RK]> }
|
|
1469
|
-
& Omit<I, keyof P>
|
|
1470
|
-
> extends infer R ? keyof P extends NonFailKeys<R> ? R
|
|
1456
|
+
type ExtractAndNarrow<Input, P> = P extends Predicate.Refinement<infer _In, infer _Out> ? Extract<Input, _Out> :
|
|
1457
|
+
P extends SafeRefinement<infer _In, infer _R> ? [0] extends [1 & _R] ? Input : Extract<Input, _In> :
|
|
1458
|
+
P extends Predicate.Predicate<infer _In> ? Extract<Input, _In>
|
|
1459
|
+
: Input extends infer I ? Exclude<
|
|
1460
|
+
I extends ReadonlyArray<any> ? P extends ReadonlyArray<any> ? {
|
|
1461
|
+
readonly [K in keyof I]: K extends keyof P ? ExtractAndNarrow<I[K], P[K]>
|
|
1462
|
+
: I[K]
|
|
1463
|
+
} extends infer R ? Fail extends R[keyof R] ? never
|
|
1464
|
+
: R
|
|
1471
1465
|
: never
|
|
1472
1466
|
: never
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1467
|
+
: IsPlainObject<I> extends true ? string extends keyof I ? I extends P ? I
|
|
1468
|
+
: never
|
|
1469
|
+
: symbol extends keyof I ? I extends P ? I
|
|
1470
|
+
: never
|
|
1471
|
+
: Simplify<
|
|
1472
|
+
& { [RK in Extract<keyof I, keyof P>]-?: ExtractAndNarrow<I[RK], P[RK]> }
|
|
1473
|
+
& Omit<I, keyof P>
|
|
1474
|
+
> extends infer R ? keyof P extends NonFailKeys<R> ? R
|
|
1475
|
+
: never
|
|
1476
|
+
: never
|
|
1477
|
+
: MaybeReplace<I, P> extends infer R ? [I] extends [R] ? I
|
|
1478
|
+
: R
|
|
1479
|
+
: never,
|
|
1480
|
+
Fail
|
|
1481
|
+
> :
|
|
1478
1482
|
never
|
|
1479
1483
|
|
|
1480
1484
|
type NonFailKeys<A> = keyof A & {} extends infer K ? K extends keyof A ? A[K] extends Fail ? never : K
|
package/src/String.ts
CHANGED
|
@@ -549,7 +549,7 @@ export const lastIndexOf = (searchString: string) => (self: string): Option.Opti
|
|
|
549
549
|
* @since 2.0.0
|
|
550
550
|
*/
|
|
551
551
|
export const localeCompare =
|
|
552
|
-
(that: string, locales?:
|
|
552
|
+
(that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions) => (self: string): Ordering.Ordering =>
|
|
553
553
|
number.sign(self.localeCompare(that, locales, options))
|
|
554
554
|
|
|
555
555
|
/**
|
|
@@ -703,7 +703,7 @@ export const search: {
|
|
|
703
703
|
*
|
|
704
704
|
* @since 2.0.0
|
|
705
705
|
*/
|
|
706
|
-
export const toLocaleLowerCase = (locale?:
|
|
706
|
+
export const toLocaleLowerCase = (locale?: Intl.LocalesArgument) => (self: string): string =>
|
|
707
707
|
self.toLocaleLowerCase(locale)
|
|
708
708
|
|
|
709
709
|
/**
|
|
@@ -718,7 +718,7 @@ export const toLocaleLowerCase = (locale?: string | Array<string>) => (self: str
|
|
|
718
718
|
*
|
|
719
719
|
* @since 2.0.0
|
|
720
720
|
*/
|
|
721
|
-
export const toLocaleUpperCase = (locale?:
|
|
721
|
+
export const toLocaleUpperCase = (locale?: Intl.LocalesArgument) => (self: string): string =>
|
|
722
722
|
self.toLocaleUpperCase(locale)
|
|
723
723
|
|
|
724
724
|
/**
|
package/src/Utils.ts
CHANGED
|
@@ -774,23 +774,31 @@ export const structuralRegion = <A>(body: () => A, tester?: (a: unknown, b: unkn
|
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
776
|
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
|
|
777
|
+
const standard = {
|
|
778
|
+
effect_internal_function: <A>(body: () => A) => {
|
|
779
|
+
return body()
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
const forced = {
|
|
784
|
+
effect_internal_function: <A>(body: () => A) => {
|
|
785
|
+
try {
|
|
780
786
|
return body()
|
|
787
|
+
} finally {
|
|
788
|
+
//
|
|
781
789
|
}
|
|
782
790
|
}
|
|
783
|
-
return function<A>(fn: () => A): A {
|
|
784
|
-
return wrap[name](fn)
|
|
785
|
-
}
|
|
786
791
|
}
|
|
787
792
|
|
|
793
|
+
const isNotOptimizedAway =
|
|
794
|
+
standard.effect_internal_function(() => new Error().stack)?.includes("effect_internal_function") === true
|
|
795
|
+
|
|
788
796
|
/**
|
|
789
797
|
* @since 3.2.2
|
|
790
798
|
* @status experimental
|
|
791
799
|
* @category tracing
|
|
792
800
|
*/
|
|
793
|
-
export const internalCall =
|
|
801
|
+
export const internalCall = isNotOptimizedAway ? standard.effect_internal_function : forced.effect_internal_function
|
|
794
802
|
|
|
795
803
|
const genConstructor = (function*() {}).constructor
|
|
796
804
|
|
package/src/internal/cause.ts
CHANGED
|
@@ -983,11 +983,14 @@ const prettyErrorStack = (message: string, stack: string, span?: Span | undefine
|
|
|
983
983
|
const lines = stack.startsWith(message) ? stack.slice(message.length).split("\n") : stack.split("\n")
|
|
984
984
|
|
|
985
985
|
for (let i = 1; i < lines.length; i++) {
|
|
986
|
+
if (lines[i].includes(" at new BaseEffectError") || lines[i].includes(" at new YieldableError")) {
|
|
987
|
+
i++
|
|
988
|
+
continue
|
|
989
|
+
}
|
|
986
990
|
if (lines[i].includes("Generator.next")) {
|
|
987
991
|
break
|
|
988
992
|
}
|
|
989
993
|
if (lines[i].includes("effect_internal_function")) {
|
|
990
|
-
out.pop()
|
|
991
994
|
break
|
|
992
995
|
}
|
|
993
996
|
out.push(
|
package/src/internal/dateTime.ts
CHANGED
|
@@ -1051,7 +1051,7 @@ export const format: {
|
|
|
1051
1051
|
(
|
|
1052
1052
|
options?:
|
|
1053
1053
|
| Intl.DateTimeFormatOptions & {
|
|
1054
|
-
readonly locale?:
|
|
1054
|
+
readonly locale?: Intl.LocalesArgument
|
|
1055
1055
|
}
|
|
1056
1056
|
| undefined
|
|
1057
1057
|
): (self: DateTime.DateTime) => string
|
|
@@ -1059,7 +1059,7 @@ export const format: {
|
|
|
1059
1059
|
self: DateTime.DateTime,
|
|
1060
1060
|
options?:
|
|
1061
1061
|
| Intl.DateTimeFormatOptions & {
|
|
1062
|
-
readonly locale?:
|
|
1062
|
+
readonly locale?: Intl.LocalesArgument
|
|
1063
1063
|
}
|
|
1064
1064
|
| undefined
|
|
1065
1065
|
): string
|
|
@@ -1067,7 +1067,7 @@ export const format: {
|
|
|
1067
1067
|
self: DateTime.DateTime,
|
|
1068
1068
|
options?:
|
|
1069
1069
|
| Intl.DateTimeFormatOptions & {
|
|
1070
|
-
readonly locale?:
|
|
1070
|
+
readonly locale?: Intl.LocalesArgument
|
|
1071
1071
|
}
|
|
1072
1072
|
| undefined
|
|
1073
1073
|
): string => {
|
|
@@ -1089,7 +1089,7 @@ export const formatLocal: {
|
|
|
1089
1089
|
(
|
|
1090
1090
|
options?:
|
|
1091
1091
|
| Intl.DateTimeFormatOptions & {
|
|
1092
|
-
readonly locale?:
|
|
1092
|
+
readonly locale?: Intl.LocalesArgument
|
|
1093
1093
|
}
|
|
1094
1094
|
| undefined
|
|
1095
1095
|
): (self: DateTime.DateTime) => string
|
|
@@ -1097,7 +1097,7 @@ export const formatLocal: {
|
|
|
1097
1097
|
self: DateTime.DateTime,
|
|
1098
1098
|
options?:
|
|
1099
1099
|
| Intl.DateTimeFormatOptions & {
|
|
1100
|
-
readonly locale?:
|
|
1100
|
+
readonly locale?: Intl.LocalesArgument
|
|
1101
1101
|
}
|
|
1102
1102
|
| undefined
|
|
1103
1103
|
): string
|
|
@@ -1105,7 +1105,7 @@ export const formatLocal: {
|
|
|
1105
1105
|
self: DateTime.DateTime,
|
|
1106
1106
|
options?:
|
|
1107
1107
|
| Intl.DateTimeFormatOptions & {
|
|
1108
|
-
readonly locale?:
|
|
1108
|
+
readonly locale?: Intl.LocalesArgument
|
|
1109
1109
|
}
|
|
1110
1110
|
| undefined
|
|
1111
1111
|
): string => new Intl.DateTimeFormat(options?.locale, options).format(self.epochMillis))
|
|
@@ -1115,7 +1115,7 @@ export const formatUtc: {
|
|
|
1115
1115
|
(
|
|
1116
1116
|
options?:
|
|
1117
1117
|
| Intl.DateTimeFormatOptions & {
|
|
1118
|
-
readonly locale?:
|
|
1118
|
+
readonly locale?: Intl.LocalesArgument
|
|
1119
1119
|
}
|
|
1120
1120
|
| undefined
|
|
1121
1121
|
): (self: DateTime.DateTime) => string
|
|
@@ -1123,7 +1123,7 @@ export const formatUtc: {
|
|
|
1123
1123
|
self: DateTime.DateTime,
|
|
1124
1124
|
options?:
|
|
1125
1125
|
| Intl.DateTimeFormatOptions & {
|
|
1126
|
-
readonly locale?:
|
|
1126
|
+
readonly locale?: Intl.LocalesArgument
|
|
1127
1127
|
}
|
|
1128
1128
|
| undefined
|
|
1129
1129
|
): string
|
|
@@ -1131,7 +1131,7 @@ export const formatUtc: {
|
|
|
1131
1131
|
self: DateTime.DateTime,
|
|
1132
1132
|
options?:
|
|
1133
1133
|
| Intl.DateTimeFormatOptions & {
|
|
1134
|
-
readonly locale?:
|
|
1134
|
+
readonly locale?: Intl.LocalesArgument
|
|
1135
1135
|
}
|
|
1136
1136
|
| undefined
|
|
1137
1137
|
): string =>
|
package/src/internal/version.ts
CHANGED