UNPKG

@metamask/kernel-errors

Version:
1 lines 595 B
{"version":3,"file":"isOcapError.cjs","sourceRoot":"","sources":["../../src/utils/isOcapError.ts"],"names":[],"mappings":";;AAQA,kCAEC;AAVD,mDAA4C;AAE5C;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,KAAY;IACtC,OAAO,KAAK,YAAY,wBAAS,CAAC;AACpC,CAAC","sourcesContent":["import { BaseError } from '../BaseError.ts';\n\n/**\n * Type guard to check if an error is a custom Ocap error (BaseError).\n *\n * @param error - The error to check.\n * @returns `true` if the error is an instance of BaseError.\n */\nexport function isOcapError(error: Error): error is BaseError {\n return error instanceof BaseError;\n}\n"]}