UNPKG

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

Version:

NEO•ONE TypeScript smart contract codegen.

20 lines (18 loc) 748 B
import parser from 'prettier/parser-typescript'; import prettier from 'prettier/standalone'; const formatSingleFile = (value, browserify) => { const result = `// tslint:disable\n/* eslint-disable */\n${prettier.format(value, { arrowParens: 'always', parser: 'typescript', plugins: [parser], printWidth: 120, singleQuote: true, trailingComma: 'all', })}`; return browserify ? result.replace(/'@neo-one\/client'/gu, "'@neo-one/client-browserify'") : result; }; export const formatFile = (value, browserify) => ({ js: value.js === undefined ? undefined : formatSingleFile(value.js, browserify), ts: formatSingleFile(value.ts, browserify), }); //# sourceMappingURL=formatFile.js.map