effect 3.16.15 → 3.16.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/dist/cjs/Effect.js +8 -1
- package/dist/cjs/Effect.js.map +1 -1
- package/dist/cjs/Tuple.js +6 -6
- package/dist/cjs/internal/stream.js +3 -0
- package/dist/cjs/internal/stream.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Effect.d.ts.map +1 -1
- package/dist/dts/Tuple.d.ts +12 -12
- package/dist/dts/internal/stream.d.ts.map +1 -1
- package/dist/esm/Effect.js +8 -1
- package/dist/esm/Effect.js.map +1 -1
- package/dist/esm/Tuple.js +6 -6
- package/dist/esm/internal/stream.js +3 -0
- package/dist/esm/internal/stream.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Effect.ts +8 -1
- package/src/Tuple.ts +12 -12
- package/src/internal/stream.ts +3 -0
- package/src/internal/version.ts +1 -1
package/package.json
CHANGED
package/src/Effect.ts
CHANGED
|
@@ -27668,7 +27668,14 @@ const makeTagProxy = (TagClass: Context.Tag<any, any> & Record<PropertyKey, any>
|
|
|
27668
27668
|
const cn = core.andThen(target, (s: any) => s[prop])
|
|
27669
27669
|
// @effect-diagnostics-next-line floatingEffect:off
|
|
27670
27670
|
Object.assign(fn, cn)
|
|
27671
|
-
|
|
27671
|
+
const apply = fn.apply
|
|
27672
|
+
const bind = fn.bind
|
|
27673
|
+
const call = fn.call
|
|
27674
|
+
const proto = Object.setPrototypeOf({}, Object.getPrototypeOf(cn))
|
|
27675
|
+
proto.apply = apply
|
|
27676
|
+
proto.bind = bind
|
|
27677
|
+
proto.call = call
|
|
27678
|
+
Object.setPrototypeOf(fn, proto)
|
|
27672
27679
|
cache.set(prop, fn)
|
|
27673
27680
|
return fn
|
|
27674
27681
|
}
|
package/src/Tuple.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface TupleTypeLambda extends TypeLambda {
|
|
|
34
34
|
export const make = <A extends ReadonlyArray<any>>(...elements: A): A => elements
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Return the first element
|
|
37
|
+
* Return the first element from a tuple with two elements.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* ```ts
|
|
@@ -50,7 +50,7 @@ export const make = <A extends ReadonlyArray<any>>(...elements: A): A => element
|
|
|
50
50
|
export const getFirst = <L, R>(self: readonly [L, R]): L => self[0]
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Return the second element
|
|
53
|
+
* Return the second element from a tuple with two elements.
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```ts
|
|
@@ -131,7 +131,7 @@ export const map: {
|
|
|
131
131
|
)
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
|
-
* Transforms both elements of a tuple using the given functions.
|
|
134
|
+
* Transforms both elements of a tuple with two elements using the given functions.
|
|
135
135
|
*
|
|
136
136
|
* @example
|
|
137
137
|
* ```ts
|
|
@@ -149,7 +149,7 @@ export const map: {
|
|
|
149
149
|
*/
|
|
150
150
|
export const mapBoth: {
|
|
151
151
|
/**
|
|
152
|
-
* Transforms both elements of a tuple using the given functions.
|
|
152
|
+
* Transforms both elements of a tuple with two elements using the given functions.
|
|
153
153
|
*
|
|
154
154
|
* @example
|
|
155
155
|
* ```ts
|
|
@@ -172,7 +172,7 @@ export const mapBoth: {
|
|
|
172
172
|
}
|
|
173
173
|
): (self: readonly [L1, R1]) => [L2, R2]
|
|
174
174
|
/**
|
|
175
|
-
* Transforms both elements of a tuple using the given functions.
|
|
175
|
+
* Transforms both elements of a tuple with two elements using the given functions.
|
|
176
176
|
*
|
|
177
177
|
* @example
|
|
178
178
|
* ```ts
|
|
@@ -207,7 +207,7 @@ export const mapBoth: {
|
|
|
207
207
|
)
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
* Transforms the first component of a tuple using a given function.
|
|
210
|
+
* Transforms the first component of a tuple with two elements using a given function.
|
|
211
211
|
*
|
|
212
212
|
* @example
|
|
213
213
|
* ```ts
|
|
@@ -225,7 +225,7 @@ export const mapBoth: {
|
|
|
225
225
|
*/
|
|
226
226
|
export const mapFirst: {
|
|
227
227
|
/**
|
|
228
|
-
* Transforms the first component of a tuple using a given function.
|
|
228
|
+
* Transforms the first component of a tuple with two elements using a given function.
|
|
229
229
|
*
|
|
230
230
|
* @example
|
|
231
231
|
* ```ts
|
|
@@ -243,7 +243,7 @@ export const mapFirst: {
|
|
|
243
243
|
*/
|
|
244
244
|
<L1, L2>(f: (left: L1) => L2): <R>(self: readonly [L1, R]) => [L2, R]
|
|
245
245
|
/**
|
|
246
|
-
* Transforms the first component of a tuple using a given function.
|
|
246
|
+
* Transforms the first component of a tuple with two elements using a given function.
|
|
247
247
|
*
|
|
248
248
|
* @example
|
|
249
249
|
* ```ts
|
|
@@ -263,7 +263,7 @@ export const mapFirst: {
|
|
|
263
263
|
} = dual(2, <L1, R, L2>(self: readonly [L1, R], f: (left: L1) => L2): [L2, R] => [f(self[0]), self[1]])
|
|
264
264
|
|
|
265
265
|
/**
|
|
266
|
-
* Transforms the second component of a tuple using a given function.
|
|
266
|
+
* Transforms the second component of a tuple with two elements using a given function.
|
|
267
267
|
*
|
|
268
268
|
* @example
|
|
269
269
|
* ```ts
|
|
@@ -281,7 +281,7 @@ export const mapFirst: {
|
|
|
281
281
|
*/
|
|
282
282
|
export const mapSecond: {
|
|
283
283
|
/**
|
|
284
|
-
* Transforms the second component of a tuple using a given function.
|
|
284
|
+
* Transforms the second component of a tuple with two elements using a given function.
|
|
285
285
|
*
|
|
286
286
|
* @example
|
|
287
287
|
* ```ts
|
|
@@ -299,7 +299,7 @@ export const mapSecond: {
|
|
|
299
299
|
*/
|
|
300
300
|
<R1, R2>(f: (right: R1) => R2): <L>(self: readonly [L, R1]) => [L, R2]
|
|
301
301
|
/**
|
|
302
|
-
* Transforms the second component of a tuple using a given function.
|
|
302
|
+
* Transforms the second component of a tuple with two elements using a given function.
|
|
303
303
|
*
|
|
304
304
|
* @example
|
|
305
305
|
* ```ts
|
|
@@ -319,7 +319,7 @@ export const mapSecond: {
|
|
|
319
319
|
} = dual(2, <L, R1, R2>(self: readonly [L, R1], f: (right: R1) => R2): [L, R2] => [self[0], f(self[1])])
|
|
320
320
|
|
|
321
321
|
/**
|
|
322
|
-
* Swaps the
|
|
322
|
+
* Swaps the elements of a tuple with two elements.
|
|
323
323
|
*
|
|
324
324
|
* @example
|
|
325
325
|
* ```ts
|
package/src/internal/stream.ts
CHANGED
|
@@ -7348,6 +7348,7 @@ export const toAsyncIterableRuntime = dual<
|
|
|
7348
7348
|
let currentReject: ((reason: any) => void) | undefined = undefined
|
|
7349
7349
|
let fiber: Fiber.RuntimeFiber<void, E> | undefined = undefined
|
|
7350
7350
|
const latch = Effect.unsafeMakeLatch(false)
|
|
7351
|
+
let returned = false
|
|
7351
7352
|
return {
|
|
7352
7353
|
next() {
|
|
7353
7354
|
if (!fiber) {
|
|
@@ -7358,6 +7359,7 @@ export const toAsyncIterableRuntime = dual<
|
|
|
7358
7359
|
currentResolve = currentReject = undefined
|
|
7359
7360
|
}))))
|
|
7360
7361
|
fiber.addObserver((exit) => {
|
|
7362
|
+
if (returned) return
|
|
7361
7363
|
fiber = Effect.runFork(latch.whenOpen(Effect.sync(() => {
|
|
7362
7364
|
if (exit._tag === "Failure") {
|
|
7363
7365
|
currentReject!(Cause.squash(exit.cause))
|
|
@@ -7375,6 +7377,7 @@ export const toAsyncIterableRuntime = dual<
|
|
|
7375
7377
|
})
|
|
7376
7378
|
},
|
|
7377
7379
|
return() {
|
|
7380
|
+
returned = true
|
|
7378
7381
|
if (!fiber) return Promise.resolve({ done: true, value: void 0 })
|
|
7379
7382
|
return Effect.runPromise(Effect.as(Fiber.interrupt(fiber), { done: true, value: void 0 }))
|
|
7380
7383
|
}
|
package/src/internal/version.ts
CHANGED