@pnpm/read-package-json
Advanced tools
Comparing version 1.0.1 to 1.1.1
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -8,3 +16,14 @@ const path = require("path"); | ||
function readPkg(pkgPath) { | ||
return readPackageJson(pkgPath); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
return yield readPackageJson(pkgPath); | ||
} | ||
catch (err) { | ||
if (err['code']) | ||
throw err; // tslint:disable-line | ||
const pnpmError = new Error(`${pkgPath}: ${err.message}`); | ||
pnpmError['code'] = 'ERR_PNPM_BAD_PACKAGE_JSON'; // tslint:disable-line | ||
throw pnpmError; | ||
} | ||
}); | ||
} | ||
@@ -11,0 +30,0 @@ exports.default = readPkg; |
{ | ||
"name": "@pnpm/read-package-json", | ||
"version": "1.0.1", | ||
"version": "1.1.1", | ||
"description": "Read a package.json", | ||
@@ -40,3 +40,3 @@ "main": "lib/index.js", | ||
"@pnpm/types": "^2.0.0", | ||
"read-package-json": "^2.0.13", | ||
"read-package-json": "2.0.13", | ||
"util.promisify": "^1.0.0" | ||
@@ -49,3 +49,3 @@ }, | ||
"mos-plugin-readme": "^1.0.4", | ||
"package-preview": "^1.0.0", | ||
"package-preview": "^2.0.0", | ||
"tape": "^4.8.0", | ||
@@ -52,0 +52,0 @@ "ts-node": "^7.0.0", |
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
5715
36
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedread-package-json@2.0.13(transitive)
+ Addedslash@1.0.0(transitive)
- Removedjson-parse-even-better-errors@2.3.1(transitive)
- Removednpm-normalize-package-bin@1.0.1(transitive)
- Removedread-package-json@2.1.2(transitive)
Updatedread-package-json@2.0.13