@jplorg/jpl 2.2.0 → 2.3.0

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/esm/main.js CHANGED
@@ -460,14 +460,19 @@ function lt(e) {
460
460
  // lib/runtime/index.ts
461
461
  var ut = { vars: {} };
462
462
  function I(e = {}, t = {}) {
463
- return r(e, t, "vars");
463
+ return {
464
+ ...r(e, t, "vars"),
465
+ signal: AbortSignal.any([e.signal, t.signal].filter((e) => e != null))
466
+ };
464
467
  }
465
468
  var dt = class {
466
469
  #e;
467
470
  #t;
468
471
  #n;
469
472
  constructor(e, t) {
470
- this.#e = I(t?.runtime, ut), this.#t = e, this.#n = this.createScope({ vars: Object.fromEntries(this.muxOne([Object.entries(this.options.vars)], ([e, t]) => [e, this.normalizeValue(t)])) });
473
+ this.#e = I(t?.runtime, ut), this.#t = e, this.#n = this.createScope({ vars: Object.fromEntries(this.muxOne([Object.entries(this.options.vars)], ([e, t]) => [e, this.normalizeValue(t)])) }), this.options.signal?.aborted && this.#n.signal.exit(), this.options.signal?.addEventListener("abort", () => {
474
+ this.#n.signal.exit();
475
+ });
471
476
  }
472
477
  get options() {
473
478
  return this.#e;
@@ -9,6 +9,7 @@ export type JPLRuntimeOptions = {
9
9
  [name: string]: unknown;
10
10
  };
11
11
  adjustResult?: (result: unknown, scope: JPLRuntimeScope) => Promise<unknown[]> | unknown[];
12
+ signal?: AbortSignal;
12
13
  };
13
14
  export declare function applyRuntimeDefaults(options?: JPLRuntimeOptions, defaults?: JPLRuntimeOptions): JPLRuntimeOptions;
14
15
  /** JPL runtime */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jplorg/jpl",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "JPL interpreter",
5
5
  "license": "MIT",
6
6
  "author": {