Comparing version 1.11.0 to 1.11.1
// get the package.json data for the cwd | ||
import { readFileSync } from 'fs'; | ||
import { parse, stringify } from 'polite-json'; | ||
import fail from './fail.js'; | ||
const isPackage = (pkg) => !!pkg && typeof pkg === 'object' && !Array.isArray(pkg); | ||
const readPkg = () => { | ||
try { | ||
return JSON.parse(readFileSync('package.json', 'utf8')); | ||
const res = parse(readFileSync('package.json', 'utf8')); | ||
if (isPackage(res)) | ||
return res; | ||
throw new Error('Invalid package.json contents: ' + stringify(res)); | ||
} | ||
@@ -8,0 +13,0 @@ catch (er) { |
import { writeFileSync } from 'fs'; | ||
import { stringify } from 'polite-json'; | ||
import pkg from './package.js'; | ||
export default () => writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n'); | ||
export default () => writeFileSync('package.json', stringify(pkg)); | ||
//# sourceMappingURL=write-package.js.map |
{ | ||
"name": "tshy", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"description": "TypeScript HYbridizer - Hybrid (CommonJS/ESM) TypeScript node package builder", | ||
@@ -17,2 +17,3 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", | ||
"mkdirp": "^3.0.1", | ||
"polite-json": "^4.0.1", | ||
"resolve-import": "^1.4.4", | ||
@@ -19,0 +20,0 @@ "rimraf": "^5.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175935
1360
10
+ Addedpolite-json@^4.0.1
+ Addedpolite-json@4.0.1(transitive)