Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/lockfile-file

Package Overview
Dependencies
Maintainers
3
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/lockfile-file - npm Package Compare versions

Comparing version 3.0.13 to 3.0.14

7

CHANGELOG.md
# @pnpm/lockfile-file
## 3.0.14
### Patch Changes
- Updated dependencies [75a36deba]
- @pnpm/error@1.3.1
## 3.0.13

@@ -4,0 +11,0 @@

5

lib/errors/index.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LockfileBreakingChangeError = void 0;
const LockfileBreakingChangeError_1 = require("./LockfileBreakingChangeError");
const LockfileBreakingChangeError_1 = __importDefault(require("./LockfileBreakingChangeError"));
exports.LockfileBreakingChangeError = LockfileBreakingChangeError_1.default;
//# sourceMappingURL=index.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const error_1 = require("@pnpm/error");
const error_1 = __importDefault(require("@pnpm/error"));
class LockfileBreakingChangeError extends error_1.default {

@@ -5,0 +8,0 @@ constructor(filename) {

2

lib/getLockfileImporterId.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const normalize = require("normalize-path");
const path = require("path");
exports.default = (lockfileDir, prefix) => normalize(path.relative(lockfileDir, prefix)) || '.';
//# sourceMappingURL=getLockfileImporterId.js.map

@@ -1,6 +0,6 @@

export * from '@pnpm/lockfile-types';
export * from './read';
import existsWantedLockfile from './existsWantedLockfile';
import getLockfileImporterId from './getLockfileImporterId';
import writeLockfiles, { writeCurrentLockfile, writeWantedLockfile } from './write';
export * from '@pnpm/lockfile-types';
export * from './read';
export { existsWantedLockfile, getLockfileImporterId, writeLockfiles, writeCurrentLockfile, writeWantedLockfile, };

@@ -9,17 +9,32 @@ "use strict";

}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeWantedLockfile = exports.writeCurrentLockfile = exports.writeLockfiles = exports.getLockfileImporterId = exports.existsWantedLockfile = void 0;
__exportStar(require("@pnpm/lockfile-types"), exports);
__exportStar(require("./read"), exports);
const existsWantedLockfile_1 = require("./existsWantedLockfile");
const existsWantedLockfile_1 = __importDefault(require("./existsWantedLockfile"));
exports.existsWantedLockfile = existsWantedLockfile_1.default;
const getLockfileImporterId_1 = require("./getLockfileImporterId");
const getLockfileImporterId_1 = __importDefault(require("./getLockfileImporterId"));
exports.getLockfileImporterId = getLockfileImporterId_1.default;
const write_1 = require("./write");
const write_1 = __importStar(require("./write"));
exports.writeLockfiles = write_1.default;
Object.defineProperty(exports, "writeCurrentLockfile", { enumerable: true, get: function () { return write_1.writeCurrentLockfile; } });
Object.defineProperty(exports, "writeWantedLockfile", { enumerable: true, get: function () { return write_1.writeWantedLockfile; } });
__exportStar(require("@pnpm/lockfile-types"), exports);
__exportStar(require("./read"), exports);
//# sourceMappingURL=index.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const logger_1 = require("@pnpm/logger");
const logger_1 = __importDefault(require("@pnpm/logger"));
exports.default = logger_1.default('lockfile');
//# sourceMappingURL=logger.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -6,7 +9,7 @@ exports.createLockfileObject = exports.readWantedLockfile = exports.readCurrentLockfile = void 0;

const types_1 = require("@pnpm/types");
const read_yaml_file_1 = __importDefault(require("read-yaml-file"));
const errors_1 = require("./errors");
const logger_1 = __importDefault(require("./logger"));
const path = require("path");
const read_yaml_file_1 = require("read-yaml-file");
const errors_1 = require("./errors");
const logger_1 = require("./logger");
async function readCurrentLockfile(virtualStoreDir, opts) {
function readCurrentLockfile(virtualStoreDir, opts) {
const lockfilePath = path.join(virtualStoreDir, 'lock.yaml');

@@ -16,3 +19,3 @@ return _read(lockfilePath, virtualStoreDir, opts);

exports.readCurrentLockfile = readCurrentLockfile;
async function readWantedLockfile(pkgPath, opts) {
function readWantedLockfile(pkgPath, opts) {
const lockfilePath = path.join(pkgPath, constants_1.WANTED_LOCKFILE);

@@ -33,3 +36,3 @@ return _read(lockfilePath, pkgPath, opts);

}
// tslint:disable:no-string-literal
/* eslint-disable @typescript-eslint/dot-notation */
if (typeof (lockfile === null || lockfile === void 0 ? void 0 : lockfile['specifiers']) !== 'undefined') {

@@ -50,3 +53,3 @@ lockfile.importers = {

if (lockfile) {
// tslint:enable:no-string-literal
/* eslint-enable @typescript-eslint/dot-notation */
if (typeof opts.wantedVersion !== 'number' || Math.floor(lockfile.lockfileVersion) === Math.floor(opts.wantedVersion)) {

@@ -53,0 +56,0 @@ if (typeof opts.wantedVersion === 'number' && lockfile.lockfileVersion > opts.wantedVersion) {

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeCurrentLockfile = exports.writeWantedLockfile = void 0;
const logger_1 = __importDefault(require("./logger"));
const types_1 = require("@pnpm/types");
const constants_1 = require("@pnpm/constants");
const types_1 = require("@pnpm/types");
const rimraf = require("@zkochan/rimraf");

@@ -12,3 +16,2 @@ const yaml = require("js-yaml");

const writeFileAtomicCB = require("write-file-atomic");
const logger_1 = require("./logger");
function writeFileAtomic(filename, data) {

@@ -42,6 +45,6 @@ return new Promise((resolve, reject) => writeFileAtomicCB(filename, data, {}, (err) => err ? reject(err) : resolve()));

function isEmptyLockfile(lockfile) {
return R.values(lockfile.importers).every((importer) => R.isEmpty(importer.specifiers || {}) && R.isEmpty(importer.dependencies || {}));
return R.values(lockfile.importers).every((importer) => { var _a, _b; return R.isEmpty((_a = importer.specifiers) !== null && _a !== void 0 ? _a : {}) && R.isEmpty((_b = importer.dependencies) !== null && _b !== void 0 ? _b : {}); });
}
function normalizeLockfile(lockfile, forceSharedFormat) {
if (forceSharedFormat === false && R.equals(R.keys(lockfile.importers), ['.'])) {
if (!forceSharedFormat && R.equals(R.keys(lockfile.importers), ['.'])) {
const lockfileToSave = {

@@ -66,2 +69,3 @@ ...lockfile,

importers: R.keys(lockfile.importers).reduce((acc, alias) => {
var _a;
const importer = lockfile.importers[alias];

@@ -72,3 +76,3 @@ const normalizedImporter = {

for (const depType of types_1.DEPENDENCIES_FIELDS) {
if (!R.isEmpty(importer[depType] || {})) {
if (!R.isEmpty((_a = importer[depType]) !== null && _a !== void 0 ? _a : {})) {
normalizedImporter[depType] = importer[depType];

@@ -75,0 +79,0 @@ }

{
"name": "@pnpm/lockfile-file",
"version": "3.0.13",
"version": "3.0.14",
"description": "Read/write pnpm-lock.yaml files",

@@ -15,3 +15,3 @@ "main": "lib/index.js",

"scripts": {
"lint": "tslint -c ../../tslint.json src/**/*.ts test/**/*.ts",
"lint": "eslint -c ../../eslint.json src/**/*.ts test/**/*.ts",
"_test": "cd ../.. && c8 --reporter lcov --reports-dir packages/lockfile-file/coverage ts-node packages/lockfile-file/test --type-check",

@@ -51,3 +51,3 @@ "test": "pnpm run compile && pnpm run _test",

"@pnpm/constants": "4.0.0",
"@pnpm/error": "1.3.0",
"@pnpm/error": "1.3.1",
"@pnpm/lockfile-types": "2.0.1",

@@ -54,0 +54,0 @@ "@pnpm/types": "6.2.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc