@unional/async-context 10.0.1 → 10.0.3
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/CHANGELOG.md +292 -0
- package/cjs/AsyncContext.d.ts +0 -2
- package/cjs/AsyncContext.d.ts.map +1 -1
- package/cjs/AsyncContext.js +6 -7
- package/cjs/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/assertClassBrand.js +1 -2
- package/cjs/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/checkPrivateRedeclaration.js +1 -2
- package/cjs/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateFieldGet2.js +1 -2
- package/cjs/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateFieldInitSpec.js +1 -2
- package/cjs/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateFieldSet2.js +1 -2
- package/cjs/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateMethodInitSpec.js +1 -2
- package/cjs/errors.d.ts +0 -2
- package/cjs/errors.d.ts.map +1 -1
- package/cjs/errors.js +1 -2
- package/esm/AsyncContext.d.ts +0 -2
- package/esm/AsyncContext.d.ts.map +1 -1
- package/esm/AsyncContext.js +6 -7
- package/esm/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/assertClassBrand.js +1 -2
- package/esm/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/checkPrivateRedeclaration.js +1 -2
- package/esm/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateFieldGet2.js +1 -2
- package/esm/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateFieldInitSpec.js +1 -2
- package/esm/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateFieldSet2.js +1 -2
- package/esm/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/classPrivateMethodInitSpec.js +1 -2
- package/esm/errors.d.ts +0 -2
- package/esm/errors.d.ts.map +1 -1
- package/esm/errors.js +1 -2
- package/package.json +8 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
## 10.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3dfd80d: Include `CHANGELOG.md` in the published package.
|
|
8
|
+
|
|
9
|
+
## 10.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 59308be: Update `type-plus` to 8.0.0.
|
|
14
|
+
|
|
15
|
+
`@unional/gizmo` no longer loads `type-plus` at runtime, so its CommonJS build does not `require` the now ESM-only package.
|
|
16
|
+
|
|
17
|
+
## 10.0.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 51231a8: Update `type-plus` to `8.0.0-beta.12`.
|
|
22
|
+
`@unional/async-context` also updates `iso-error` to `^7.0.0`.
|
|
23
|
+
|
|
24
|
+
## 10.0.0
|
|
25
|
+
|
|
26
|
+
### Major Changes
|
|
27
|
+
|
|
28
|
+
- b5e379e: Pin `type-plus` to `8.0.0-beta.10`, exactly, and raise the Node floor to `>= 20`.
|
|
29
|
+
|
|
30
|
+
All three packages already declared `type-plus: ^8.0.0-beta.10` in their last publish
|
|
31
|
+
(`@unional/async-context@9.0.17`, `async-fp@9.0.17`, `@unional/gizmo@2.3.5`), so the
|
|
32
|
+
`typescript >= 5.6.0` peer type-plus 8 introduced already reaches consumers today.
|
|
33
|
+
Tightening the caret to an exact pin removes headroom (later 8.0.0 prereleases, `8.0.0`,
|
|
34
|
+
`8.1.0`) but does not change what a fresh install resolves right now — 8 is a prerelease
|
|
35
|
+
line where breaking changes land between betas (beta.10 -> beta.11 changed `Equal`'s
|
|
36
|
+
signature and removed `isType.f`), so an exact version makes the next bump a reviewable
|
|
37
|
+
PR instead of something a lockfile refresh does silently.
|
|
38
|
+
|
|
39
|
+
**Breaking: the Node floor moves from `>= 14.16` to `>= 20`.** `type-plus` 8 depends on
|
|
40
|
+
`unpartial@^1.0.7`, which declares `engines: { node: '>= 20' }`. `@unional/async-context`
|
|
41
|
+
and `@unional/gizmo` carry `type-plus` as a runtime `dependency` (its types are re-exported
|
|
42
|
+
in their emitted `.d.ts`), so their actual runtime floor was already 20 as of their last
|
|
43
|
+
publish — this only makes the declared `engines` field honest. `async-fp` has no direct
|
|
44
|
+
runtime dependency on `type-plus` (it's a devDependency there, and none of its own emitted
|
|
45
|
+
declarations reference it), but it depends on `@unional/async-context` and `@unional/gizmo`
|
|
46
|
+
at runtime, so its effective floor moves too. Because narrowing supported Node is breaking
|
|
47
|
+
for consumers regardless of which path pulls it in, all three packages take `major`.
|
|
48
|
+
|
|
49
|
+
Downstream value: `@unional/gizmo@2.3.0` was found, during a sibling sweep of
|
|
50
|
+
`justland/just-web-react`, published on an old `type-plus`, contributing a stale copy to
|
|
51
|
+
consumers' dependency trees. A fresh `@unional/gizmo` release from this repo fixes that at
|
|
52
|
+
the source for `mocktomata` and `justland/just-web` (via `@unional/gizmo`), both of which
|
|
53
|
+
consume this repo mid-graph.
|
|
54
|
+
|
|
55
|
+
`assertron` moves `11.5.3` -> `11.6.0` and `iso-error`/`satisfier`/`tersify` pick up their
|
|
56
|
+
latest patches as a side effect of exempting first-party packages from the 24h release-age
|
|
57
|
+
soak (see `pnpm-workspace.yaml`) — without the exemption, `assertron@11.5.2` (declaring the
|
|
58
|
+
older `type-plus: ^7.6.2` / `tersify: ^3.12.1`) would have been silently resolved instead,
|
|
59
|
+
duplicating both packages in the tree.
|
|
60
|
+
|
|
61
|
+
## 9.0.17
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- c19caa2: Depend on `type-plus@^8.0.0-beta.10` — back on the 8.x line, as a range rather than an exact pin.
|
|
66
|
+
|
|
67
|
+
The previous release moved these packages to `^7.6.2`. That changed the major line when the actual defect was the *shape* of the dependency, not the line: `8.0.0-beta.8` was pinned **exactly**, so it could never resolve forward to the upstream fix. `type-plus` 8.x is the line these packages are built against and the one their maintainer is actively developing, so they stay on it.
|
|
68
|
+
|
|
69
|
+
`^8.0.0-beta.10` resolves to `>=8.0.0-beta.10 <9.0.0-0`, so the CJS packaging fix in `8.0.0-beta.10` — `cjs/package.json` = `{"type": "commonjs"}`, without which Node parses type-plus's CommonJS build as ESM and `require()` of these packages throws (#366) — and every later 8.x release flow in on their own.
|
|
70
|
+
|
|
71
|
+
No source change: `8.0.0-beta.10`'s root barrel is byte-identical to `8.0.0-beta.8`'s, so every symbol these packages use (`AnyFunction`, `KeyTypes`, `LeftJoin`, `RequiredKeys`, `assertType`, `isType`, `testType`) resolves exactly as before, with no local shims. `require()` of both built packages is verified against the resolved `8.0.0-beta.10` tree.
|
|
72
|
+
|
|
73
|
+
## 9.0.16
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- fc6d022: Depend on `type-plus@^7.6.2` instead of pinning `8.0.0-beta.8` exactly.
|
|
78
|
+
|
|
79
|
+
Fixes `require()` of these packages (#366). `type-plus@8.0.0-beta.8` is `"type": "module"` and ships `cjs/` without a `{"type":"commonjs"}` marker, so Node parses its CommonJS output as ESM and the entry throws. The exact pin meant consumers could not resolve forward to the upstream fix in `8.0.0-beta.10`. `type-plus@latest` is `7.6.2`, which ships the `cjs/package.json` marker correctly; whether to move to the 8.x line stays a separate decision.
|
|
80
|
+
|
|
81
|
+
Type-level only — the emitted `.js`, `.d.ts` and source maps are byte-identical under both versions, and every symbol used (`AnyFunction`, `KeyTypes`, `LeftJoin`, `RequiredKeys`, `assertType`, `isType`, `testType`) resolves from the 7.6.2 root barrel unchanged.
|
|
82
|
+
|
|
83
|
+
## 9.0.15
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- defa0ac: Build with tsdown instead of `tsc` + `buddy ts build cjs`.
|
|
88
|
+
|
|
89
|
+
Every path named in `exports` keeps its location and contents. Two differences in the
|
|
90
|
+
tarball are worth naming: modules that are pure re-exports (`index`, `testing`,
|
|
91
|
+
`gizmo_testing`) no longer ship `.js.map` / `.d.ts.map`, and the type-only `types`
|
|
92
|
+
module no longer emits an empty `types.js`. `@unional/async-context` also gains small
|
|
93
|
+
`_virtual/` runtime helper files, which is how the ES2020 target now downlevels its
|
|
94
|
+
private class fields.
|
|
95
|
+
|
|
96
|
+
## 9.0.14
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- cf5324f: Point repository metadata at `cyberuni/async-fp` following the org transfer, and release
|
|
101
|
+
through GitHub OIDC / npm trusted publishing instead of a stored `NPM_TOKEN`.
|
|
102
|
+
|
|
103
|
+
No runtime change.
|
|
104
|
+
|
|
105
|
+
## 9.0.13
|
|
106
|
+
|
|
107
|
+
## 9.0.12
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- 4dd0a08: Update `type-plus`
|
|
112
|
+
|
|
113
|
+
## 9.0.11
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- 6ecc0e7: Update `iso-error` and `type-plus`
|
|
118
|
+
|
|
119
|
+
## 9.0.10
|
|
120
|
+
|
|
121
|
+
## 9.0.9
|
|
122
|
+
|
|
123
|
+
## 9.0.8
|
|
124
|
+
|
|
125
|
+
## 9.0.7
|
|
126
|
+
|
|
127
|
+
## 9.0.6
|
|
128
|
+
|
|
129
|
+
## 9.0.5
|
|
130
|
+
|
|
131
|
+
## 9.0.4
|
|
132
|
+
|
|
133
|
+
## 9.0.3
|
|
134
|
+
|
|
135
|
+
## 9.0.2
|
|
136
|
+
|
|
137
|
+
## 9.0.1
|
|
138
|
+
|
|
139
|
+
## 9.0.0
|
|
140
|
+
|
|
141
|
+
### Major Changes
|
|
142
|
+
|
|
143
|
+
- d0a68ba: Release as Node ESM module
|
|
144
|
+
|
|
145
|
+
## 8.1.1
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- 41af4c1: Adjust import type syntax
|
|
150
|
+
|
|
151
|
+
## 8.1.0
|
|
152
|
+
|
|
153
|
+
## 8.0.3
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- 593f104: Update `type-plus`
|
|
158
|
+
|
|
159
|
+
## 8.0.2
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- 5ac78c2: Fix `extend()` to work with union types.
|
|
164
|
+
|
|
165
|
+
The problem is this type:
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
extend(context: AsyncContext.Transformer<CurrentContext, AdditionalContext>)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The `CurrentContext` here overrides the generic resolution,
|
|
172
|
+
making the `CurrentContext` becomes whatever the transformer request,
|
|
173
|
+
instead of the real current context.
|
|
174
|
+
|
|
175
|
+
## 8.0.1
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- 9c1ecfb: Update `type-plus` and `iso-error`
|
|
180
|
+
|
|
181
|
+
## 8.0.0
|
|
182
|
+
|
|
183
|
+
### Major Changes
|
|
184
|
+
|
|
185
|
+
- 189343b: Restore the `extend()` behavior in 2.0,
|
|
186
|
+
that it returns a new instance instead of itself.
|
|
187
|
+
|
|
188
|
+
The `clone()` function is also removed as it is not necessary anymore.
|
|
189
|
+
|
|
190
|
+
The behavior introduced in 3.0 makes the async context mutable.
|
|
191
|
+
Which `clone()` was added to mitigate that.
|
|
192
|
+
|
|
193
|
+
However, such design is architecturally unsound.
|
|
194
|
+
|
|
195
|
+
With this change, make sure you are updating or assigning the new instance after `extend()`:
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
// from
|
|
199
|
+
const ctx = new AsyncContext()
|
|
200
|
+
|
|
201
|
+
ctx.extend(...)
|
|
202
|
+
|
|
203
|
+
// to
|
|
204
|
+
const ctx = new AsyncContext()
|
|
205
|
+
|
|
206
|
+
const extended = ctx.extend(...)
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## 3.2.0
|
|
210
|
+
|
|
211
|
+
### Minor Changes
|
|
212
|
+
|
|
213
|
+
- 66b9fc8: Detect blocking get calls
|
|
214
|
+
|
|
215
|
+
## 3.1.1
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- 1091796: Supports calling `extend()` after `get()`.
|
|
220
|
+
|
|
221
|
+
This was supported in 2.0 implicitly because each `extend()` creates a new context.
|
|
222
|
+
|
|
223
|
+
This is useful when different code using the context calls `get()` and `extend()` at their own rate.
|
|
224
|
+
|
|
225
|
+
The new `extend()` will not affect the existing `get()` result, which is expected.
|
|
226
|
+
If not, it will be very hard to reason and debug.
|
|
227
|
+
|
|
228
|
+
## 3.1.0
|
|
229
|
+
|
|
230
|
+
### Minor Changes
|
|
231
|
+
|
|
232
|
+
- 0e14e94: Add `clone()` to create a new context out of the original one.
|
|
233
|
+
|
|
234
|
+
Changing the `extend()` function to return itself while keeping the name is an oversight in 3.0.
|
|
235
|
+
The naming is a bit confusing.
|
|
236
|
+
|
|
237
|
+
It will be renamed in 4.0.
|
|
238
|
+
|
|
239
|
+
## 3.0.1
|
|
240
|
+
|
|
241
|
+
### Patch Changes
|
|
242
|
+
|
|
243
|
+
- ba8202e: The `CurrentContext` in `extend<CurrentContext, AdditionalContext>()` can now be overridden.
|
|
244
|
+
|
|
245
|
+
## 3.0.0
|
|
246
|
+
|
|
247
|
+
### Major Changes
|
|
248
|
+
|
|
249
|
+
- ce259fe: The generic types of `AsyncContext` have changed.
|
|
250
|
+
Instead of specifying the `Context`, you specify the `Init` value.
|
|
251
|
+
|
|
252
|
+
Through `.extend()`, additional `Context` will be added to it to produce the final result.
|
|
253
|
+
|
|
254
|
+
Signature of the `transformer` in `.extend()` have also changed.
|
|
255
|
+
Instead of receiving a `AsyncContext<Context>`, you receive the `Context` itself,
|
|
256
|
+
in which you return an additional context that augments or add to it.
|
|
257
|
+
|
|
258
|
+
`.get()` can override the context type returned.
|
|
259
|
+
This is useful when you extend the context out-of-band,
|
|
260
|
+
and you are not reassigning the context to update the type,
|
|
261
|
+
or when the creating code do not know how it will be extended.
|
|
262
|
+
|
|
263
|
+
## 2.0.0
|
|
264
|
+
|
|
265
|
+
### Major Changes
|
|
266
|
+
|
|
267
|
+
- a640275: Refactor and Rewrite
|
|
268
|
+
|
|
269
|
+
`AsyncContext` has been moved to `@unional/async-context` and is re-written to simplify its API.
|
|
270
|
+
|
|
271
|
+
`async-fp` will remain a collection of utility libraries including `AsyncContext`.
|
|
272
|
+
|
|
273
|
+
### Patch Changes
|
|
274
|
+
|
|
275
|
+
- b564c85: extend() supports Promise as input
|
|
276
|
+
- f9d2494: Update documentation
|
|
277
|
+
- d9637ab: fix: recursive type issue
|
|
278
|
+
|
|
279
|
+
All notable changes to this project will be documented in this file.
|
|
280
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
281
|
+
|
|
282
|
+
## 1.0.3 (2020-09-07)
|
|
283
|
+
|
|
284
|
+
**Note:** Version bump only for package @unional/async-context
|
|
285
|
+
|
|
286
|
+
## 1.0.2 (2020-03-24)
|
|
287
|
+
|
|
288
|
+
**Note:** Version bump only for package @unional/async-context
|
|
289
|
+
|
|
290
|
+
## 1.0.1 (2020-03-15)
|
|
291
|
+
|
|
292
|
+
**Note:** Version bump only for package @unional/async-context
|
package/cjs/AsyncContext.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LeftJoin } from "type-plus";
|
|
2
|
-
//#region ts/AsyncContext.d.ts
|
|
3
2
|
export declare class AsyncContext<Init extends Record<string | symbol, any>, Context extends Record<string | symbol, any> = Init> {
|
|
4
3
|
#private;
|
|
5
4
|
constructor(init?: Init | Promise<Init> | AsyncContext.Initializer<Init>);
|
|
@@ -11,5 +10,4 @@ export declare namespace AsyncContext {
|
|
|
11
10
|
type Initializer<Init> = () => Init | Promise<Init>;
|
|
12
11
|
type Transformer<CurrentContext, AdditionalContext> = (context: CurrentContext) => AdditionalContext | Promise<AdditionalContext>;
|
|
13
12
|
}
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=AsyncContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncContext.d.ts","names":[],"sources":["../ts/AsyncContext.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsyncContext.d.ts","names":[],"sources":["../ts/AsyncContext.ts"],"mappings":";qBAGa,aACZ,aAAa,8BACb,gBAAgB,+BAA+B;;EAO/C,YAAY,OAAO,OAAO,QAAQ,QAAQ,aAAa,YAAY;EAGnE,WAAW,UAAU,OAAO,MAAM,MAAM,IAAI,QAAQ,KAAK,aAAa,YAAY,KAAK,aAAa;EAOpG,OACC,uBAAuB,+BAA+B,SACtD,0BAA0B,+BAA+B,8BAEzD,SAAS,oBAAoB,QAAQ,qBAAqB,aAAa,YAAY,SAAS,qBAC1F,aAAa,MAAM,SAAS,gBAAgB;EAgBzC,IAAI,IAAI,YAAY,QAAQ;;yBASlB;OACJ,YAAY,cAAc,OAAO,QAAQ;OACzC,YAAY,gBAAgB,sBACvC,SAAS,mBACL,oBAAoB,QAAQ"}
|
package/cjs/AsyncContext.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_errors = require("./errors.js");
|
|
2
|
-
const require_classPrivateMethodInitSpec = require("./_virtual/_@oxc-project_runtime@0.
|
|
3
|
-
const require_classPrivateFieldInitSpec = require("./_virtual/_@oxc-project_runtime@0.
|
|
4
|
-
const require_assertClassBrand = require("./_virtual/_@oxc-project_runtime@0.
|
|
5
|
-
const require_classPrivateFieldSet2 = require("./_virtual/_@oxc-project_runtime@0.
|
|
6
|
-
const require_classPrivateFieldGet2 = require("./_virtual/_@oxc-project_runtime@0.
|
|
7
|
-
|
|
2
|
+
const require_classPrivateMethodInitSpec = require("./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateMethodInitSpec.js");
|
|
3
|
+
const require_classPrivateFieldInitSpec = require("./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateFieldInitSpec.js");
|
|
4
|
+
const require_assertClassBrand = require("./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/assertClassBrand.js");
|
|
5
|
+
const require_classPrivateFieldSet2 = require("./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateFieldSet2.js");
|
|
6
|
+
const require_classPrivateFieldGet2 = require("./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateFieldGet2.js");
|
|
7
|
+
// ts/AsyncContext.ts
|
|
8
8
|
var _resolving = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
var _resolvers = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
var _transforming = /* @__PURE__ */ new WeakMap();
|
|
@@ -64,7 +64,6 @@ function isTransformer(context) {
|
|
|
64
64
|
function isInitializer(context) {
|
|
65
65
|
return typeof context === "function";
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
exports.AsyncContext = AsyncContext;
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=AsyncContext.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/assertClassBrand.js
|
|
2
2
|
function _assertClassBrand(e, t, n) {
|
|
3
3
|
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
4
4
|
throw new TypeError("Private element is not present on this object");
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
exports.default = _assertClassBrand;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/checkPrivateRedeclaration.js
|
|
2
2
|
function _checkPrivateRedeclaration(e, t) {
|
|
3
3
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
4
|
}
|
|
5
|
-
//#endregion
|
|
6
5
|
exports.default = _checkPrivateRedeclaration;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const require_assertClassBrand = require("./assertClassBrand.js");
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateFieldGet2.js
|
|
3
3
|
function _classPrivateFieldGet2(s, a) {
|
|
4
4
|
return s.get(require_assertClassBrand.default(s, a));
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
exports.default = _classPrivateFieldGet2;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const require_checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js");
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
3
3
|
function _classPrivateFieldInitSpec(e, t, a) {
|
|
4
4
|
require_checkPrivateRedeclaration.default(e, t), t.set(e, a);
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
exports.default = _classPrivateFieldInitSpec;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const require_assertClassBrand = require("./assertClassBrand.js");
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateFieldSet2.js
|
|
3
3
|
function _classPrivateFieldSet2(s, a, r) {
|
|
4
4
|
return s.set(require_assertClassBrand.default(s, a), r), r;
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
exports.default = _classPrivateFieldSet2;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const require_checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js");
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
3
3
|
function _classPrivateMethodInitSpec(e, a) {
|
|
4
4
|
require_checkPrivateRedeclaration.default(e, a), a.add(e);
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
exports.default = _classPrivateMethodInitSpec;
|
package/cjs/errors.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { ModuleError } from "iso-error";
|
|
2
|
-
//#region ts/errors.d.ts
|
|
3
2
|
export declare class ContextAlreadyInitialized extends ModuleError {
|
|
4
3
|
constructor(options?: ModuleError.Options);
|
|
5
4
|
}
|
|
6
5
|
export declare class BlockingGetDetected extends ModuleError {
|
|
7
6
|
constructor(options?: ModuleError.Options);
|
|
8
7
|
}
|
|
9
|
-
//#endregion
|
|
10
8
|
//# sourceMappingURL=errors.d.ts.map
|
package/cjs/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","names":[],"sources":["../ts/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","names":[],"sources":["../ts/errors.ts"],"mappings":";qBAEa,kCAAkC;EAC9C,YAAY,UAAU,YAAY;;qBAKtB,4BAA4B;EACxC,YAAY,UAAU,YAAY"}
|
package/cjs/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let iso_error = require("iso-error");
|
|
2
|
-
|
|
2
|
+
// ts/errors.ts
|
|
3
3
|
var ContextAlreadyInitialized = class extends iso_error.ModuleError {
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super("@unional/async-context", "context can only be initialized once.", options);
|
|
@@ -10,7 +10,6 @@ var BlockingGetDetected = class extends iso_error.ModuleError {
|
|
|
10
10
|
super("@unional/async-context", "a blocking get() detected. Are you calling it within extend()?", options);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
exports.BlockingGetDetected = BlockingGetDetected;
|
|
15
14
|
exports.ContextAlreadyInitialized = ContextAlreadyInitialized;
|
|
16
15
|
|
package/esm/AsyncContext.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LeftJoin } from "type-plus";
|
|
2
|
-
//#region ts/AsyncContext.d.ts
|
|
3
2
|
export declare class AsyncContext<Init extends Record<string | symbol, any>, Context extends Record<string | symbol, any> = Init> {
|
|
4
3
|
#private;
|
|
5
4
|
constructor(init?: Init | Promise<Init> | AsyncContext.Initializer<Init>);
|
|
@@ -11,5 +10,4 @@ export declare namespace AsyncContext {
|
|
|
11
10
|
type Initializer<Init> = () => Init | Promise<Init>;
|
|
12
11
|
type Transformer<CurrentContext, AdditionalContext> = (context: CurrentContext) => AdditionalContext | Promise<AdditionalContext>;
|
|
13
12
|
}
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=AsyncContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncContext.d.ts","names":[],"sources":["../ts/AsyncContext.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsyncContext.d.ts","names":[],"sources":["../ts/AsyncContext.ts"],"mappings":";qBAGa,aACZ,aAAa,8BACb,gBAAgB,+BAA+B;;EAO/C,YAAY,OAAO,OAAO,QAAQ,QAAQ,aAAa,YAAY;EAGnE,WAAW,UAAU,OAAO,MAAM,MAAM,IAAI,QAAQ,KAAK,aAAa,YAAY,KAAK,aAAa;EAOpG,OACC,uBAAuB,+BAA+B,SACtD,0BAA0B,+BAA+B,8BAEzD,SAAS,oBAAoB,QAAQ,qBAAqB,aAAa,YAAY,SAAS,qBAC1F,aAAa,MAAM,SAAS,gBAAgB;EAgBzC,IAAI,IAAI,YAAY,QAAQ;;yBASlB;OACJ,YAAY,cAAc,OAAO,QAAQ;OACzC,YAAY,gBAAgB,sBACvC,SAAS,mBACL,oBAAoB,QAAQ"}
|
package/esm/AsyncContext.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BlockingGetDetected, ContextAlreadyInitialized } from "./errors.js";
|
|
2
|
-
import _classPrivateMethodInitSpec from "./_virtual/_@oxc-project_runtime@0.
|
|
3
|
-
import _classPrivateFieldInitSpec from "./_virtual/_@oxc-project_runtime@0.
|
|
4
|
-
import _assertClassBrand from "./_virtual/_@oxc-project_runtime@0.
|
|
5
|
-
import _classPrivateFieldSet2 from "./_virtual/_@oxc-project_runtime@0.
|
|
6
|
-
import _classPrivateFieldGet2 from "./_virtual/_@oxc-project_runtime@0.
|
|
7
|
-
|
|
2
|
+
import _classPrivateMethodInitSpec from "./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateMethodInitSpec.js";
|
|
3
|
+
import _classPrivateFieldInitSpec from "./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateFieldInitSpec.js";
|
|
4
|
+
import _assertClassBrand from "./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/assertClassBrand.js";
|
|
5
|
+
import _classPrivateFieldSet2 from "./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateFieldSet2.js";
|
|
6
|
+
import _classPrivateFieldGet2 from "./_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/classPrivateFieldGet2.js";
|
|
7
|
+
// ts/AsyncContext.ts
|
|
8
8
|
var _resolving = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
var _resolvers = /* @__PURE__ */ new WeakMap();
|
|
10
10
|
var _transforming = /* @__PURE__ */ new WeakMap();
|
|
@@ -64,7 +64,6 @@ function isTransformer(context) {
|
|
|
64
64
|
function isInitializer(context) {
|
|
65
65
|
return typeof context === "function";
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export { AsyncContext };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=AsyncContext.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/assertClassBrand.js
|
|
2
2
|
function _assertClassBrand(e, t, n) {
|
|
3
3
|
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
4
4
|
throw new TypeError("Private element is not present on this object");
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { _assertClassBrand as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/checkPrivateRedeclaration.js
|
|
2
2
|
function _checkPrivateRedeclaration(e, t) {
|
|
3
3
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
4
|
}
|
|
5
|
-
//#endregion
|
|
6
5
|
export { _checkPrivateRedeclaration as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _assertClassBrand from "./assertClassBrand.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateFieldGet2.js
|
|
3
3
|
function _classPrivateFieldGet2(s, a) {
|
|
4
4
|
return s.get(_assertClassBrand(s, a));
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { _classPrivateFieldGet2 as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _checkPrivateRedeclaration from "./checkPrivateRedeclaration.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
3
3
|
function _classPrivateFieldInitSpec(e, t, a) {
|
|
4
4
|
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { _classPrivateFieldInitSpec as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _assertClassBrand from "./assertClassBrand.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateFieldSet2.js
|
|
3
3
|
function _classPrivateFieldSet2(s, a, r) {
|
|
4
4
|
return s.set(_assertClassBrand(s, a), r), r;
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { _classPrivateFieldSet2 as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _checkPrivateRedeclaration from "./checkPrivateRedeclaration.js";
|
|
2
|
-
|
|
2
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
3
3
|
function _classPrivateMethodInitSpec(e, a) {
|
|
4
4
|
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { _classPrivateMethodInitSpec as default };
|
package/esm/errors.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { ModuleError } from "iso-error";
|
|
2
|
-
//#region ts/errors.d.ts
|
|
3
2
|
export declare class ContextAlreadyInitialized extends ModuleError {
|
|
4
3
|
constructor(options?: ModuleError.Options);
|
|
5
4
|
}
|
|
6
5
|
export declare class BlockingGetDetected extends ModuleError {
|
|
7
6
|
constructor(options?: ModuleError.Options);
|
|
8
7
|
}
|
|
9
|
-
//#endregion
|
|
10
8
|
//# sourceMappingURL=errors.d.ts.map
|
package/esm/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","names":[],"sources":["../ts/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","names":[],"sources":["../ts/errors.ts"],"mappings":";qBAEa,kCAAkC;EAC9C,YAAY,UAAU,YAAY;;qBAKtB,4BAA4B;EACxC,YAAY,UAAU,YAAY"}
|
package/esm/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleError } from "iso-error";
|
|
2
|
-
|
|
2
|
+
// ts/errors.ts
|
|
3
3
|
var ContextAlreadyInitialized = class extends ModuleError {
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super("@unional/async-context", "context can only be initialized once.", options);
|
|
@@ -10,7 +10,6 @@ var BlockingGetDetected = class extends ModuleError {
|
|
|
10
10
|
super("@unional/async-context", "a blocking get() detected. Are you calling it within extend()?", options);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { BlockingGetDetected, ContextAlreadyInitialized };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=errors.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unional/async-context",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.3",
|
|
4
4
|
"description": "Asynchronous context for functional style programming",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"async",
|
|
@@ -45,21 +45,22 @@
|
|
|
45
45
|
"cjs",
|
|
46
46
|
"esm",
|
|
47
47
|
"ts",
|
|
48
|
-
"!**/*.{spec,test,unit,accept,integrate,system}.*"
|
|
48
|
+
"!**/*.{spec,test,unit,accept,integrate,system}.*",
|
|
49
|
+
"CHANGELOG.md"
|
|
49
50
|
],
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"iso-error": "^7.0.0",
|
|
52
|
-
"type-plus": "8.0.
|
|
53
|
+
"type-plus": "8.0.1"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@repobuddy/typescript": "^2.2.
|
|
56
|
+
"@repobuddy/typescript": "^2.2.2",
|
|
56
57
|
"@types/setimmediate": "^1.0.4",
|
|
57
|
-
"@vitest/coverage-v8": "^
|
|
58
|
-
"assertron": "^11.7.
|
|
58
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
59
|
+
"assertron": "^11.7.1",
|
|
59
60
|
"rimraf": "^6.1.3",
|
|
60
61
|
"setimmediate": "^1.0.5",
|
|
61
62
|
"tsdown": "^0.23.0",
|
|
62
|
-
"vitest": "^
|
|
63
|
+
"vitest": "^5.0.0"
|
|
63
64
|
},
|
|
64
65
|
"engines": {
|
|
65
66
|
"node": ">= 20"
|