@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.
20 lines (17 loc) • 786 B
JavaScript
import { isNativeError } from 'node:util/types';
/** @import 'typescript/lib/lib.esnext.error.d.ts' */
/**
* Compatibility wrapper for ES2026 (Node.js 25)
* {@link Error.isError Error.isError}
* with failover to the deprecated {@link isNativeError utils.types.isNativeError}.
* @param error A parameter which may be an Error.
* @returns `true` if {@link error} is derived from or is sufficiently similar to {@link Error}. Else, `false`.
* Note: DOMExceptions will result in `false`
*/
function isError(error) {
return 'isError' in Error && typeof Error.isError === 'function' && Error.isError.length > 0 ? Error.isError(error)
// eslint-disable-next-line @typescript-eslint/no-deprecated
: isNativeError(error);
}
export { isError };
//# sourceMappingURL=isError.mjs.map