Socket
Socket
Sign inDemoInstall

@pnpm/pnpmfile

Package Overview
Dependencies
Maintainers
2
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/pnpmfile - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

2

lib/requireHooks.d.ts

@@ -8,3 +8,3 @@ import type { Lockfile } from '@pnpm/lockfile-types';

readPackage?: (pkg: any, context: HookContext) => any;
afterAllResolved?: (lockfile: Lockfile, context: HookContext) => Lockfile;
afterAllResolved?: (lockfile: Lockfile, context: HookContext) => Lockfile | Promise<Lockfile>;
filterLog?: (log: Log) => boolean;

@@ -11,0 +11,0 @@ }

@@ -28,3 +28,3 @@ "use strict";

}
for (const hookName of ['readPackage', 'afterAllResolved', 'filterLog']) {
for (const hookName of ['readPackage', 'afterAllResolved']) {
if (globalHooks[hookName] && hooks[hookName]) {

@@ -34,4 +34,4 @@ const globalHookContext = createReadPackageHookContext(globalPnpmfile.filename, prefix, hookName);

// the `arg` is a package manifest in case of readPackage() and a lockfile object in case of afterAllResolved()
cookedHooks[hookName] = (arg) => {
return hooks[hookName](globalHooks[hookName](arg, globalHookContext), localHookContext);
cookedHooks[hookName] = async (arg) => {
return hooks[hookName](await globalHooks[hookName](arg, globalHookContext), localHookContext);
};

@@ -50,2 +50,10 @@ }

}
const globalFilterLog = globalHooks.filterLog;
const filterLog = hooks.filterLog;
if (globalFilterLog != null && filterLog != null) {
cookedHooks.filterLog = (log) => globalFilterLog(log) && filterLog(log);
}
else {
cookedHooks.filterLog = globalFilterLog !== null && globalFilterLog !== void 0 ? globalFilterLog : filterLog;
}
return cookedHooks;

@@ -52,0 +60,0 @@ }

@@ -45,3 +45,3 @@ "use strict";

const readPackage = pnpmfile.hooks.readPackage;
pnpmfile.hooks.readPackage = function (pkg, ...args) {
pnpmfile.hooks.readPackage = async function (pkg, ...args) {
var _a, _b, _c, _d;

@@ -52,3 +52,3 @@ pkg.dependencies = (_a = pkg.dependencies) !== null && _a !== void 0 ? _a : {};

pkg.peerDependencies = (_d = pkg.peerDependencies) !== null && _d !== void 0 ? _d : {};
const newPkg = readPackage(pkg, ...args);
const newPkg = await readPackage(pkg, ...args);
if (!newPkg) {

@@ -55,0 +55,0 @@ throw new BadReadPackageHookError(pnpmFilePath, 'readPackage hook did not return a package manifest object.');

{
"name": "@pnpm/pnpmfile",
"version": "1.1.1",
"version": "1.2.0",
"description": "Reading a .pnpmfile.cjs",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"types": "lib/index.d.ts",
"files": [

@@ -28,6 +28,6 @@ "lib",

"dependencies": {
"@pnpm/core-loggers": "6.0.5",
"@pnpm/core-loggers": "6.0.6",
"@pnpm/error": "2.0.0",
"@pnpm/lockfile-types": "3.1.0",
"@pnpm/types": "7.5.0",
"@pnpm/lockfile-types": "3.1.1",
"@pnpm/types": "7.6.0",
"chalk": "^4.1.0",

@@ -34,0 +34,0 @@ "path-absolute": "^1.0.1"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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