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.
Files changed (213) hide show
  1. package/.index/package.json +6 -0
  2. package/Arbitrary/package.json +2 -2
  3. package/Array/package.json +2 -2
  4. package/BigDecimal/package.json +2 -2
  5. package/BigInt/package.json +2 -2
  6. package/Boolean/package.json +2 -2
  7. package/Brand/package.json +2 -2
  8. package/Cache/package.json +2 -2
  9. package/Cause/package.json +2 -2
  10. package/Channel/package.json +2 -2
  11. package/ChildExecutorDecision/package.json +2 -2
  12. package/Chunk/package.json +2 -2
  13. package/Clock/package.json +2 -2
  14. package/Config/package.json +2 -2
  15. package/ConfigError/package.json +2 -2
  16. package/ConfigProvider/package.json +2 -2
  17. package/ConfigProviderPathPatch/package.json +2 -2
  18. package/Console/package.json +2 -2
  19. package/Context/package.json +2 -2
  20. package/Cron/package.json +2 -2
  21. package/Data/package.json +2 -2
  22. package/DateTime/package.json +2 -2
  23. package/DefaultServices/package.json +2 -2
  24. package/Deferred/package.json +2 -2
  25. package/Differ/package.json +2 -2
  26. package/Duration/package.json +2 -2
  27. package/Effect/package.json +2 -2
  28. package/Effectable/package.json +2 -2
  29. package/Either/package.json +2 -2
  30. package/Encoding/package.json +2 -2
  31. package/Equal/package.json +2 -2
  32. package/Equivalence/package.json +2 -2
  33. package/ExecutionStrategy/package.json +2 -2
  34. package/Exit/package.json +2 -2
  35. package/FastCheck/package.json +2 -2
  36. package/Fiber/package.json +2 -2
  37. package/FiberHandle/package.json +2 -2
  38. package/FiberId/package.json +2 -2
  39. package/FiberMap/package.json +2 -2
  40. package/FiberRef/package.json +2 -2
  41. package/FiberRefs/package.json +2 -2
  42. package/FiberRefsPatch/package.json +2 -2
  43. package/FiberSet/package.json +2 -2
  44. package/FiberStatus/package.json +2 -2
  45. package/Function/package.json +2 -2
  46. package/GlobalValue/package.json +2 -2
  47. package/GroupBy/package.json +2 -2
  48. package/HKT/package.json +2 -2
  49. package/Hash/package.json +2 -2
  50. package/HashMap/package.json +2 -2
  51. package/HashSet/package.json +2 -2
  52. package/Inspectable/package.json +2 -2
  53. package/Iterable/package.json +2 -2
  54. package/JSONSchema/package.json +2 -2
  55. package/KeyedPool/package.json +2 -2
  56. package/Layer/package.json +2 -2
  57. package/LayerMap/package.json +2 -2
  58. package/List/package.json +2 -2
  59. package/LogLevel/package.json +2 -2
  60. package/LogSpan/package.json +2 -2
  61. package/Logger/package.json +2 -2
  62. package/Mailbox/package.json +2 -2
  63. package/ManagedRuntime/package.json +2 -2
  64. package/Match/package.json +2 -2
  65. package/MergeDecision/package.json +2 -2
  66. package/MergeState/package.json +2 -2
  67. package/MergeStrategy/package.json +2 -2
  68. package/Metric/package.json +2 -2
  69. package/MetricBoundaries/package.json +2 -2
  70. package/MetricHook/package.json +2 -2
  71. package/MetricKey/package.json +2 -2
  72. package/MetricKeyType/package.json +2 -2
  73. package/MetricLabel/package.json +2 -2
  74. package/MetricPair/package.json +2 -2
  75. package/MetricPolling/package.json +2 -2
  76. package/MetricRegistry/package.json +2 -2
  77. package/MetricState/package.json +2 -2
  78. package/Micro/package.json +2 -2
  79. package/ModuleVersion/package.json +2 -2
  80. package/MutableHashMap/package.json +2 -2
  81. package/MutableHashSet/package.json +2 -2
  82. package/MutableList/package.json +2 -2
  83. package/MutableQueue/package.json +2 -2
  84. package/MutableRef/package.json +2 -2
  85. package/NonEmptyIterable/package.json +2 -2
  86. package/Number/package.json +2 -2
  87. package/Option/package.json +2 -2
  88. package/Order/package.json +2 -2
  89. package/Ordering/package.json +2 -2
  90. package/ParseResult/package.json +2 -2
  91. package/Pipeable/package.json +2 -2
  92. package/Pool/package.json +2 -2
  93. package/Predicate/package.json +2 -2
  94. package/Pretty/package.json +2 -2
  95. package/PrimaryKey/package.json +2 -2
  96. package/PubSub/package.json +2 -2
  97. package/Queue/package.json +2 -2
  98. package/Random/package.json +2 -2
  99. package/RateLimiter/package.json +2 -2
  100. package/RcMap/package.json +2 -2
  101. package/RcRef/package.json +2 -2
  102. package/Readable/package.json +2 -2
  103. package/Record/package.json +2 -2
  104. package/RedBlackTree/package.json +2 -2
  105. package/Redacted/package.json +2 -2
  106. package/Ref/package.json +2 -2
  107. package/RegExp/package.json +2 -2
  108. package/Reloadable/package.json +2 -2
  109. package/Request/package.json +2 -2
  110. package/RequestBlock/package.json +2 -2
  111. package/RequestResolver/package.json +2 -2
  112. package/Resource/package.json +2 -2
  113. package/Runtime/package.json +2 -2
  114. package/RuntimeFlags/package.json +2 -2
  115. package/RuntimeFlagsPatch/package.json +2 -2
  116. package/STM/package.json +2 -2
  117. package/Schedule/package.json +2 -2
  118. package/ScheduleDecision/package.json +2 -2
  119. package/ScheduleInterval/package.json +2 -2
  120. package/ScheduleIntervals/package.json +2 -2
  121. package/Scheduler/package.json +2 -2
  122. package/Schema/package.json +2 -2
  123. package/SchemaAST/package.json +2 -2
  124. package/Scope/package.json +2 -2
  125. package/ScopedCache/package.json +2 -2
  126. package/ScopedRef/package.json +2 -2
  127. package/Secret/package.json +2 -2
  128. package/SingleProducerAsyncInput/package.json +2 -2
  129. package/Sink/package.json +2 -2
  130. package/SortedMap/package.json +2 -2
  131. package/SortedSet/package.json +2 -2
  132. package/Stream/package.json +2 -2
  133. package/StreamEmit/package.json +2 -2
  134. package/StreamHaltStrategy/package.json +2 -2
  135. package/Streamable/package.json +2 -2
  136. package/String/package.json +2 -2
  137. package/Struct/package.json +2 -2
  138. package/Subscribable/package.json +2 -2
  139. package/SubscriptionRef/package.json +2 -2
  140. package/Supervisor/package.json +2 -2
  141. package/Symbol/package.json +2 -2
  142. package/SynchronizedRef/package.json +2 -2
  143. package/TArray/package.json +2 -2
  144. package/TDeferred/package.json +2 -2
  145. package/TMap/package.json +2 -2
  146. package/TPriorityQueue/package.json +2 -2
  147. package/TPubSub/package.json +2 -2
  148. package/TQueue/package.json +2 -2
  149. package/TRandom/package.json +2 -2
  150. package/TReentrantLock/package.json +2 -2
  151. package/TRef/package.json +2 -2
  152. package/TSemaphore/package.json +2 -2
  153. package/TSet/package.json +2 -2
  154. package/TSubscriptionRef/package.json +2 -2
  155. package/Take/package.json +2 -2
  156. package/TestAnnotation/package.json +2 -2
  157. package/TestAnnotationMap/package.json +2 -2
  158. package/TestAnnotations/package.json +2 -2
  159. package/TestClock/package.json +2 -2
  160. package/TestConfig/package.json +2 -2
  161. package/TestContext/package.json +2 -2
  162. package/TestLive/package.json +2 -2
  163. package/TestServices/package.json +2 -2
  164. package/TestSized/package.json +2 -2
  165. package/Tracer/package.json +2 -2
  166. package/Trie/package.json +2 -2
  167. package/Tuple/package.json +2 -2
  168. package/Types/package.json +2 -2
  169. package/Unify/package.json +2 -2
  170. package/UpstreamPullRequest/package.json +2 -2
  171. package/UpstreamPullStrategy/package.json +2 -2
  172. package/Utils/package.json +2 -2
  173. package/dist/cjs/Data.js +27 -23
  174. package/dist/cjs/Data.js.map +1 -1
  175. package/dist/cjs/Effect.js +5 -1
  176. package/dist/cjs/Effect.js.map +1 -1
  177. package/dist/cjs/String.js.map +1 -1
  178. package/dist/cjs/Utils.js +13 -8
  179. package/dist/cjs/Utils.js.map +1 -1
  180. package/dist/cjs/internal/cause.js +4 -1
  181. package/dist/cjs/internal/cause.js.map +1 -1
  182. package/dist/cjs/internal/version.js +1 -1
  183. package/dist/dts/Data.d.ts.map +1 -1
  184. package/dist/dts/DateTime.d.ts +6 -6
  185. package/dist/dts/DateTime.d.ts.map +1 -1
  186. package/dist/dts/Effect.d.ts.map +1 -1
  187. package/dist/dts/Match.d.ts +6 -5
  188. package/dist/dts/Match.d.ts.map +1 -1
  189. package/dist/dts/String.d.ts +3 -3
  190. package/dist/dts/String.d.ts.map +1 -1
  191. package/dist/dts/Utils.d.ts +1 -1
  192. package/dist/dts/Utils.d.ts.map +1 -1
  193. package/dist/esm/Data.js +27 -23
  194. package/dist/esm/Data.js.map +1 -1
  195. package/dist/esm/Effect.js +5 -1
  196. package/dist/esm/Effect.js.map +1 -1
  197. package/dist/esm/String.js.map +1 -1
  198. package/dist/esm/Utils.js +13 -8
  199. package/dist/esm/Utils.js.map +1 -1
  200. package/dist/esm/internal/cause.js +4 -1
  201. package/dist/esm/internal/cause.js.map +1 -1
  202. package/dist/esm/internal/version.js +1 -1
  203. package/index/package.json +6 -0
  204. package/package.json +18 -1
  205. package/src/Data.ts +20 -15
  206. package/src/DateTime.ts +6 -6
  207. package/src/Effect.ts +5 -1
  208. package/src/Match.ts +35 -31
  209. package/src/String.ts +3 -3
  210. package/src/Utils.ts +15 -7
  211. package/src/internal/cause.ts +4 -1
  212. package/src/internal/dateTime.ts +9 -9
  213. 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.15",
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
- return class Base extends core.YieldableError {
734
- constructor(args: any) {
735
- super(args?.message, args?.cause ? { cause: args.cause } : undefined)
736
- if (args) {
737
- Object.assign(this, args)
738
- Object.defineProperty(this, plainArgsSymbol, { value: args, enumerable: false })
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
- toJSON() {
742
- return { ...(this as any)[plainArgsSymbol], ...this }
743
- }
744
- } as any
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
- class Base extends Error<{}> {
756
- readonly _tag = tag
758
+ const O = {
759
+ BaseEffectError: class extends Error<{}> {
760
+ readonly _tag = tag
761
+ }
757
762
  }
758
- ;(Base.prototype as any).name = tag
759
- return Base as any
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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
- cache = `${stackDef.slice(2).join("\n").trim()}\n${stackCall.slice(2).join("\n").trim()}`
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> = [ToSafeRefinement<P>] extends [infer X] ? X
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> ? _R
1337
- : A extends Predicate.Refinement<any, infer P> ? P
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> = Input extends infer I ?
1450
- P extends SafeRefinement<infer _In, infer _R> | Predicate.Refinement<infer _In, infer _R> ?
1451
- P extends SafeRefinement<I & {}, infer _R> | Predicate.Refinement<I & {}, infer _R> ?
1452
- [0] extends [1 & _R] ? I : _R
1453
- : Extract<I, _R> :
1454
- P extends Predicate.Predicate<infer _In> ? P extends Predicate.Predicate<I & {}> ? _In : never :
1455
- Exclude<
1456
- I extends ReadonlyArray<any> ? P extends ReadonlyArray<any> ? {
1457
- readonly [K in keyof I]: K extends keyof P ? ExtractAndNarrow<I[K], P[K]>
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
- : MaybeReplace<I, P> extends infer R ? [I] extends [R] ? I
1474
- : R
1475
- : never,
1476
- Fail
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?: Array<string>, options?: Intl.CollatorOptions) => (self: string): Ordering.Ordering =>
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?: string | Array<string>) => (self: string): string =>
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?: string | Array<string>) => (self: string): string =>
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 tracingFunction = (name: string) => {
778
- const wrap = {
779
- [name]<A>(body: () => A) {
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 = tracingFunction("effect_internal_function")
801
+ export const internalCall = isNotOptimizedAway ? standard.effect_internal_function : forced.effect_internal_function
794
802
 
795
803
  const genConstructor = (function*() {}).constructor
796
804
 
@@ -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(
@@ -1051,7 +1051,7 @@ export const format: {
1051
1051
  (
1052
1052
  options?:
1053
1053
  | Intl.DateTimeFormatOptions & {
1054
- readonly locale?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
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?: string | undefined
1134
+ readonly locale?: Intl.LocalesArgument
1135
1135
  }
1136
1136
  | undefined
1137
1137
  ): string =>
@@ -1,4 +1,4 @@
1
- let moduleVersion = "3.14.15"
1
+ let moduleVersion = "3.14.17"
2
2
 
3
3
  export const getCurrentVersion = () => moduleVersion
4
4