effect 3.6.4 → 3.6.5
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/Metric.js +12 -3
- package/dist/cjs/Metric.js.map +1 -1
- package/dist/cjs/MetricHook.js +6 -1
- package/dist/cjs/MetricHook.js.map +1 -1
- package/dist/cjs/Pipeable.js +2 -0
- package/dist/cjs/Pipeable.js.map +1 -1
- package/dist/cjs/internal/metric/hook.js +32 -10
- package/dist/cjs/internal/metric/hook.js.map +1 -1
- package/dist/cjs/internal/metric/keyType.js +12 -48
- package/dist/cjs/internal/metric/keyType.js.map +1 -1
- package/dist/cjs/internal/metric/polling.js +7 -1
- package/dist/cjs/internal/metric/polling.js.map +1 -1
- package/dist/cjs/internal/metric.js +21 -13
- package/dist/cjs/internal/metric.js.map +1 -1
- package/dist/cjs/internal/version.js +1 -1
- package/dist/dts/Metric.d.ts +21 -8
- package/dist/dts/Metric.d.ts.map +1 -1
- package/dist/dts/MetricHook.d.ts +10 -0
- package/dist/dts/MetricHook.d.ts.map +1 -1
- package/dist/dts/Pipeable.d.ts +1 -0
- package/dist/dts/Pipeable.d.ts.map +1 -1
- package/dist/dts/internal/metric/keyType.d.ts +1 -89
- package/dist/dts/internal/metric/keyType.d.ts.map +1 -1
- package/dist/esm/Metric.js +11 -2
- package/dist/esm/Metric.js.map +1 -1
- package/dist/esm/MetricHook.js +5 -0
- package/dist/esm/MetricHook.js.map +1 -1
- package/dist/esm/Pipeable.js +2 -0
- package/dist/esm/Pipeable.js.map +1 -1
- package/dist/esm/internal/metric/hook.js +31 -9
- package/dist/esm/internal/metric/hook.js.map +1 -1
- package/dist/esm/internal/metric/keyType.js +12 -48
- package/dist/esm/internal/metric/keyType.js.map +1 -1
- package/dist/esm/internal/metric/polling.js +7 -1
- package/dist/esm/internal/metric/polling.js.map +1 -1
- package/dist/esm/internal/metric.js +20 -12
- package/dist/esm/internal/metric.js.map +1 -1
- package/dist/esm/internal/version.js +1 -1
- package/package.json +1 -1
- package/src/Metric.ts +25 -9
- package/src/MetricHook.ts +11 -0
- package/src/Pipeable.ts +3 -0
- package/src/internal/metric/hook.ts +36 -9
- package/src/internal/metric/keyType.ts +12 -48
- package/src/internal/metric/polling.ts +8 -1
- package/src/internal/metric.ts +61 -17
- package/src/internal/version.ts +1 -1
|
@@ -30,6 +30,7 @@ export const make = <In, Out>(
|
|
|
30
30
|
options: {
|
|
31
31
|
readonly get: LazyArg<Out>
|
|
32
32
|
readonly update: (input: In) => void
|
|
33
|
+
readonly modify: (input: In) => void
|
|
33
34
|
}
|
|
34
35
|
): MetricHook.MetricHook<In, Out> => ({
|
|
35
36
|
[MetricHookTypeId]: metricHookVariance,
|
|
@@ -39,6 +40,23 @@ export const make = <In, Out>(
|
|
|
39
40
|
...options
|
|
40
41
|
})
|
|
41
42
|
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const onModify = dual<
|
|
45
|
+
<In, Out>(f: (input: In) => void) => (self: MetricHook.MetricHook<In, Out>) => MetricHook.MetricHook<In, Out>,
|
|
46
|
+
<In, Out>(self: MetricHook.MetricHook<In, Out>, f: (input: In) => void) => MetricHook.MetricHook<In, Out>
|
|
47
|
+
>(2, (self, f) => ({
|
|
48
|
+
[MetricHookTypeId]: metricHookVariance,
|
|
49
|
+
pipe() {
|
|
50
|
+
return pipeArguments(this, arguments)
|
|
51
|
+
},
|
|
52
|
+
get: self.get,
|
|
53
|
+
update: self.update,
|
|
54
|
+
modify: (input) => {
|
|
55
|
+
self.modify(input)
|
|
56
|
+
return f(input)
|
|
57
|
+
}
|
|
58
|
+
}))
|
|
59
|
+
|
|
42
60
|
/** @internal */
|
|
43
61
|
export const onUpdate = dual<
|
|
44
62
|
<In, Out>(f: (input: In) => void) => (self: MetricHook.MetricHook<In, Out>) => MetricHook.MetricHook<In, Out>,
|
|
@@ -52,7 +70,8 @@ export const onUpdate = dual<
|
|
|
52
70
|
update: (input) => {
|
|
53
71
|
self.update(input)
|
|
54
72
|
return f(input)
|
|
55
|
-
}
|
|
73
|
+
},
|
|
74
|
+
modify: self.modify
|
|
56
75
|
}))
|
|
57
76
|
|
|
58
77
|
const bigint0 = BigInt(0)
|
|
@@ -67,13 +86,15 @@ export const counter = <A extends (number | bigint)>(
|
|
|
67
86
|
? (value: A) => value >= bigint0
|
|
68
87
|
: (value: A) => value >= 0
|
|
69
88
|
: (_value: A) => true
|
|
89
|
+
const update = (value: A) => {
|
|
90
|
+
if (canUpdate(value)) {
|
|
91
|
+
sum = (sum as any) + value
|
|
92
|
+
}
|
|
93
|
+
}
|
|
70
94
|
return make({
|
|
71
95
|
get: () => metricState.counter(sum as number) as unknown as MetricState.MetricState.Counter<A>,
|
|
72
|
-
update
|
|
73
|
-
|
|
74
|
-
sum = (sum as any) + value
|
|
75
|
-
}
|
|
76
|
-
}
|
|
96
|
+
update,
|
|
97
|
+
modify: update
|
|
77
98
|
})
|
|
78
99
|
}
|
|
79
100
|
|
|
@@ -89,7 +110,8 @@ export const frequency = (key: MetricKey.MetricKey.Frequency): MetricHook.Metric
|
|
|
89
110
|
}
|
|
90
111
|
return make({
|
|
91
112
|
get: () => metricState.frequency(values),
|
|
92
|
-
update
|
|
113
|
+
update,
|
|
114
|
+
modify: update
|
|
93
115
|
})
|
|
94
116
|
}
|
|
95
117
|
|
|
@@ -106,6 +128,9 @@ export const gauge: {
|
|
|
106
128
|
get: () => metricState.gauge(value as number) as unknown as MetricState.MetricState.Gauge<A>,
|
|
107
129
|
update: (v) => {
|
|
108
130
|
value = v
|
|
131
|
+
},
|
|
132
|
+
modify: (v) => {
|
|
133
|
+
value = (value as any) + v
|
|
109
134
|
}
|
|
110
135
|
})
|
|
111
136
|
}
|
|
@@ -182,7 +207,8 @@ export const histogram = (key: MetricKey.MetricKey.Histogram): MetricHook.Metric
|
|
|
182
207
|
max,
|
|
183
208
|
sum
|
|
184
209
|
}),
|
|
185
|
-
update
|
|
210
|
+
update,
|
|
211
|
+
modify: update
|
|
186
212
|
})
|
|
187
213
|
}
|
|
188
214
|
|
|
@@ -258,7 +284,8 @@ export const summary = (key: MetricKey.MetricKey.Summary): MetricHook.MetricHook
|
|
|
258
284
|
max,
|
|
259
285
|
sum
|
|
260
286
|
}),
|
|
261
|
-
update: ([value, timestamp]) => observe(value, timestamp)
|
|
287
|
+
update: ([value, timestamp]) => observe(value, timestamp),
|
|
288
|
+
modify: ([value, timestamp]) => observe(value, timestamp)
|
|
262
289
|
})
|
|
263
290
|
}
|
|
264
291
|
|
|
@@ -117,10 +117,7 @@ class GaugeKeyType<A extends (number | bigint)> implements MetricKeyType.MetricK
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
/**
|
|
121
|
-
* @category model
|
|
122
|
-
* @since 2.0.0
|
|
123
|
-
*/
|
|
120
|
+
/** @internal */
|
|
124
121
|
export class HistogramKeyType implements MetricKeyType.MetricKeyType.Histogram {
|
|
125
122
|
readonly [MetricKeyTypeTypeId] = metricKeyTypeVariance
|
|
126
123
|
readonly [HistogramKeyTypeTypeId]: MetricKeyType.HistogramKeyTypeTypeId = HistogramKeyTypeTypeId
|
|
@@ -176,10 +173,7 @@ class SummaryKeyType implements MetricKeyType.MetricKeyType.Summary {
|
|
|
176
173
|
}
|
|
177
174
|
}
|
|
178
175
|
|
|
179
|
-
/**
|
|
180
|
-
* @since 2.0.0
|
|
181
|
-
* @category constructors
|
|
182
|
-
*/
|
|
176
|
+
/** @internal */
|
|
183
177
|
export const counter: <A extends number | bigint>(options?: {
|
|
184
178
|
readonly bigint: boolean
|
|
185
179
|
readonly incremental: boolean
|
|
@@ -189,18 +183,12 @@ export const counter: <A extends number | bigint>(options?: {
|
|
|
189
183
|
options?.bigint ?? false
|
|
190
184
|
)
|
|
191
185
|
|
|
192
|
-
/**
|
|
193
|
-
* @since 2.0.0
|
|
194
|
-
* @category constructors
|
|
195
|
-
*/
|
|
186
|
+
/** @internal */
|
|
196
187
|
export const frequency = (options?: {
|
|
197
188
|
readonly preregisteredWords?: ReadonlyArray<string> | undefined
|
|
198
189
|
}): MetricKeyType.MetricKeyType.Frequency => new FrequencyKeyType(options?.preregisteredWords ?? [])
|
|
199
190
|
|
|
200
|
-
/**
|
|
201
|
-
* @since 2.0.0
|
|
202
|
-
* @category constructors
|
|
203
|
-
*/
|
|
191
|
+
/** @internal */
|
|
204
192
|
export const gauge: <A extends number | bigint>(options?: {
|
|
205
193
|
readonly bigint: boolean
|
|
206
194
|
}) => GaugeKeyType<A> = (options) =>
|
|
@@ -208,18 +196,12 @@ export const gauge: <A extends number | bigint>(options?: {
|
|
|
208
196
|
options?.bigint ?? false
|
|
209
197
|
)
|
|
210
198
|
|
|
211
|
-
/**
|
|
212
|
-
* @since 2.0.0
|
|
213
|
-
* @category constructors
|
|
214
|
-
*/
|
|
199
|
+
/** @internal */
|
|
215
200
|
export const histogram = (boundaries: MetricBoundaries.MetricBoundaries): MetricKeyType.MetricKeyType.Histogram => {
|
|
216
201
|
return new HistogramKeyType(boundaries)
|
|
217
202
|
}
|
|
218
203
|
|
|
219
|
-
/**
|
|
220
|
-
* @since 2.0.0
|
|
221
|
-
* @category constructors
|
|
222
|
-
*/
|
|
204
|
+
/** @internal */
|
|
223
205
|
export const summary = (
|
|
224
206
|
options: {
|
|
225
207
|
readonly maxAge: Duration.DurationInput
|
|
@@ -231,44 +213,26 @@ export const summary = (
|
|
|
231
213
|
return new SummaryKeyType(Duration.decode(options.maxAge), options.maxSize, options.error, options.quantiles)
|
|
232
214
|
}
|
|
233
215
|
|
|
234
|
-
/**
|
|
235
|
-
* @since 2.0.0
|
|
236
|
-
* @category refinements
|
|
237
|
-
*/
|
|
216
|
+
/** @internal */
|
|
238
217
|
export const isMetricKeyType = (u: unknown): u is MetricKeyType.MetricKeyType<unknown, unknown> =>
|
|
239
218
|
hasProperty(u, MetricKeyTypeTypeId)
|
|
240
219
|
|
|
241
|
-
/**
|
|
242
|
-
* @since 2.0.0
|
|
243
|
-
* @category refinements
|
|
244
|
-
*/
|
|
220
|
+
/** @internal */
|
|
245
221
|
export const isCounterKey = (u: unknown): u is MetricKeyType.MetricKeyType.Counter<number | bigint> =>
|
|
246
222
|
hasProperty(u, CounterKeyTypeTypeId)
|
|
247
223
|
|
|
248
|
-
/**
|
|
249
|
-
* @since 2.0.0
|
|
250
|
-
* @category refinements
|
|
251
|
-
*/
|
|
224
|
+
/** @internal */
|
|
252
225
|
export const isFrequencyKey = (u: unknown): u is MetricKeyType.MetricKeyType.Frequency =>
|
|
253
226
|
hasProperty(u, FrequencyKeyTypeTypeId)
|
|
254
227
|
|
|
255
|
-
/**
|
|
256
|
-
* @since 2.0.0
|
|
257
|
-
* @category refinements
|
|
258
|
-
*/
|
|
228
|
+
/** @internal */
|
|
259
229
|
export const isGaugeKey = (u: unknown): u is MetricKeyType.MetricKeyType.Gauge<number | bigint> =>
|
|
260
230
|
hasProperty(u, GaugeKeyTypeTypeId)
|
|
261
231
|
|
|
262
|
-
/**
|
|
263
|
-
* @since 2.0.0
|
|
264
|
-
* @category refinements
|
|
265
|
-
*/
|
|
232
|
+
/** @internal */
|
|
266
233
|
export const isHistogramKey = (u: unknown): u is MetricKeyType.MetricKeyType.Histogram =>
|
|
267
234
|
hasProperty(u, HistogramKeyTypeTypeId)
|
|
268
235
|
|
|
269
|
-
/**
|
|
270
|
-
* @since 2.0.0
|
|
271
|
-
* @category refinements
|
|
272
|
-
*/
|
|
236
|
+
/** @internal */
|
|
273
237
|
export const isSummaryKey = (u: unknown): u is MetricKeyType.MetricKeyType.Summary =>
|
|
274
238
|
hasProperty(u, SummaryKeyTypeTypeId)
|
|
@@ -56,7 +56,14 @@ export const collectAll = <R, E, Out>(
|
|
|
56
56
|
(extraTags) =>
|
|
57
57
|
Array.from(
|
|
58
58
|
metrics.map((pollingMetric) => pollingMetric.metric.unsafeValue(extraTags))
|
|
59
|
-
)
|
|
59
|
+
),
|
|
60
|
+
(inputs: Array<any>, extraTags) => {
|
|
61
|
+
for (let i = 0; i < inputs.length; i++) {
|
|
62
|
+
const pollingMetric = metrics[i]!
|
|
63
|
+
const input = pipe(inputs, (x) => x[i])
|
|
64
|
+
pollingMetric.metric.unsafeModify(input, extraTags)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
60
67
|
),
|
|
61
68
|
poll: core.forEachSequential(metrics, (metric) => metric.poll)
|
|
62
69
|
}
|
package/src/internal/metric.ts
CHANGED
|
@@ -20,6 +20,7 @@ import * as _effect from "./core-effect.js"
|
|
|
20
20
|
import * as core from "./core.js"
|
|
21
21
|
import * as metricBoundaries from "./metric/boundaries.js"
|
|
22
22
|
import * as metricKey from "./metric/key.js"
|
|
23
|
+
import * as metricKeyType from "./metric/keyType.js"
|
|
23
24
|
import * as metricLabel from "./metric/label.js"
|
|
24
25
|
import * as metricRegistry from "./metric/registry.js"
|
|
25
26
|
|
|
@@ -50,7 +51,8 @@ export const globalMetricRegistry: MetricRegistry.MetricRegistry = globalValue(
|
|
|
50
51
|
export const make: Metric.MetricApply = function<Type, In, Out>(
|
|
51
52
|
keyType: Type,
|
|
52
53
|
unsafeUpdate: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void,
|
|
53
|
-
unsafeValue: (extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => Out
|
|
54
|
+
unsafeValue: (extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => Out,
|
|
55
|
+
unsafeModify: (input: In, extraTags: ReadonlyArray<MetricLabel.MetricLabel>) => void
|
|
54
56
|
): Metric.Metric<Type, In, Out> {
|
|
55
57
|
const metric: Metric.Metric<Type, In, Out> = Object.assign(
|
|
56
58
|
<A extends In, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
@@ -60,6 +62,7 @@ export const make: Metric.MetricApply = function<Type, In, Out>(
|
|
|
60
62
|
keyType,
|
|
61
63
|
unsafeUpdate,
|
|
62
64
|
unsafeValue,
|
|
65
|
+
unsafeModify,
|
|
63
66
|
register() {
|
|
64
67
|
this.unsafeValue([])
|
|
65
68
|
return this as any
|
|
@@ -80,7 +83,8 @@ export const mapInput = dual<
|
|
|
80
83
|
make(
|
|
81
84
|
self.keyType,
|
|
82
85
|
(input, extraTags) => self.unsafeUpdate(f(input), extraTags),
|
|
83
|
-
self.unsafeValue
|
|
86
|
+
self.unsafeValue,
|
|
87
|
+
(input, extraTags) => self.unsafeModify(f(input), extraTags)
|
|
84
88
|
))
|
|
85
89
|
|
|
86
90
|
/** @internal */
|
|
@@ -149,7 +153,8 @@ export const fromMetricKey = <Type extends MetricKeyType.MetricKeyType<any, any>
|
|
|
149
153
|
return make(
|
|
150
154
|
key.keyType,
|
|
151
155
|
(input, extraTags) => hook(extraTags).update(input),
|
|
152
|
-
(extraTags) => hook(extraTags).get()
|
|
156
|
+
(extraTags) => hook(extraTags).get(),
|
|
157
|
+
(input, extraTags) => hook(extraTags).modify(input)
|
|
153
158
|
)
|
|
154
159
|
}
|
|
155
160
|
|
|
@@ -171,20 +176,30 @@ export const histogram = (name: string, boundaries: MetricBoundaries.MetricBound
|
|
|
171
176
|
|
|
172
177
|
/* @internal */
|
|
173
178
|
export const increment = (
|
|
174
|
-
self:
|
|
175
|
-
|
|
179
|
+
self:
|
|
180
|
+
| Metric.Metric.Counter<number>
|
|
181
|
+
| Metric.Metric.Counter<bigint>
|
|
182
|
+
| Metric.Metric.Gauge<number>
|
|
183
|
+
| Metric.Metric.Gauge<bigint>
|
|
184
|
+
): Effect.Effect<void> =>
|
|
185
|
+
metricKeyType.isCounterKey(self.keyType)
|
|
186
|
+
? update(self as Metric.Metric.Counter<number>, self.keyType.bigint ? BigInt(1) as any : 1)
|
|
187
|
+
: modify(self as Metric.Metric.Gauge<number>, self.keyType.bigint ? BigInt(1) as any : 1)
|
|
176
188
|
|
|
177
189
|
/* @internal */
|
|
178
190
|
export const incrementBy = dual<
|
|
179
191
|
{
|
|
180
|
-
(amount: number): (self: Metric.Metric.Counter<number>) => Effect.Effect<void>
|
|
181
|
-
(amount: bigint): (self: Metric.Metric.Counter<bigint>) => Effect.Effect<void>
|
|
192
|
+
(amount: number): (self: Metric.Metric.Counter<number> | Metric.Metric.Counter<number>) => Effect.Effect<void>
|
|
193
|
+
(amount: bigint): (self: Metric.Metric.Counter<bigint> | Metric.Metric.Gauge<bigint>) => Effect.Effect<void>
|
|
182
194
|
},
|
|
183
195
|
{
|
|
184
|
-
(self: Metric.Metric.Counter<number>, amount: number): Effect.Effect<void>
|
|
185
|
-
(self: Metric.Metric.Counter<bigint>, amount: bigint): Effect.Effect<void>
|
|
196
|
+
(self: Metric.Metric.Counter<number> | Metric.Metric.Gauge<number>, amount: number): Effect.Effect<void>
|
|
197
|
+
(self: Metric.Metric.Counter<bigint> | Metric.Metric.Gauge<bigint>, amount: bigint): Effect.Effect<void>
|
|
186
198
|
}
|
|
187
|
-
>(2, (self, amount) =>
|
|
199
|
+
>(2, (self, amount) =>
|
|
200
|
+
metricKeyType.isCounterKey(self.keyType)
|
|
201
|
+
? update(self as any, amount)
|
|
202
|
+
: modify(self as any, amount))
|
|
188
203
|
|
|
189
204
|
/** @internal */
|
|
190
205
|
export const map = dual<
|
|
@@ -194,7 +209,8 @@ export const map = dual<
|
|
|
194
209
|
make(
|
|
195
210
|
self.keyType,
|
|
196
211
|
self.unsafeUpdate,
|
|
197
|
-
(extraTags) => f(self.unsafeValue(extraTags))
|
|
212
|
+
(extraTags) => f(self.unsafeValue(extraTags)),
|
|
213
|
+
self.unsafeModify
|
|
198
214
|
))
|
|
199
215
|
|
|
200
216
|
/** @internal */
|
|
@@ -208,7 +224,23 @@ export const mapType = dual<
|
|
|
208
224
|
self: Metric.Metric<Type, In, Out>,
|
|
209
225
|
f: (type: Type) => Type2
|
|
210
226
|
) => Metric.Metric<Type2, In, Out>
|
|
211
|
-
>(2, (self, f) =>
|
|
227
|
+
>(2, (self, f) =>
|
|
228
|
+
make(
|
|
229
|
+
f(self.keyType),
|
|
230
|
+
self.unsafeUpdate,
|
|
231
|
+
self.unsafeValue,
|
|
232
|
+
self.unsafeModify
|
|
233
|
+
))
|
|
234
|
+
|
|
235
|
+
/** @internal */
|
|
236
|
+
export const modify = dual<
|
|
237
|
+
<In>(input: In) => <Type, Out>(self: Metric.Metric<Type, In, Out>) => Effect.Effect<void>,
|
|
238
|
+
<Type, In, Out>(self: Metric.Metric<Type, In, Out>, input: In) => Effect.Effect<void>
|
|
239
|
+
>(2, (self, input) =>
|
|
240
|
+
core.fiberRefGetWith(
|
|
241
|
+
core.currentMetricLabels,
|
|
242
|
+
(tags) => core.sync(() => self.unsafeModify(input, tags))
|
|
243
|
+
))
|
|
212
244
|
|
|
213
245
|
/* @internal */
|
|
214
246
|
export const set = dual<
|
|
@@ -223,11 +255,12 @@ export const set = dual<
|
|
|
223
255
|
>(2, (self, value) => update(self as any, value))
|
|
224
256
|
|
|
225
257
|
/** @internal */
|
|
226
|
-
export const succeed = <Out>(out: Out): Metric.Metric<void, unknown, Out> =>
|
|
258
|
+
export const succeed = <Out>(out: Out): Metric.Metric<void, unknown, Out> =>
|
|
259
|
+
make(void 0 as void, constVoid, () => out, constVoid)
|
|
227
260
|
|
|
228
261
|
/** @internal */
|
|
229
262
|
export const sync = <Out>(evaluate: LazyArg<Out>): Metric.Metric<void, unknown, Out> =>
|
|
230
|
-
make(void 0 as void, constVoid, evaluate)
|
|
263
|
+
make(void 0 as void, constVoid, evaluate, constVoid)
|
|
231
264
|
|
|
232
265
|
/** @internal */
|
|
233
266
|
export const summary = (
|
|
@@ -277,7 +310,12 @@ export const taggedWithLabelsInput = dual<
|
|
|
277
310
|
input,
|
|
278
311
|
Arr.union(f(input), extraTags)
|
|
279
312
|
),
|
|
280
|
-
self.unsafeValue
|
|
313
|
+
self.unsafeValue,
|
|
314
|
+
(input, extraTags) =>
|
|
315
|
+
self.unsafeModify(
|
|
316
|
+
input,
|
|
317
|
+
Arr.union(f(input), extraTags)
|
|
318
|
+
)
|
|
281
319
|
),
|
|
282
320
|
constVoid
|
|
283
321
|
))
|
|
@@ -295,7 +333,8 @@ export const taggedWithLabels = dual<
|
|
|
295
333
|
return make(
|
|
296
334
|
self.keyType,
|
|
297
335
|
(input, extraTags1) => self.unsafeUpdate(input, Arr.union(extraTags, extraTags1)),
|
|
298
|
-
(extraTags1) => self.unsafeValue(Arr.union(extraTags, extraTags1))
|
|
336
|
+
(extraTags1) => self.unsafeValue(Arr.union(extraTags, extraTags1)),
|
|
337
|
+
(input, extraTags1) => self.unsafeModify(input, Arr.union(extraTags, extraTags1))
|
|
299
338
|
)
|
|
300
339
|
})
|
|
301
340
|
|
|
@@ -520,7 +559,12 @@ export const zip = dual<
|
|
|
520
559
|
self.unsafeUpdate(l, extraTags)
|
|
521
560
|
that.unsafeUpdate(r, extraTags)
|
|
522
561
|
},
|
|
523
|
-
(extraTags) => [self.unsafeValue(extraTags), that.unsafeValue(extraTags)]
|
|
562
|
+
(extraTags) => [self.unsafeValue(extraTags), that.unsafeValue(extraTags)],
|
|
563
|
+
(input: readonly [In, In2], extraTags) => {
|
|
564
|
+
const [l, r] = input
|
|
565
|
+
self.unsafeModify(l, extraTags)
|
|
566
|
+
that.unsafeModify(r, extraTags)
|
|
567
|
+
}
|
|
524
568
|
)
|
|
525
569
|
)
|
|
526
570
|
|
package/src/internal/version.ts
CHANGED