UNPKG

format-to-json

Version:

Format string to a json like template.

16 lines (10 loc) 437 B
const fn = require('funclib'); const path = require('path'); const rootPath = path.resolve(__dirname, '../'); const fmtJsPath = path.join(rootPath, 'fmt2json.js'); const fmtMinJsPath = path.join(rootPath, 'fmt2json.min.js'); let fmtJsTpl = fn.rd(fmtJsPath); fmtJsTpl = fmtJsTpl.replace(/\}\)\(undefined\);/, '})(this);'); fn.wt(fmtJsPath, fmtJsTpl); fn.wt(fmtMinJsPath, fmtJsTpl); console.log('\n[bugfix] Fix the built template.');