reactor-core-ts 2.1.6 → 3.2.1

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.
Files changed (269) hide show
  1. package/README.md +927 -658
  2. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js +12 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPrimitive.js +14 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPropertyKey.js +9 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/typeof.js +11 -0
  6. package/dist/context/context-view.d.ts +31 -0
  7. package/dist/context/context-view.d.ts.map +1 -0
  8. package/dist/context/context-view.js +58 -0
  9. package/dist/context/context-view.js.map +1 -0
  10. package/dist/context/context.d.ts +46 -0
  11. package/dist/context/context.d.ts.map +1 -0
  12. package/dist/context/context.js +125 -0
  13. package/dist/context/context.js.map +1 -0
  14. package/dist/context/types.d.ts +7 -0
  15. package/dist/context/types.d.ts.map +1 -0
  16. package/dist/core/boolean-disposable.d.ts +19 -0
  17. package/dist/core/boolean-disposable.d.ts.map +1 -0
  18. package/dist/core/boolean-disposable.js +37 -0
  19. package/dist/core/boolean-disposable.js.map +1 -0
  20. package/dist/core/composite-disposable.d.ts +21 -0
  21. package/dist/core/composite-disposable.d.ts.map +1 -0
  22. package/dist/core/composite-disposable.js +64 -0
  23. package/dist/core/composite-disposable.js.map +1 -0
  24. package/dist/core/demand.d.ts +9 -0
  25. package/dist/core/demand.d.ts.map +1 -0
  26. package/dist/core/demand.js +21 -0
  27. package/dist/core/demand.js.map +1 -0
  28. package/dist/core/disposables.d.ts +12 -0
  29. package/dist/core/disposables.d.ts.map +1 -0
  30. package/dist/core/disposables.js +37 -0
  31. package/dist/core/disposables.js.map +1 -0
  32. package/dist/core/teardown.d.ts +4 -0
  33. package/dist/core/teardown.d.ts.map +1 -0
  34. package/dist/core/types.d.ts +14 -0
  35. package/dist/core/types.d.ts.map +1 -0
  36. package/dist/errors/classes.d.ts +37 -0
  37. package/dist/errors/classes.d.ts.map +1 -0
  38. package/dist/errors/classes.js +53 -0
  39. package/dist/errors/classes.js.map +1 -0
  40. package/dist/errors/exceptions.d.ts +15 -0
  41. package/dist/errors/exceptions.d.ts.map +1 -0
  42. package/dist/errors/helpers.d.ts +9 -0
  43. package/dist/errors/helpers.d.ts.map +1 -0
  44. package/dist/errors/helpers.js +18 -0
  45. package/dist/errors/helpers.js.map +1 -0
  46. package/dist/index.d.ts +17 -2556
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +8 -2
  49. package/dist/internal/abort.d.ts +5 -0
  50. package/dist/internal/abort.d.ts.map +1 -0
  51. package/dist/internal/abort.js +36 -0
  52. package/dist/internal/abort.js.map +1 -0
  53. package/dist/internal/async-queue.d.ts +48 -0
  54. package/dist/internal/async-queue.d.ts.map +1 -0
  55. package/dist/internal/async-queue.js +187 -0
  56. package/dist/internal/async-queue.js.map +1 -0
  57. package/dist/internal/iterable-terminal.d.ts +12 -0
  58. package/dist/internal/iterable-terminal.d.ts.map +1 -0
  59. package/dist/internal/iterable-terminal.js +49 -0
  60. package/dist/internal/iterable-terminal.js.map +1 -0
  61. package/dist/internal/iterable-transform.d.ts +24 -0
  62. package/dist/internal/iterable-transform.d.ts.map +1 -0
  63. package/dist/internal/iterable-transform.js +159 -0
  64. package/dist/internal/iterable-transform.js.map +1 -0
  65. package/dist/internal/iterable.d.ts +23 -0
  66. package/dist/internal/iterable.d.ts.map +1 -0
  67. package/dist/internal/iterable.js +81 -0
  68. package/dist/internal/iterable.js.map +1 -0
  69. package/dist/internal/microtask.d.ts +7 -0
  70. package/dist/internal/microtask.d.ts.map +1 -0
  71. package/dist/internal/microtask.js +19 -0
  72. package/dist/internal/microtask.js.map +1 -0
  73. package/dist/publisher/browser-sources.d.ts +15 -0
  74. package/dist/publisher/browser-sources.d.ts.map +1 -0
  75. package/dist/publisher/browser-sources.js +92 -0
  76. package/dist/publisher/browser-sources.js.map +1 -0
  77. package/dist/publisher/flux-entrypoint.d.ts +7 -0
  78. package/dist/publisher/flux-entrypoint.d.ts.map +1 -0
  79. package/dist/publisher/flux-entrypoint.js +11 -0
  80. package/dist/publisher/flux-entrypoint.js.map +1 -0
  81. package/dist/publisher/flux.d.ts +121 -0
  82. package/dist/publisher/flux.d.ts.map +1 -0
  83. package/dist/publisher/flux.js +697 -0
  84. package/dist/publisher/flux.js.map +1 -0
  85. package/dist/publisher/helpers.d.ts +19 -0
  86. package/dist/publisher/helpers.d.ts.map +1 -0
  87. package/dist/publisher/helpers.js +84 -0
  88. package/dist/publisher/helpers.js.map +1 -0
  89. package/dist/publisher/mono-entrypoint.d.ts +7 -0
  90. package/dist/publisher/mono-entrypoint.d.ts.map +1 -0
  91. package/dist/publisher/mono-entrypoint.js +11 -0
  92. package/dist/publisher/mono-entrypoint.js.map +1 -0
  93. package/dist/publisher/mono.d.ts +72 -0
  94. package/dist/publisher/mono.d.ts.map +1 -0
  95. package/dist/publisher/mono.js +373 -0
  96. package/dist/publisher/mono.js.map +1 -0
  97. package/dist/publisher/operators/aggregate.d.ts +35 -0
  98. package/dist/publisher/operators/aggregate.d.ts.map +1 -0
  99. package/dist/publisher/operators/aggregate.js +217 -0
  100. package/dist/publisher/operators/aggregate.js.map +1 -0
  101. package/dist/publisher/operators/compat/flux.d.ts +56 -0
  102. package/dist/publisher/operators/compat/flux.d.ts.map +1 -0
  103. package/dist/publisher/operators/compat/flux.js +156 -0
  104. package/dist/publisher/operators/compat/flux.js.map +1 -0
  105. package/dist/publisher/operators/compat/mono.d.ts +82 -0
  106. package/dist/publisher/operators/compat/mono.d.ts.map +1 -0
  107. package/dist/publisher/operators/compat/mono.js +125 -0
  108. package/dist/publisher/operators/compat/mono.js.map +1 -0
  109. package/dist/publisher/operators/coordination.d.ts +82 -0
  110. package/dist/publisher/operators/coordination.d.ts.map +1 -0
  111. package/dist/publisher/operators/coordination.js +345 -0
  112. package/dist/publisher/operators/coordination.js.map +1 -0
  113. package/dist/publisher/operators/error.d.ts +17 -0
  114. package/dist/publisher/operators/error.d.ts.map +1 -0
  115. package/dist/publisher/operators/error.js +48 -0
  116. package/dist/publisher/operators/error.js.map +1 -0
  117. package/dist/publisher/operators/flatten.d.ts +19 -0
  118. package/dist/publisher/operators/flatten.d.ts.map +1 -0
  119. package/dist/publisher/operators/flatten.js +127 -0
  120. package/dist/publisher/operators/flatten.js.map +1 -0
  121. package/dist/publisher/operators/lifecycle.d.ts +103 -0
  122. package/dist/publisher/operators/lifecycle.d.ts.map +1 -0
  123. package/dist/publisher/operators/lifecycle.js +237 -0
  124. package/dist/publisher/operators/lifecycle.js.map +1 -0
  125. package/dist/publisher/operators/mono-parity.d.ts +109 -0
  126. package/dist/publisher/operators/mono-parity.d.ts.map +1 -0
  127. package/dist/publisher/operators/mono-parity.js +144 -0
  128. package/dist/publisher/operators/mono-parity.js.map +1 -0
  129. package/dist/publisher/operators/mono.d.ts +30 -0
  130. package/dist/publisher/operators/mono.d.ts.map +1 -0
  131. package/dist/publisher/operators/mono.js +37 -0
  132. package/dist/publisher/operators/mono.js.map +1 -0
  133. package/dist/publisher/operators/register.d.ts +20 -0
  134. package/dist/publisher/operators/register.d.ts.map +1 -0
  135. package/dist/publisher/operators/register.js +23 -0
  136. package/dist/publisher/operators/register.js.map +1 -0
  137. package/dist/publisher/operators/selection.d.ts +25 -0
  138. package/dist/publisher/operators/selection.d.ts.map +1 -0
  139. package/dist/publisher/operators/selection.js +108 -0
  140. package/dist/publisher/operators/selection.js.map +1 -0
  141. package/dist/publisher/operators/side-effect.d.ts +15 -0
  142. package/dist/publisher/operators/side-effect.d.ts.map +1 -0
  143. package/dist/publisher/operators/side-effect.js +56 -0
  144. package/dist/publisher/operators/side-effect.js.map +1 -0
  145. package/dist/publisher/operators/terminal.d.ts +16 -0
  146. package/dist/publisher/operators/terminal.d.ts.map +1 -0
  147. package/dist/publisher/operators/terminal.js +47 -0
  148. package/dist/publisher/operators/terminal.js.map +1 -0
  149. package/dist/publisher/operators/time.d.ts +20 -0
  150. package/dist/publisher/operators/time.d.ts.map +1 -0
  151. package/dist/publisher/operators/time.js +92 -0
  152. package/dist/publisher/operators/time.js.map +1 -0
  153. package/dist/publisher/operators/transform.d.ts +31 -0
  154. package/dist/publisher/operators/transform.d.ts.map +1 -0
  155. package/dist/publisher/operators/transform.js +74 -0
  156. package/dist/publisher/operators/transform.js.map +1 -0
  157. package/dist/publisher/operators/windowing.d.ts +28 -0
  158. package/dist/publisher/operators/windowing.d.ts.map +1 -0
  159. package/dist/publisher/operators/windowing.js +148 -0
  160. package/dist/publisher/operators/windowing.js.map +1 -0
  161. package/dist/publisher/publisher.d.ts +11 -0
  162. package/dist/publisher/publisher.d.ts.map +1 -0
  163. package/dist/publisher/types.d.ts +51 -0
  164. package/dist/publisher/types.d.ts.map +1 -0
  165. package/dist/schedulers/animation-frame-scheduler.d.ts +11 -0
  166. package/dist/schedulers/animation-frame-scheduler.d.ts.map +1 -0
  167. package/dist/schedulers/animation-frame-scheduler.js +30 -0
  168. package/dist/schedulers/animation-frame-scheduler.js.map +1 -0
  169. package/dist/schedulers/base-scheduler.d.ts +28 -0
  170. package/dist/schedulers/base-scheduler.d.ts.map +1 -0
  171. package/dist/schedulers/base-scheduler.js +77 -0
  172. package/dist/schedulers/base-scheduler.js.map +1 -0
  173. package/dist/schedulers/basic-worker.d.ts +22 -0
  174. package/dist/schedulers/basic-worker.d.ts.map +1 -0
  175. package/dist/schedulers/basic-worker.js +71 -0
  176. package/dist/schedulers/basic-worker.js.map +1 -0
  177. package/dist/schedulers/delay-scheduler.d.ts +12 -0
  178. package/dist/schedulers/delay-scheduler.d.ts.map +1 -0
  179. package/dist/schedulers/delay-scheduler.js +17 -0
  180. package/dist/schedulers/delay-scheduler.js.map +1 -0
  181. package/dist/schedulers/disposed.d.ts +4 -0
  182. package/dist/schedulers/disposed.d.ts.map +1 -0
  183. package/dist/schedulers/disposed.js +14 -0
  184. package/dist/schedulers/disposed.js.map +1 -0
  185. package/dist/schedulers/duration.d.ts +8 -0
  186. package/dist/schedulers/duration.d.ts.map +1 -0
  187. package/dist/schedulers/duration.js +11 -0
  188. package/dist/schedulers/duration.js.map +1 -0
  189. package/dist/schedulers/executor-scheduler.d.ts +13 -0
  190. package/dist/schedulers/executor-scheduler.d.ts.map +1 -0
  191. package/dist/schedulers/executor-scheduler.js +43 -0
  192. package/dist/schedulers/executor-scheduler.js.map +1 -0
  193. package/dist/schedulers/immediate-scheduler.d.ts +15 -0
  194. package/dist/schedulers/immediate-scheduler.d.ts.map +1 -0
  195. package/dist/schedulers/immediate-scheduler.js +24 -0
  196. package/dist/schedulers/immediate-scheduler.js.map +1 -0
  197. package/dist/schedulers/index.d.ts +7 -0
  198. package/dist/schedulers/index.d.ts.map +1 -0
  199. package/dist/schedulers/index.js +2 -0
  200. package/dist/schedulers/interval-scheduler.d.ts +12 -0
  201. package/dist/schedulers/interval-scheduler.d.ts.map +1 -0
  202. package/dist/schedulers/interval-scheduler.js +17 -0
  203. package/dist/schedulers/interval-scheduler.js.map +1 -0
  204. package/dist/schedulers/macro-scheduler.d.ts +19 -0
  205. package/dist/schedulers/macro-scheduler.d.ts.map +1 -0
  206. package/dist/schedulers/macro-scheduler.js +30 -0
  207. package/dist/schedulers/macro-scheduler.js.map +1 -0
  208. package/dist/schedulers/microtask-scheduler.d.ts +11 -0
  209. package/dist/schedulers/microtask-scheduler.d.ts.map +1 -0
  210. package/dist/schedulers/microtask-scheduler.js +34 -0
  211. package/dist/schedulers/microtask-scheduler.js.map +1 -0
  212. package/dist/schedulers/schedulers.d.ts +39 -0
  213. package/dist/schedulers/schedulers.d.ts.map +1 -0
  214. package/dist/schedulers/schedulers.js +83 -0
  215. package/dist/schedulers/schedulers.js.map +1 -0
  216. package/dist/schedulers/timeout-scheduler.d.ts +11 -0
  217. package/dist/schedulers/timeout-scheduler.d.ts.map +1 -0
  218. package/dist/schedulers/types.d.ts +35 -0
  219. package/dist/schedulers/types.d.ts.map +1 -0
  220. package/dist/signal/signal-type.d.ts +26 -0
  221. package/dist/signal/signal-type.d.ts.map +1 -0
  222. package/dist/signal/signal-type.js +31 -0
  223. package/dist/signal/signal-type.js.map +1 -0
  224. package/dist/signal/signal.d.ts +33 -0
  225. package/dist/signal/signal.d.ts.map +1 -0
  226. package/dist/signal/signal.js +70 -0
  227. package/dist/signal/signal.js.map +1 -0
  228. package/dist/sinks/index.d.ts +7 -0
  229. package/dist/sinks/index.d.ts.map +1 -0
  230. package/dist/sinks/index.js +2 -0
  231. package/dist/sinks/many.d.ts +66 -0
  232. package/dist/sinks/many.d.ts.map +1 -0
  233. package/dist/sinks/many.js +193 -0
  234. package/dist/sinks/many.js.map +1 -0
  235. package/dist/sinks/one.d.ts +41 -0
  236. package/dist/sinks/one.d.ts.map +1 -0
  237. package/dist/sinks/one.js +144 -0
  238. package/dist/sinks/one.js.map +1 -0
  239. package/dist/sinks/specs.d.ts +25 -0
  240. package/dist/sinks/specs.d.ts.map +1 -0
  241. package/dist/sinks/specs.js +126 -0
  242. package/dist/sinks/specs.js.map +1 -0
  243. package/dist/sinks/subscribers.d.ts +16 -0
  244. package/dist/sinks/subscribers.d.ts.map +1 -0
  245. package/dist/sinks/subscribers.js +32 -0
  246. package/dist/sinks/subscribers.js.map +1 -0
  247. package/dist/sinks/types.d.ts +137 -0
  248. package/dist/sinks/types.d.ts.map +1 -0
  249. package/dist/sinks/types.js +58 -0
  250. package/dist/sinks/types.js.map +1 -0
  251. package/dist/subscription/core-subscriber.d.ts +12 -0
  252. package/dist/subscription/core-subscriber.d.ts.map +1 -0
  253. package/dist/subscription/iterable-subscription.d.ts +64 -0
  254. package/dist/subscription/iterable-subscription.d.ts.map +1 -0
  255. package/dist/subscription/iterable-subscription.js +281 -0
  256. package/dist/subscription/iterable-subscription.js.map +1 -0
  257. package/dist/subscription/reactive-streams.d.ts +8 -0
  258. package/dist/subscription/reactive-streams.d.ts.map +1 -0
  259. package/dist/subscription/reactive-streams.js +0 -0
  260. package/dist/subscription/subscriber.d.ts +17 -0
  261. package/dist/subscription/subscriber.d.ts.map +1 -0
  262. package/dist/subscription/subscription.d.ts +12 -0
  263. package/dist/subscription/subscription.d.ts.map +1 -0
  264. package/package.json +99 -33
  265. package/LICENSE.md +0 -56
  266. package/dist/index.d.mts +0 -2557
  267. package/dist/index.js.map +0 -1
  268. package/dist/index.mjs +0 -2
  269. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,12 @@
1
+ import toPropertyKey from "./toPropertyKey.js";
2
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/defineProperty.js
3
+ function _defineProperty(e, r, t) {
4
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
5
+ value: t,
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0
9
+ }) : e[r] = t, e;
10
+ }
11
+ //#endregion
12
+ export { _defineProperty as default };
@@ -0,0 +1,14 @@
1
+ import _typeof from "./typeof.js";
2
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPrimitive.js
3
+ function toPrimitive(t, r) {
4
+ if ("object" != _typeof(t) || !t) return t;
5
+ var e = t[Symbol.toPrimitive];
6
+ if (void 0 !== e) {
7
+ var i = e.call(t, r || "default");
8
+ if ("object" != _typeof(i)) return i;
9
+ throw new TypeError("@@toPrimitive must return a primitive value.");
10
+ }
11
+ return ("string" === r ? String : Number)(t);
12
+ }
13
+ //#endregion
14
+ export { toPrimitive as default };
@@ -0,0 +1,9 @@
1
+ import _typeof from "./typeof.js";
2
+ import toPrimitive from "./toPrimitive.js";
3
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPropertyKey.js
4
+ function toPropertyKey(t) {
5
+ var i = toPrimitive(t, "string");
6
+ return "symbol" == _typeof(i) ? i : i + "";
7
+ }
8
+ //#endregion
9
+ export { toPropertyKey as default };
@@ -0,0 +1,11 @@
1
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/typeof.js
2
+ function _typeof(o) {
3
+ "@babel/helpers - typeof";
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
5
+ return typeof o;
6
+ } : function(o) {
7
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
+ }, _typeof(o);
9
+ }
10
+ //#endregion
11
+ export { _typeof as default };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Context storage and lookup primitives for Reactor-style contextual operators.
4
+ */
5
+ import type { ContextKey } from "./types.js";
6
+ /** Read-only immutable context view. */
7
+ export declare class ContextView {
8
+ /** Stores immutable context entries by arbitrary user-provided keys. */
9
+ protected entries: ReadonlyMap<ContextKey, unknown>;
10
+ /** Creates a read-only context view from entries, copying unless entries are trusted immutable data. */
11
+ constructor(entries?: Iterable<readonly [ContextKey, unknown]>, trusted?: boolean);
12
+ /** Returns the value for `key` or throws when absent. */
13
+ get<T = unknown>(key: ContextKey): T;
14
+ /** Returns the value for `key` or `defaultValue` when absent. */
15
+ getOrDefault<T>(key: ContextKey, defaultValue: T): T;
16
+ /** Returns the value for `key` or undefined when absent. */
17
+ getOrEmpty<T = unknown>(key: ContextKey): T | undefined;
18
+ /** Returns true when the context contains `key`. */
19
+ hasKey(key: ContextKey): boolean;
20
+ /** Returns true when this context has no entries. */
21
+ isEmpty(): boolean;
22
+ /** Returns the number of entries. */
23
+ size(): number;
24
+ /** Invokes `consumer` for each context entry. */
25
+ forEach(consumer: (key: ContextKey, value: unknown) => void): void;
26
+ /** Returns an iterator over context entries. */
27
+ stream(): IterableIterator<readonly [ContextKey, unknown]>;
28
+ /** Copies this context view to a readonly map. */
29
+ toMap(): ReadonlyMap<ContextKey, unknown>;
30
+ }
31
+ //# sourceMappingURL=context-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-view.d.ts","sourceRoot":"","sources":["../../src/context/context-view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAKnD,wCAAwC;AACxC,qBAAa,WAAW;IACpB,wEAAwE;IACxE,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEpD,wGAAwG;IACxG,YAAmB,OAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,UAAQ,EAOrF;IAED,yDAAyD;IAClD,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,CAAC,CAK1C;IAED,iEAAiE;IAC1D,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAE1D;IAED,4DAA4D;IACrD,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,CAAC,GAAG,SAAS,CAE7D;IAED,oDAAoD;IAC7C,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAEtC;IAED,qDAAqD;IAC9C,OAAO,IAAI,OAAO,CAExB;IAED,qCAAqC;IAC9B,IAAI,IAAI,MAAM,CAEpB;IAED,iDAAiD;IAC1C,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAIxE;IAED,gDAAgD;IACzC,MAAM,IAAI,gBAAgB,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAEhE;IAED,kDAAkD;IAC3C,KAAK,IAAI,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAE/C;CACJ"}
@@ -0,0 +1,58 @@
1
+ import _defineProperty from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js";
2
+ //#region src/context/context-view.ts
3
+ /** Shared immutable empty context entries map. */
4
+ var EMPTY_CONTEXT_ENTRIES = /* @__PURE__ */ new Map();
5
+ /** Read-only immutable context view. */
6
+ var ContextView = class {
7
+ /** Creates a read-only context view from entries, copying unless entries are trusted immutable data. */
8
+ constructor(entries, trusted = false) {
9
+ _defineProperty(
10
+ this,
11
+ /** Stores immutable context entries by arbitrary user-provided keys. */
12
+ "entries",
13
+ void 0
14
+ );
15
+ this.entries = entries === void 0 ? EMPTY_CONTEXT_ENTRIES : trusted ? entries : new Map(entries);
16
+ }
17
+ /** Returns the value for `key` or throws when absent. */
18
+ get(key) {
19
+ if (!this.entries.has(key)) throw new Error(`Context does not contain key: ${String(key)}`);
20
+ return this.entries.get(key);
21
+ }
22
+ /** Returns the value for `key` or `defaultValue` when absent. */
23
+ getOrDefault(key, defaultValue) {
24
+ return this.entries.has(key) ? this.entries.get(key) : defaultValue;
25
+ }
26
+ /** Returns the value for `key` or undefined when absent. */
27
+ getOrEmpty(key) {
28
+ return this.entries.get(key);
29
+ }
30
+ /** Returns true when the context contains `key`. */
31
+ hasKey(key) {
32
+ return this.entries.has(key);
33
+ }
34
+ /** Returns true when this context has no entries. */
35
+ isEmpty() {
36
+ return this.entries.size === 0;
37
+ }
38
+ /** Returns the number of entries. */
39
+ size() {
40
+ return this.entries.size;
41
+ }
42
+ /** Invokes `consumer` for each context entry. */
43
+ forEach(consumer) {
44
+ for (const [key, value] of this.entries) consumer(key, value);
45
+ }
46
+ /** Returns an iterator over context entries. */
47
+ stream() {
48
+ return this.entries.entries();
49
+ }
50
+ /** Copies this context view to a readonly map. */
51
+ toMap() {
52
+ return new Map(this.entries);
53
+ }
54
+ };
55
+ //#endregion
56
+ export { ContextView };
57
+
58
+ //# sourceMappingURL=context-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-view.js","names":[],"sources":["../../src/context/context-view.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Context storage and lookup primitives for Reactor-style contextual operators.\n */\nimport type {ContextKey} from \"@/context/types.js\";\n\n/** Shared immutable empty context entries map. */\nconst EMPTY_CONTEXT_ENTRIES: ReadonlyMap<ContextKey, unknown> = new Map();\n\n/** Read-only immutable context view. */\nexport class ContextView {\n /** Stores immutable context entries by arbitrary user-provided keys. */\n protected entries: ReadonlyMap<ContextKey, unknown>;\n\n /** Creates a read-only context view from entries, copying unless entries are trusted immutable data. */\n public constructor(entries?: Iterable<readonly [ContextKey, unknown]>, trusted = false) {\n this.entries =\n entries === undefined\n ? EMPTY_CONTEXT_ENTRIES\n : trusted\n ? (entries as ReadonlyMap<ContextKey, unknown>)\n : new Map(entries);\n }\n\n /** Returns the value for `key` or throws when absent. */\n public get<T = unknown>(key: ContextKey): T {\n if (!this.entries.has(key)) {\n throw new Error(`Context does not contain key: ${String(key)}`);\n }\n return this.entries.get(key) as T;\n }\n\n /** Returns the value for `key` or `defaultValue` when absent. */\n public getOrDefault<T>(key: ContextKey, defaultValue: T): T {\n return this.entries.has(key) ? (this.entries.get(key) as T) : defaultValue;\n }\n\n /** Returns the value for `key` or undefined when absent. */\n public getOrEmpty<T = unknown>(key: ContextKey): T | undefined {\n return this.entries.get(key) as T | undefined;\n }\n\n /** Returns true when the context contains `key`. */\n public hasKey(key: ContextKey): boolean {\n return this.entries.has(key);\n }\n\n /** Returns true when this context has no entries. */\n public isEmpty(): boolean {\n return this.entries.size === 0;\n }\n\n /** Returns the number of entries. */\n public size(): number {\n return this.entries.size;\n }\n\n /** Invokes `consumer` for each context entry. */\n public forEach(consumer: (key: ContextKey, value: unknown) => void): void {\n for (const [key, value] of this.entries) {\n consumer(key, value);\n }\n }\n\n /** Returns an iterator over context entries. */\n public stream(): IterableIterator<readonly [ContextKey, unknown]> {\n return this.entries.entries();\n }\n\n /** Copies this context view to a readonly map. */\n public toMap(): ReadonlyMap<ContextKey, unknown> {\n return new Map(this.entries);\n }\n}\n"],"mappings":";;;AAOA,IAAM,wCAA0D,IAAI,IAAI;;AAGxE,IAAa,cAAb,MAAyB;;CAKrB,YAAmB,SAAoD,UAAU,OAAO;;;;GAHxF;;;EAII,KAAK,UACD,YAAY,SACN,wBACA,UACK,UACD,IAAI,IAAI,OAAO;CACjC;;CAGA,IAAwB,KAAoB;EACxC,IAAI,CAAC,KAAK,QAAQ,IAAI,GAAG,GACrB,MAAM,IAAI,MAAM,iCAAiC,OAAO,GAAG,GAAG;EAElE,OAAO,KAAK,QAAQ,IAAI,GAAG;CAC/B;;CAGA,aAAuB,KAAiB,cAAoB;EACxD,OAAO,KAAK,QAAQ,IAAI,GAAG,IAAK,KAAK,QAAQ,IAAI,GAAG,IAAU;CAClE;;CAGA,WAA+B,KAAgC;EAC3D,OAAO,KAAK,QAAQ,IAAI,GAAG;CAC/B;;CAGA,OAAc,KAA0B;EACpC,OAAO,KAAK,QAAQ,IAAI,GAAG;CAC/B;;CAGA,UAA0B;EACtB,OAAO,KAAK,QAAQ,SAAS;CACjC;;CAGA,OAAsB;EAClB,OAAO,KAAK,QAAQ;CACxB;;CAGA,QAAe,UAA2D;EACtE,KAAK,MAAM,CAAC,KAAK,UAAU,KAAK,SAC5B,SAAS,KAAK,KAAK;CAE3B;;CAGA,SAAkE;EAC9D,OAAO,KAAK,QAAQ,QAAQ;CAChC;;CAGA,QAAiD;EAC7C,OAAO,IAAI,IAAI,KAAK,OAAO;CAC/B;AACJ"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Context storage and lookup primitives for Reactor-style contextual operators.
4
+ */
5
+ import { ContextView } from "./context-view.js";
6
+ import type { ContextKey } from "./types.js";
7
+ /** Immutable writable context that returns new instances on mutation. */
8
+ export declare class Context extends ContextView {
9
+ /** Shared singleton used for all empty context instances. */
10
+ private static readonly EMPTY;
11
+ /** Cached read-only facade for this immutable context. */
12
+ private readOnlyView;
13
+ /** Creates a context and validates every provided entry. */
14
+ private constructor();
15
+ /** Returns the shared empty context. */
16
+ static empty(): Context;
17
+ /** Creates a context from key/value pairs. */
18
+ static of(): Context;
19
+ /** Creates a context from one key/value pair. */
20
+ static of(key: ContextKey, value: unknown): Context;
21
+ /** Creates a context from two key/value pairs. */
22
+ static of(key1: ContextKey, value1: unknown, key2: ContextKey, value2: unknown): Context;
23
+ /** Creates a context from three key/value pairs. */
24
+ static of(key1: ContextKey, value1: unknown, key2: ContextKey, value2: unknown, key3: ContextKey, value3: unknown): Context;
25
+ /** Creates a context from four key/value pairs. */
26
+ static of(key1: ContextKey, value1: unknown, key2: ContextKey, value2: unknown, key3: ContextKey, value3: unknown, key4: ContextKey, value4: unknown): Context;
27
+ /** Creates a context from five key/value pairs. */
28
+ static of(key1: ContextKey, value1: unknown, key2: ContextKey, value2: unknown, key3: ContextKey, value3: unknown, key4: ContextKey, value4: unknown, key5: ContextKey, value5: unknown): Context;
29
+ /** Creates a context from iterable entries or an object record. */
30
+ static from(entries: Iterable<readonly [ContextKey, unknown]> | Record<PropertyKey, unknown>): Context;
31
+ /** Returns a new context with `key` associated to `value`. */
32
+ put(key: ContextKey, value: unknown): Context;
33
+ /** Returns this context unchanged when `value` is nullish, otherwise puts it. */
34
+ putNonNull(key: ContextKey, value: unknown | null | undefined): Context;
35
+ /** Returns a new context containing this context and all entries from `other`. */
36
+ putAll(other: ContextView | Iterable<readonly [ContextKey, unknown]>): Context;
37
+ /** Returns a new context without `key`. */
38
+ delete(key: ContextKey): Context;
39
+ /** Returns a read-only view of this context. */
40
+ readOnly(): ContextView;
41
+ /** Creates a context from enumerable string and symbol record keys. */
42
+ private static fromRecord;
43
+ /** Creates a context from iterable entries while validating in the same pass. */
44
+ private static fromEntries;
45
+ }
46
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAEnD,yEAAyE;AACzE,qBAAa,OAAQ,SAAQ,WAAW;IACpC,6DAA6D;IAC7D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAiB;IAC9C,0DAA0D;IAC1D,OAAO,CAAC,YAAY,CAA0B;IAE9C,4DAA4D;IAC5D,OAAO,eAcN;IAED,wCAAwC;IACxC,OAAc,KAAK,IAAI,OAAO,CAE7B;IAED,8CAA8C;IAC9C,OAAc,EAAE,IAAI,OAAO,CAAC;IAC5B,iDAAiD;IACjD,OAAc,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3D,kDAAkD;IAClD,OAAc,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;IAChG,oDAAoD;IACpD,OAAc,EAAE,CACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,GAChB,OAAO,CAAC;IACX,mDAAmD;IACnD,OAAc,EAAE,CACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,GAChB,OAAO,CAAC;IACX,mDAAmD;IACnD,OAAc,EAAE,CACZ,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,OAAO,GAChB,OAAO,CAAC;IAsBX,mEAAmE;IACnE,OAAc,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,OAAO,CAS5G;IAED,8DAA8D;IACvD,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAQnD;IAED,iFAAiF;IAC1E,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE7E;IAED,kFAAkF;IAC3E,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,GAAG,OAAO,CAcpF;IAED,2CAA2C;IACpC,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAOtC;IAED,gDAAgD;IACzC,QAAQ,IAAI,WAAW,CAG7B;IAED,uEAAuE;IACvE,OAAO,CAAC,MAAM,CAAC,UAAU;IAkBzB,iFAAiF;IACjF,OAAO,CAAC,MAAM,CAAC,WAAW;CAQ7B"}
@@ -0,0 +1,125 @@
1
+ import _defineProperty from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js";
2
+ import { ContextView } from "./context-view.js";
3
+ //#region src/context/context.ts
4
+ /**
5
+ * @packageDocumentation
6
+ * Context storage and lookup primitives for Reactor-style contextual operators.
7
+ */
8
+ var _Context;
9
+ /** Immutable writable context that returns new instances on mutation. */
10
+ var Context = class Context extends ContextView {
11
+ /** Creates a context and validates every provided entry. */
12
+ constructor(entries, trusted = false, validate = true) {
13
+ super();
14
+ _defineProperty(
15
+ this,
16
+ /** Cached read-only facade for this immutable context. */
17
+ "readOnlyView",
18
+ void 0
19
+ );
20
+ const nextEntries = entries === void 0 ? this.entries : trusted ? entries : new Map(entries);
21
+ if (validate) for (const [key, value] of nextEntries) assertContextEntry(key, value);
22
+ this.entries = nextEntries;
23
+ }
24
+ /** Returns the shared empty context. */
25
+ static empty() {
26
+ return Context.EMPTY;
27
+ }
28
+ /** Creates a context from an arbitrary even-length key/value pair list. */
29
+ static of(...pairs) {
30
+ if (pairs.length === 0) return Context.empty();
31
+ if (pairs.length === 1 && pairs[0] instanceof Map) return Context.from(pairs[0]);
32
+ if (pairs.length % 2 !== 0) throw new RangeError("Context.of expects key/value pairs");
33
+ const entries = /* @__PURE__ */ new Map();
34
+ for (let i = 0; i < pairs.length; i += 2) {
35
+ const key = pairs[i];
36
+ const value = pairs[i + 1];
37
+ assertContextEntry(key, value);
38
+ entries.set(key, value);
39
+ }
40
+ return entries.size === 0 ? Context.empty() : new Context(entries, true, false);
41
+ }
42
+ /** Creates a context from iterable entries or an object record. */
43
+ static from(entries) {
44
+ if (typeof entries[Symbol.iterator] === "function") {
45
+ const sized = entries;
46
+ if (sized.size === 0 || sized.length === 0) return Context.empty();
47
+ return Context.fromEntries(entries);
48
+ }
49
+ return Context.fromRecord(entries);
50
+ }
51
+ /** Returns a new context with `key` associated to `value`. */
52
+ put(key, value) {
53
+ assertContextEntry(key, value);
54
+ if (Object.is(this.entries.get(key), value)) return this;
55
+ const next = new Map(this.entries);
56
+ next.set(key, value);
57
+ return new Context(next, true, false);
58
+ }
59
+ /** Returns this context unchanged when `value` is nullish, otherwise puts it. */
60
+ putNonNull(key, value) {
61
+ return value === null || value === void 0 ? this : this.put(key, value);
62
+ }
63
+ /** Returns a new context containing this context and all entries from `other`. */
64
+ putAll(other) {
65
+ let next;
66
+ const entries = other instanceof ContextView ? other.stream() : other;
67
+ for (const [key, value] of entries) {
68
+ assertContextEntry(key, value);
69
+ if (next === void 0) {
70
+ if (Object.is(this.entries.get(key), value)) continue;
71
+ next = new Map(this.entries);
72
+ }
73
+ next.set(key, value);
74
+ }
75
+ return next === void 0 ? this : new Context(next, true, false);
76
+ }
77
+ /** Returns a new context without `key`. */
78
+ delete(key) {
79
+ if (!this.entries.has(key)) return this;
80
+ const next = new Map(this.entries);
81
+ next.delete(key);
82
+ return next.size === 0 ? Context.empty() : new Context(next, true, false);
83
+ }
84
+ /** Returns a read-only view of this context. */
85
+ readOnly() {
86
+ this.readOnlyView ?? (this.readOnlyView = new ContextView(this.entries, true));
87
+ return this.readOnlyView;
88
+ }
89
+ /** Creates a context from enumerable string and symbol record keys. */
90
+ static fromRecord(record) {
91
+ let entries;
92
+ for (const key of Object.keys(record)) {
93
+ const value = record[key];
94
+ assertContextEntry(key, value);
95
+ (entries ?? (entries = /* @__PURE__ */ new Map())).set(key, value);
96
+ }
97
+ for (const key of Object.getOwnPropertySymbols(record)) {
98
+ if (!Object.prototype.propertyIsEnumerable.call(record, key)) continue;
99
+ const value = record[key];
100
+ assertContextEntry(key, value);
101
+ (entries ?? (entries = /* @__PURE__ */ new Map())).set(key, value);
102
+ }
103
+ return entries === void 0 ? Context.empty() : new Context(entries, true, false);
104
+ }
105
+ /** Creates a context from iterable entries while validating in the same pass. */
106
+ static fromEntries(entries) {
107
+ let next;
108
+ for (const [key, value] of entries) {
109
+ assertContextEntry(key, value);
110
+ (next ?? (next = /* @__PURE__ */ new Map())).set(key, value);
111
+ }
112
+ return next === void 0 ? Context.empty() : new Context(next, true, false);
113
+ }
114
+ };
115
+ _Context = Context;
116
+ _defineProperty(Context, "EMPTY", new _Context());
117
+ /** Validates that a context key and value can be stored. */
118
+ function assertContextEntry(key, value) {
119
+ if (key === null || key === void 0) throw new TypeError("Context key must not be null or undefined");
120
+ if (value === null || value === void 0) throw new TypeError("Context value must not be null or undefined");
121
+ }
122
+ //#endregion
123
+ export { Context };
124
+
125
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","names":[],"sources":["../../src/context/context.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Context storage and lookup primitives for Reactor-style contextual operators.\n */\nimport {ContextView} from \"@/context/context-view.js\";\nimport type {ContextKey} from \"@/context/types.js\";\n\n/** Immutable writable context that returns new instances on mutation. */\nexport class Context extends ContextView {\n /** Shared singleton used for all empty context instances. */\n private static readonly EMPTY = new Context();\n /** Cached read-only facade for this immutable context. */\n private readOnlyView: ContextView | undefined;\n\n /** Creates a context and validates every provided entry. */\n private constructor(entries?: Iterable<readonly [ContextKey, unknown]>, trusted = false, validate = true) {\n super();\n const nextEntries =\n entries === undefined\n ? this.entries\n : trusted\n ? (entries as ReadonlyMap<ContextKey, unknown>)\n : new Map(entries);\n if (validate) {\n for (const [key, value] of nextEntries) {\n assertContextEntry(key, value);\n }\n }\n this.entries = nextEntries;\n }\n\n /** Returns the shared empty context. */\n public static empty(): Context {\n return Context.EMPTY;\n }\n\n /** Creates a context from key/value pairs. */\n public static of(): Context;\n /** Creates a context from one key/value pair. */\n public static of(key: ContextKey, value: unknown): Context;\n /** Creates a context from two key/value pairs. */\n public static of(key1: ContextKey, value1: unknown, key2: ContextKey, value2: unknown): Context;\n /** Creates a context from three key/value pairs. */\n public static of(\n key1: ContextKey,\n value1: unknown,\n key2: ContextKey,\n value2: unknown,\n key3: ContextKey,\n value3: unknown\n ): Context;\n /** Creates a context from four key/value pairs. */\n public static of(\n key1: ContextKey,\n value1: unknown,\n key2: ContextKey,\n value2: unknown,\n key3: ContextKey,\n value3: unknown,\n key4: ContextKey,\n value4: unknown\n ): Context;\n /** Creates a context from five key/value pairs. */\n public static of(\n key1: ContextKey,\n value1: unknown,\n key2: ContextKey,\n value2: unknown,\n key3: ContextKey,\n value3: unknown,\n key4: ContextKey,\n value4: unknown,\n key5: ContextKey,\n value5: unknown\n ): Context;\n /** Creates a context from an arbitrary even-length key/value pair list. */\n public static of(...pairs: unknown[]): Context {\n if (pairs.length === 0) {\n return Context.empty();\n }\n if (pairs.length === 1 && pairs[0] instanceof Map) {\n return Context.from(pairs[0]);\n }\n if (pairs.length % 2 !== 0) {\n throw new RangeError(\"Context.of expects key/value pairs\");\n }\n const entries = new Map<ContextKey, unknown>();\n for (let i = 0; i < pairs.length; i += 2) {\n const key = pairs[i];\n const value = pairs[i + 1];\n assertContextEntry(key, value);\n entries.set(key, value);\n }\n return entries.size === 0 ? Context.empty() : new Context(entries, true, false);\n }\n\n /** Creates a context from iterable entries or an object record. */\n public static from(entries: Iterable<readonly [ContextKey, unknown]> | Record<PropertyKey, unknown>): Context {\n if (typeof (entries as { [Symbol.iterator]?: unknown })[Symbol.iterator] === \"function\") {\n const sized = entries as { readonly length?: number; readonly size?: number };\n if (sized.size === 0 || sized.length === 0) {\n return Context.empty();\n }\n return Context.fromEntries(entries as Iterable<readonly [ContextKey, unknown]>);\n }\n return Context.fromRecord(entries as Record<PropertyKey, unknown>);\n }\n\n /** Returns a new context with `key` associated to `value`. */\n public put(key: ContextKey, value: unknown): Context {\n assertContextEntry(key, value);\n if (Object.is(this.entries.get(key), value)) {\n return this;\n }\n const next = new Map(this.entries);\n next.set(key, value);\n return new Context(next, true, false);\n }\n\n /** Returns this context unchanged when `value` is nullish, otherwise puts it. */\n public putNonNull(key: ContextKey, value: unknown | null | undefined): Context {\n return value === null || value === undefined ? this : this.put(key, value);\n }\n\n /** Returns a new context containing this context and all entries from `other`. */\n public putAll(other: ContextView | Iterable<readonly [ContextKey, unknown]>): Context {\n let next: Map<ContextKey, unknown> | undefined;\n const entries = other instanceof ContextView ? other.stream() : other;\n for (const [key, value] of entries) {\n assertContextEntry(key, value);\n if (next === undefined) {\n if (Object.is(this.entries.get(key), value)) {\n continue;\n }\n next = new Map(this.entries);\n }\n next.set(key, value);\n }\n return next === undefined ? this : new Context(next, true, false);\n }\n\n /** Returns a new context without `key`. */\n public delete(key: ContextKey): Context {\n if (!this.entries.has(key)) {\n return this;\n }\n const next = new Map(this.entries);\n next.delete(key);\n return next.size === 0 ? Context.empty() : new Context(next, true, false);\n }\n\n /** Returns a read-only view of this context. */\n public readOnly(): ContextView {\n this.readOnlyView ??= new ContextView(this.entries, true);\n return this.readOnlyView;\n }\n\n /** Creates a context from enumerable string and symbol record keys. */\n private static fromRecord(record: Record<PropertyKey, unknown>): Context {\n let entries: Map<ContextKey, unknown> | undefined;\n for (const key of Object.keys(record)) {\n const value = record[key];\n assertContextEntry(key, value);\n (entries ??= new Map()).set(key, value);\n }\n for (const key of Object.getOwnPropertySymbols(record)) {\n if (!Object.prototype.propertyIsEnumerable.call(record, key)) {\n continue;\n }\n const value = record[key];\n assertContextEntry(key, value);\n (entries ??= new Map()).set(key, value);\n }\n return entries === undefined ? Context.empty() : new Context(entries, true, false);\n }\n\n /** Creates a context from iterable entries while validating in the same pass. */\n private static fromEntries(entries: Iterable<readonly [ContextKey, unknown]>): Context {\n let next: Map<ContextKey, unknown> | undefined;\n for (const [key, value] of entries) {\n assertContextEntry(key, value);\n (next ??= new Map()).set(key, value);\n }\n return next === undefined ? Context.empty() : new Context(next, true, false);\n }\n}\n\n/** Validates that a context key and value can be stored. */\nfunction assertContextEntry(key: ContextKey, value: unknown): void {\n if (key === null || key === undefined) {\n throw new TypeError(\"Context key must not be null or undefined\");\n }\n if (value === null || value === undefined) {\n throw new TypeError(\"Context value must not be null or undefined\");\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Context storage and lookup primitives for Reactor-style contextual operators.
4
+ */
5
+ /** Key type accepted by Reactor context maps. */
6
+ export type ContextKey = unknown;
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,iDAAiD;AACjD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Reactive Streams core contracts and disposable helpers.
4
+ */
5
+ import type { Disposable } from "./types.js";
6
+ /** Simple disposable backed by an optional cleanup callback. */
7
+ export declare class BooleanDisposable implements Disposable {
8
+ /** Tracks whether disposal already happened. */
9
+ private disposed;
10
+ /** Optional cleanup callback invoked on first disposal. */
11
+ private teardown;
12
+ /** Creates a disposable that runs `teardown` once when disposed. */
13
+ constructor(teardown?: () => void);
14
+ /** Releases this disposable and runs its teardown callback once. */
15
+ dispose(): void;
16
+ /** Returns true once this disposable has been released. */
17
+ isDisposed(): boolean;
18
+ }
19
+ //# sourceMappingURL=boolean-disposable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean-disposable.d.ts","sourceRoot":"","sources":["../../src/core/boolean-disposable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAEhD,gEAAgE;AAChE,qBAAa,iBAAkB,YAAW,UAAU;IAChD,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAS;IACzB,2DAA2D;IAC3D,OAAO,CAAC,QAAQ,CAA2B;IAE3C,oEAAoE;IACpE,YAAmB,QAAQ,CAAC,EAAE,MAAM,IAAI,EAEvC;IAED,oEAAoE;IAC7D,OAAO,IAAI,IAAI,CAQrB;IAED,2DAA2D;IACpD,UAAU,IAAI,OAAO,CAE3B;CACJ"}
@@ -0,0 +1,37 @@
1
+ import _defineProperty from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js";
2
+ //#region src/core/boolean-disposable.ts
3
+ /** Simple disposable backed by an optional cleanup callback. */
4
+ var BooleanDisposable = class {
5
+ /** Creates a disposable that runs `teardown` once when disposed. */
6
+ constructor(teardown) {
7
+ _defineProperty(
8
+ this,
9
+ /** Tracks whether disposal already happened. */
10
+ "disposed",
11
+ false
12
+ );
13
+ _defineProperty(
14
+ this,
15
+ /** Optional cleanup callback invoked on first disposal. */
16
+ "teardown",
17
+ void 0
18
+ );
19
+ this.teardown = teardown;
20
+ }
21
+ /** Releases this disposable and runs its teardown callback once. */
22
+ dispose() {
23
+ if (this.disposed) return;
24
+ this.disposed = true;
25
+ const teardown = this.teardown;
26
+ this.teardown = void 0;
27
+ teardown?.();
28
+ }
29
+ /** Returns true once this disposable has been released. */
30
+ isDisposed() {
31
+ return this.disposed;
32
+ }
33
+ };
34
+ //#endregion
35
+ export { BooleanDisposable };
36
+
37
+ //# sourceMappingURL=boolean-disposable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean-disposable.js","names":[],"sources":["../../src/core/boolean-disposable.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Reactive Streams core contracts and disposable helpers.\n */\nimport type {Disposable} from \"@/core/types.js\";\n\n/** Simple disposable backed by an optional cleanup callback. */\nexport class BooleanDisposable implements Disposable {\n /** Tracks whether disposal already happened. */\n private disposed = false;\n /** Optional cleanup callback invoked on first disposal. */\n private teardown: (() => void) | undefined;\n\n /** Creates a disposable that runs `teardown` once when disposed. */\n public constructor(teardown?: () => void) {\n this.teardown = teardown;\n }\n\n /** Releases this disposable and runs its teardown callback once. */\n public dispose(): void {\n if (this.disposed) {\n return;\n }\n this.disposed = true;\n const teardown = this.teardown;\n this.teardown = undefined;\n teardown?.();\n }\n\n /** Returns true once this disposable has been released. */\n public isDisposed(): boolean {\n return this.disposed;\n }\n}\n"],"mappings":";;;AAOA,IAAa,oBAAb,MAAqD;;CAOjD,YAAmB,UAAuB;;;;GAL1C;GAAmB;;;;;GAEnB;;;EAII,KAAK,WAAW;CACpB;;CAGA,UAAuB;EACnB,IAAI,KAAK,UACL;EAEJ,KAAK,WAAW;EAChB,MAAM,WAAW,KAAK;EACtB,KAAK,WAAW;EAChB,WAAW;CACf;;CAGA,aAA6B;EACzB,OAAO,KAAK;CAChB;AACJ"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Reactive Streams core contracts and disposable helpers.
4
+ */
5
+ import type { Disposable } from "./types.js";
6
+ /** Disposable container that releases all registered children together. */
7
+ export declare class CompositeDisposable implements Disposable {
8
+ /** Tracks whether this composite has already been disposed. */
9
+ private disposed;
10
+ /** Child disposables still owned by this composite. */
11
+ private disposables;
12
+ /** Adds a child disposable unless this composite has already been disposed. */
13
+ add(disposable: Disposable): boolean;
14
+ /** Removes a child disposable without disposing it. */
15
+ remove(disposable: Disposable): boolean;
16
+ /** Disposes all children and prevents future additions. */
17
+ dispose(): void;
18
+ /** Returns true after this composite has been disposed. */
19
+ isDisposed(): boolean;
20
+ }
21
+ //# sourceMappingURL=composite-disposable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composite-disposable.d.ts","sourceRoot":"","sources":["../../src/core/composite-disposable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAEhD,2EAA2E;AAC3E,qBAAa,mBAAoB,YAAW,UAAU;IAClD,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAS;IACzB,uDAAuD;IACvD,OAAO,CAAC,WAAW,CAA2C;IAE9D,+EAA+E;IACxE,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAa1C;IAED,uDAAuD;IAChD,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAgB7C;IAED,2DAA2D;IACpD,OAAO,IAAI,IAAI,CAkBrB;IAED,2DAA2D;IACpD,UAAU,IAAI,OAAO,CAE3B;CACJ"}
@@ -0,0 +1,64 @@
1
+ import _defineProperty from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js";
2
+ //#region src/core/composite-disposable.ts
3
+ /** Disposable container that releases all registered children together. */
4
+ var CompositeDisposable = class {
5
+ constructor() {
6
+ _defineProperty(
7
+ this,
8
+ /** Tracks whether this composite has already been disposed. */
9
+ "disposed",
10
+ false
11
+ );
12
+ _defineProperty(
13
+ this,
14
+ /** Child disposables still owned by this composite. */
15
+ "disposables",
16
+ void 0
17
+ );
18
+ }
19
+ /** Adds a child disposable unless this composite has already been disposed. */
20
+ add(disposable) {
21
+ if (this.disposed) {
22
+ disposable.dispose();
23
+ return false;
24
+ }
25
+ if (this.disposables === void 0) this.disposables = disposable;
26
+ else if (this.disposables instanceof Set) this.disposables.add(disposable);
27
+ else if (this.disposables !== disposable) this.disposables = /* @__PURE__ */ new Set([this.disposables, disposable]);
28
+ return true;
29
+ }
30
+ /** Removes a child disposable without disposing it. */
31
+ remove(disposable) {
32
+ if (this.disposables === void 0) return false;
33
+ if (this.disposables instanceof Set) {
34
+ const removed = this.disposables.delete(disposable);
35
+ if (this.disposables.size === 0) this.disposables = void 0;
36
+ return removed;
37
+ }
38
+ if (this.disposables !== disposable) return false;
39
+ this.disposables = void 0;
40
+ return true;
41
+ }
42
+ /** Disposes all children and prevents future additions. */
43
+ dispose() {
44
+ if (this.disposed) return;
45
+ this.disposed = true;
46
+ const disposables = this.disposables;
47
+ this.disposables = void 0;
48
+ if (disposables === void 0) return;
49
+ if (disposables instanceof Set) {
50
+ for (const disposable of disposables) disposable.dispose();
51
+ disposables.clear();
52
+ return;
53
+ }
54
+ disposables.dispose();
55
+ }
56
+ /** Returns true after this composite has been disposed. */
57
+ isDisposed() {
58
+ return this.disposed;
59
+ }
60
+ };
61
+ //#endregion
62
+ export { CompositeDisposable };
63
+
64
+ //# sourceMappingURL=composite-disposable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composite-disposable.js","names":[],"sources":["../../src/core/composite-disposable.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Reactive Streams core contracts and disposable helpers.\n */\nimport type {Disposable} from \"@/core/types.js\";\n\n/** Disposable container that releases all registered children together. */\nexport class CompositeDisposable implements Disposable {\n /** Tracks whether this composite has already been disposed. */\n private disposed = false;\n /** Child disposables still owned by this composite. */\n private disposables: Disposable | Set<Disposable> | undefined;\n\n /** Adds a child disposable unless this composite has already been disposed. */\n public add(disposable: Disposable): boolean {\n if (this.disposed) {\n disposable.dispose();\n return false;\n }\n if (this.disposables === undefined) {\n this.disposables = disposable;\n } else if (this.disposables instanceof Set) {\n this.disposables.add(disposable);\n } else if (this.disposables !== disposable) {\n this.disposables = new Set([this.disposables, disposable]);\n }\n return true;\n }\n\n /** Removes a child disposable without disposing it. */\n public remove(disposable: Disposable): boolean {\n if (this.disposables === undefined) {\n return false;\n }\n if (this.disposables instanceof Set) {\n const removed = this.disposables.delete(disposable);\n if (this.disposables.size === 0) {\n this.disposables = undefined;\n }\n return removed;\n }\n if (this.disposables !== disposable) {\n return false;\n }\n this.disposables = undefined;\n return true;\n }\n\n /** Disposes all children and prevents future additions. */\n public dispose(): void {\n if (this.disposed) {\n return;\n }\n this.disposed = true;\n const disposables = this.disposables;\n this.disposables = undefined;\n if (disposables === undefined) {\n return;\n }\n if (disposables instanceof Set) {\n for (const disposable of disposables) {\n disposable.dispose();\n }\n disposables.clear();\n return;\n }\n disposables.dispose();\n }\n\n /** Returns true after this composite has been disposed. */\n public isDisposed(): boolean {\n return this.disposed;\n }\n}\n"],"mappings":";;;AAOA,IAAa,sBAAb,MAAuD;;;;;GAEnD;GAAmB;;;;;GAEnB;;;;;CAGA,IAAW,YAAiC;EACxC,IAAI,KAAK,UAAU;GACf,WAAW,QAAQ;GACnB,OAAO;EACX;EACA,IAAI,KAAK,gBAAgB,QACrB,KAAK,cAAc;OAChB,IAAI,KAAK,uBAAuB,KACnC,KAAK,YAAY,IAAI,UAAU;OAC5B,IAAI,KAAK,gBAAgB,YAC5B,KAAK,8BAAc,IAAI,IAAI,CAAC,KAAK,aAAa,UAAU,CAAC;EAE7D,OAAO;CACX;;CAGA,OAAc,YAAiC;EAC3C,IAAI,KAAK,gBAAgB,QACrB,OAAO;EAEX,IAAI,KAAK,uBAAuB,KAAK;GACjC,MAAM,UAAU,KAAK,YAAY,OAAO,UAAU;GAClD,IAAI,KAAK,YAAY,SAAS,GAC1B,KAAK,cAAc;GAEvB,OAAO;EACX;EACA,IAAI,KAAK,gBAAgB,YACrB,OAAO;EAEX,KAAK,cAAc;EACnB,OAAO;CACX;;CAGA,UAAuB;EACnB,IAAI,KAAK,UACL;EAEJ,KAAK,WAAW;EAChB,MAAM,cAAc,KAAK;EACzB,KAAK,cAAc;EACnB,IAAI,gBAAgB,QAChB;EAEJ,IAAI,uBAAuB,KAAK;GAC5B,KAAK,MAAM,cAAc,aACrB,WAAW,QAAQ;GAEvB,YAAY,MAAM;GAClB;EACJ;EACA,YAAY,QAAQ;CACxB;;CAGA,aAA6B;EACzB,OAAO,KAAK;CAChB;AACJ"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Reactive Streams core contracts and disposable helpers.
4
+ */
5
+ /** Validates and normalizes a Reactive Streams request amount. */
6
+ export declare function normalizeRequest(n: number): number;
7
+ /** Adds demand values with saturation at positive infinity. */
8
+ export declare function addCap(a: number, b: number): number;
9
+ //# sourceMappingURL=demand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demand.d.ts","sourceRoot":"","sources":["../../src/core/demand.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAQlD;AAED,+DAA+D;AAC/D,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMnD"}
@@ -0,0 +1,21 @@
1
+ //#region src/core/demand.ts
2
+ /**
3
+ * @packageDocumentation
4
+ * Reactive Streams core contracts and disposable helpers.
5
+ */
6
+ /** Validates and normalizes a Reactive Streams request amount. */
7
+ function normalizeRequest(n) {
8
+ if (!Number.isFinite(n)) return Number.POSITIVE_INFINITY;
9
+ if (!Number.isInteger(n) || n <= 0) throw new RangeError("request amount must be a strictly positive integer");
10
+ return n;
11
+ }
12
+ /** Adds demand values with saturation at positive infinity. */
13
+ function addCap(a, b) {
14
+ if (a === Number.POSITIVE_INFINITY || b === Number.POSITIVE_INFINITY) return Number.POSITIVE_INFINITY;
15
+ const next = a + b;
16
+ return next >= Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : next;
17
+ }
18
+ //#endregion
19
+ export { addCap, normalizeRequest };
20
+
21
+ //# sourceMappingURL=demand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demand.js","names":[],"sources":["../../src/core/demand.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Reactive Streams core contracts and disposable helpers.\n */\n/** Validates and normalizes a Reactive Streams request amount. */\nexport function normalizeRequest(n: number): number {\n if (!Number.isFinite(n)) {\n return Number.POSITIVE_INFINITY;\n }\n if (!Number.isInteger(n) || n <= 0) {\n throw new RangeError(\"request amount must be a strictly positive integer\");\n }\n return n;\n}\n\n/** Adds demand values with saturation at positive infinity. */\nexport function addCap(a: number, b: number): number {\n if (a === Number.POSITIVE_INFINITY || b === Number.POSITIVE_INFINITY) {\n return Number.POSITIVE_INFINITY;\n }\n const next = a + b;\n return next >= Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : next;\n}\n"],"mappings":";;;;;;AAKA,SAAgB,iBAAiB,GAAmB;CAChD,IAAI,CAAC,OAAO,SAAS,CAAC,GAClB,OAAO,OAAO;CAElB,IAAI,CAAC,OAAO,UAAU,CAAC,KAAK,KAAK,GAC7B,MAAM,IAAI,WAAW,oDAAoD;CAE7E,OAAO;AACX;;AAGA,SAAgB,OAAO,GAAW,GAAmB;CACjD,IAAI,MAAM,OAAO,qBAAqB,MAAM,OAAO,mBAC/C,OAAO,OAAO;CAElB,MAAM,OAAO,IAAI;CACjB,OAAO,QAAQ,OAAO,mBAAmB,OAAO,oBAAoB;AACxE"}
@@ -0,0 +1,12 @@
1
+ import { CompositeDisposable } from "./composite-disposable.js";
2
+ import type { Disposable } from "./types.js";
3
+ /** Factory helpers for disposable values used by the runtime. */
4
+ export declare const Disposables: {
5
+ /** Returns an already disposed disposable. */
6
+ disposed(): Disposable;
7
+ /** Creates a disposable backed by an optional teardown callback. */
8
+ single(teardown?: () => void): Disposable;
9
+ /** Creates a composite disposable and adds the provided disposables. */
10
+ composite(...disposables: Disposable[]): CompositeDisposable;
11
+ };
12
+ //# sourceMappingURL=disposables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disposables.d.ts","sourceRoot":"","sources":["../../src/core/disposables.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAchD,iEAAiE;AACjE,eAAO,MAAM,WAAW;IACpB,8CAA8C;IAC9C,QAAQ,IAAI,UAAU;IAItB,oEAAoE;IACpE,MAAM,YAAY,MAAM,IAAI,GAAG,UAAU;IAIzC,wEAAwE;IACxE,SAAS,iBAAiB,UAAU,EAAE,GAAG,mBAAmB;CAO/D,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { BooleanDisposable } from "./boolean-disposable.js";
2
+ import { CompositeDisposable } from "./composite-disposable.js";
3
+ //#region src/core/disposables.ts
4
+ /**
5
+ * @packageDocumentation
6
+ * Reactive Streams core contracts and disposable helpers.
7
+ */
8
+ /** Shared no-op disposable reused for already disposed results. */
9
+ var DISPOSED = Object.freeze({
10
+ /** Ignores disposal because the disposable is already disposed. */
11
+ dispose() {},
12
+ /** Always reports that this disposable has been disposed. */
13
+ isDisposed() {
14
+ return true;
15
+ }
16
+ });
17
+ /** Factory helpers for disposable values used by the runtime. */
18
+ var Disposables = {
19
+ /** Returns an already disposed disposable. */
20
+ disposed() {
21
+ return DISPOSED;
22
+ },
23
+ /** Creates a disposable backed by an optional teardown callback. */
24
+ single(teardown) {
25
+ return new BooleanDisposable(teardown);
26
+ },
27
+ /** Creates a composite disposable and adds the provided disposables. */
28
+ composite(...disposables) {
29
+ const composite = new CompositeDisposable();
30
+ for (const disposable of disposables) composite.add(disposable);
31
+ return composite;
32
+ }
33
+ };
34
+ //#endregion
35
+ export { Disposables };
36
+
37
+ //# sourceMappingURL=disposables.js.map