UNPKG

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

Version:

NEO•ONE TypeScript smart contract compiler.

25 lines (23 loc) 966 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 UnwrapContractHelper extends UnwrapHelper { } export class WrapContractHelper extends WrapHelper { constructor() { super(...arguments); this.type = Types.Contract; } } export class IsContractHelper extends IsHelper { constructor() { super(...arguments); this.type = Types.Contract; } } export const hasContract = (context, node, type) => tsUtils.type_.hasType(type, (tpe) => isContract(context, node, tpe)); export const isOnlyContract = (context, node, type) => tsUtils.type_.isOnlyType(type, (tpe) => isContract(context, node, tpe)); export const isContract = (context, node, type) => context.builtins.isInterface(node, type, 'Contract'); //# sourceMappingURL=contract.js.map