UNPKG

@halospv3/hce.shared-config

Version:

Automate commit message quality, changelogs, and CI/CD releases. Its `main` entry point is a Semantic Release config. Functions and classes are exposed for customization. An ESLint config, a Commitlint config, and addl. resources for .NET projects are als

1 lines 1.04 kB
{"version":3,"file":"isError.mjs","names":[],"sources":["../../src/utils/isError.ts"],"sourcesContent":["import { isNativeError } from 'node:util/types';\n\n/** @import 'typescript/lib/lib.esnext.error.d.ts' */\n\n/**\n * Compatibility wrapper for ES2026 (Node.js 25)\n * {@link Error.isError Error.isError}\n * with failover to the deprecated {@link isNativeError utils.types.isNativeError}.\n * @param error A parameter which may be an Error.\n * @returns `true` if {@link error} is derived from or is sufficiently similar to {@link Error}. Else, `false`.\n * Note: DOMExceptions will result in `false`\n */\nexport function isError(error: unknown): error is Error {\n return 'isError' in Error && typeof Error.isError === 'function' && Error.isError.length > 0\n ? Error.isError(error)\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n : isNativeError(error);\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,QAAQ,OAAgC;CACtD,OAAO,aAAa,SAAS,OAAO,MAAM,YAAY,cAAc,MAAM,QAAQ,SAAS,IACvF,MAAM,QAAQ,KAAK,IAEnB,cAAc,KAAK;AACzB"}