UNPKG

@neo-one/smart-contract-compiler-esnext-esm

Version:

NEO•ONE TypeScript smart contract compiler.

25 lines (23 loc) 930 B
import { tsUtils } from '@neo-one/ts-utils-esnext-esm'; import { Types } from '../../constants'; import { IsHelper } from './IsHelper'; import { UnwrapHelper } from './UnwrapHelper'; import { WrapHelper } from './WrapHelper'; export class UnwrapErrorHelper extends UnwrapHelper { } export class WrapErrorHelper extends WrapHelper { constructor() { super(...arguments); this.type = Types.Error; } } export class IsErrorHelper extends IsHelper { constructor() { super(...arguments); this.type = Types.Error; } } export const hasError = (context, node, type) => tsUtils.type_.hasType(type, (tpe) => isError(context, node, tpe)); export const isOnlyError = (context, node, type) => tsUtils.type_.isOnlyType(type, (tpe) => isError(context, node, tpe)); export const isError = (context, node, type) => context.builtins.isInterface(node, type, 'Error'); //# sourceMappingURL=error.js.map