Socket
Socket
Sign inDemoInstall

@pnpm/npm-conf

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/npm-conf - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

27

lib/util.js
'use strict';
const fs = require('fs');
const path = require('path');
const envReplace = require('@npmcli/config/lib/env-replace.js');
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L406-L420
const envReplace = str => {
if (typeof str !== 'string' || !str) {
return str;
}
// Replace any ${ENV} values with the appropriate environment
const regex = /(\\*)\$\{([^}]+)\}/g;
return str.replace(regex, (orig, esc, name) => {
esc = esc.length > 0 && esc.length % 2;
if (esc) {
return orig;
}
if (process.env[name] === undefined) {
throw new Error(`Failed to replace env in config: ${orig}`);
}
return process.env[name];
});
};
// https://github.com/npm/cli/blob/latest/lib/config/core.js#L359-L404

@@ -73,3 +50,3 @@ const parseField = (types, field, key) => {

field = envReplace(field);
field = envReplace(field, process.env);

@@ -76,0 +53,0 @@ if (isPath) {

3

package.json
{
"name": "@pnpm/npm-conf",
"version": "2.0.2",
"version": "2.0.3",
"description": "Get the npm config",

@@ -24,2 +24,3 @@ "license": "MIT",

"dependencies": {
"@npmcli/config": "^6.1.0",
"@pnpm/network.ca-file": "^1.0.1",

@@ -26,0 +27,0 @@ "config-chain": "^1.1.11"

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