effect 3.5.4 → 3.5.6

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.
@@ -1,4 +1,4 @@
1
- let moduleVersion = "3.5.4";
1
+ let moduleVersion = "3.5.6";
2
2
  export const getCurrentVersion = () => moduleVersion;
3
3
  export const setCurrentVersion = version => {
4
4
  moduleVersion = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "effect",
3
- "version": "3.5.4",
3
+ "version": "3.5.6",
4
4
  "description": "The missing standard library for TypeScript, for writing production-grade software.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/Record.ts CHANGED
@@ -895,7 +895,8 @@ export const partition: {
895
895
  *
896
896
  * @since 2.0.0
897
897
  */
898
- export const keys = <K extends string, A>(self: ReadonlyRecord<K, A>): Array<K> => Object.keys(self) as Array<K>
898
+ export const keys = <K extends string | symbol, A>(self: ReadonlyRecord<K, A>): Array<K & string> =>
899
+ Object.keys(self) as Array<K & string>
899
900
 
900
901
  /**
901
902
  * Retrieve the values of a given record as an array.
package/src/Stream.ts CHANGED
@@ -2129,7 +2129,7 @@ export const groupBy: {
2129
2129
  * ```
2130
2130
  *
2131
2131
  * @since 2.0.0
2132
- * @category utils
2132
+ * @category grouping
2133
2133
  */
2134
2134
  export const groupByKey: {
2135
2135
  <A, K>(
@@ -2167,7 +2167,7 @@ export const groupByKey: {
2167
2167
  * // }
2168
2168
  *
2169
2169
  * @since 2.0.0
2170
- * @category utils
2170
+ * @category grouping
2171
2171
  */
2172
2172
  export const grouped: {
2173
2173
  (chunkSize: number): <A, E, R>(self: Stream<A, E, R>) => Stream<Chunk.Chunk<A>, E, R>
@@ -2216,7 +2216,7 @@ export const grouped: {
2216
2216
  * // ]
2217
2217
  *
2218
2218
  * @since 2.0.0
2219
- * @category utils
2219
+ * @category grouping
2220
2220
  */
2221
2221
  export const groupedWithin: {
2222
2222
  (
@@ -29,7 +29,7 @@ import type * as MetricLabel from "../MetricLabel.js"
29
29
  import * as MutableRef from "../MutableRef.js"
30
30
  import * as Option from "../Option.js"
31
31
  import { pipeArguments } from "../Pipeable.js"
32
- import { hasProperty, isObject, isPromiseLike, isString, type Predicate, type Refinement } from "../Predicate.js"
32
+ import { hasProperty, isObject, isPromiseLike, type Predicate, type Refinement } from "../Predicate.js"
33
33
  import type * as Request from "../Request.js"
34
34
  import type * as BlockedRequests from "../RequestBlock.js"
35
35
  import type * as RequestResolver from "../RequestResolver.js"
@@ -2186,6 +2186,8 @@ export const YieldableError: new(message?: string, options?: ErrorOptions) => Ca
2186
2186
  [NodeInspectSymbol]() {
2187
2187
  if (this.toString !== globalThis.Error.prototype.toString) {
2188
2188
  return this.stack ? `${this.toString()}\n${this.stack.split("\n").slice(1).join("\n")}` : this.toString()
2189
+ } else if ("Bun" in globalThis) {
2190
+ return internalCause.pretty(internalCause.fail(this), { renderErrorCause: true })
2189
2191
  }
2190
2192
  return this
2191
2193
  }
@@ -2311,12 +2313,14 @@ export const UnknownExceptionTypeId: Cause.UnknownExceptionTypeId = Symbol.for(
2311
2313
  ) as Cause.UnknownExceptionTypeId
2312
2314
 
2313
2315
  /** @internal */
2314
- export const UnknownException: new(error: unknown, message?: string | undefined) => Cause.UnknownException =
2316
+ export const UnknownException: new(cause: unknown, message?: string | undefined) => Cause.UnknownException =
2315
2317
  (function() {
2316
2318
  class UnknownException extends YieldableError {
2317
2319
  readonly _tag = "UnknownException"
2318
- constructor(readonly error: unknown, message?: string) {
2319
- super(message ?? (hasProperty(error, "message") && isString(error.message) ? error.message : void 0))
2320
+ readonly error: unknown
2321
+ constructor(readonly cause: unknown, message?: string) {
2322
+ super(message ?? "An unknown error occurred", { cause })
2323
+ this.error = cause
2320
2324
  }
2321
2325
  }
2322
2326
  Object.assign(UnknownException.prototype, {
@@ -8343,4 +8343,4 @@ export const fromEventListener = <A = unknown>(
8343
8343
  }
8344
8344
  target.addEventListener(type, cb as any, options)
8345
8345
  return Effect.sync(() => target.removeEventListener(type, cb, options))
8346
- })
8346
+ }, "unbounded")
@@ -1,4 +1,4 @@
1
- let moduleVersion = "3.5.4"
1
+ let moduleVersion = "3.5.6"
2
2
 
3
3
  export const getCurrentVersion = () => moduleVersion
4
4