UNPKG

@jsverse/transloco

Version:

The internationalization (i18n) library for Angular

19 lines 675 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addScriptToPackageJson = void 0; /** * Adds a script to the package.json */ function addScriptToPackageJson(host, scriptName, script) { const packageFile = host.read('package.json'); if (packageFile !== null) { const sourceText = packageFile.toString('utf-8'); const json = JSON.parse(sourceText); json['scripts'] ??= {}; json['scripts'][scriptName] = script; host.overwrite('package.json', JSON.stringify(json, null, 2)); } return host; } exports.addScriptToPackageJson = addScriptToPackageJson; //# sourceMappingURL=package.js.map