@orkestrel/terminal 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { CSI, ESC, STATUS_ICONS, createStyler, freezeStyle, strip, stripControls } from "@orkestrel/console";
2
- import { arrayOf, attempt, isArray, isBoolean, isNonEmptyString, isNumber, isRecord, isString, literalOf, parseJSON, rawShape, recordOf, stringShape } from "@orkestrel/contract";
2
+ import { arrayOf, attempt, isArray, isBoolean, isError, isInstance, isNonEmptyString, isNumber, isRecord, isString, literalOf, parseJSON, rawShape, recordOf, stringShape } from "@orkestrel/contract";
3
3
  import { Emitter } from "@orkestrel/emitter";
4
4
  import { createForm, isFieldError, isFormError, parseForm, serializeForm } from "@orkestrel/form";
5
5
  import { createSSEParser } from "@orkestrel/sse";
@@ -309,7 +309,7 @@ var TerminalError = class extends Error {
309
309
  * ```
310
310
  */
311
311
  function isTerminalError(value) {
312
- return value instanceof TerminalError;
312
+ return isInstance(value, TerminalError);
313
313
  }
314
314
  //#endregion
315
315
  //#region src/core/validators.ts
@@ -1214,7 +1214,7 @@ function globalFetch(input, init) {
1214
1214
  * @returns True if the value is a host `Error` or `DOMException` named `AbortError`; false otherwise
1215
1215
  */
1216
1216
  function isAbortError(error) {
1217
- return (error instanceof DOMException || error instanceof Error) && error.name === "AbortError";
1217
+ return isError(error) && error.name === "AbortError";
1218
1218
  }
1219
1219
  /**
1220
1220
  * Checks whether `url` is an insecure remote endpoint — a plain `http://` URL whose host is not a
@@ -1447,7 +1447,7 @@ var Prompt = class {
1447
1447
  if (isFieldError(error.context)) return [error.context];
1448
1448
  const named = error.context?.field;
1449
1449
  return [{
1450
- field: typeof named === "string" ? named : this.#field(form, field),
1450
+ field: isString(named) ? named : this.#field(form, field),
1451
1451
  message: error.message
1452
1452
  }];
1453
1453
  }