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.
- package/dist/cjs/Record.js.map +1 -1
- package/dist/cjs/Stream.js +3 -3
- package/dist/cjs/internal/core.js +12 -4
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/stream.js +1 -1
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Record.d.ts +1 -1
- package/dist/dts/Record.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +3 -3
- package/dist/esm/Record.js.map +1 -1
- package/dist/esm/Stream.js +3 -3
- package/dist/esm/internal/core.js +13 -5
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/stream.js +1 -1
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Record.ts +2 -1
- package/src/Stream.ts +3 -3
- package/src/internal/core.ts +8 -4
- package/src/internal/stream.ts +1 -1
- package/src/internal/version.ts +1 -1
package/package.json
CHANGED
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> =>
|
|
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
|
|
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
|
|
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
|
|
2219
|
+
* @category grouping
|
|
2220
2220
|
*/
|
|
2221
2221
|
export const groupedWithin: {
|
|
2222
2222
|
(
|
package/src/internal/core.ts
CHANGED
|
@@ -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,
|
|
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(
|
|
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
|
-
|
|
2319
|
-
|
|
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, {
|
package/src/internal/stream.ts
CHANGED
package/src/internal/version.ts
CHANGED