New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lib

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib - npm Package Compare versions

Comparing version 2.2.3 to 2.2.4

lib/flags.js

27

lib.js

@@ -5,20 +5,17 @@ const appendLibPath = require('./lib/append.js');

const executeRemote = require('./lib/remote.js');
const flags = require('./lib/flags.js');
module.exports = (function() {
let LibGen = (cfg, names) => {
cfg = cfg || {};
let LibGen = (rootCfg, cfg, names) => {
rootCfg = Object.assign(cfg || {}, rootCfg || {});
names = names || [];
return new Proxy(
function __call__() {
let args = [].slice.call(arguments);
let isLocal = !names[0];
if (names.length === 0) {
cfg = (typeof args[0] === 'object' ? args[0] : null) || {};
return LibGen(cfg, names);
return LibGen(rootCfg, (typeof args[0] === 'object' ? args[0] : null) || {}, names);
} else if (names.length === 1 && !isLocal) {
cfg.keys = (typeof args[0] === 'object' ? args[0] : null) || {};
return LibGen(cfg, names);
return LibGen(rootCfg, {keys: (typeof args[0] === 'object' ? args[0] : {})}, names);
} else {

@@ -37,3 +34,15 @@ let p = parseParameters(args);

{
get: (target, name) => LibGen(cfg, appendLibPath(names, name))
get: (target, name) => {
if (name[0] === '_') {
let flag = flags[name.substr(1)];
if (!flag) {
throw new Error(`Invalid flag: "${name.substr(1)}". Valid flags: ${Object.keys(flags).join(', ')}.`);
}
return function __flag__() {
return LibGen(rootCfg, flag(...arguments), names);
};
} else {
return LibGen(rootCfg, {}, appendLibPath(names, name));
}
}
}

@@ -40,0 +49,0 @@ );

{
"name": "lib",
"version": "2.2.3",
"version": "2.2.4",
"description": "StdLib: Standard Library for Microservices Node.js Bindings",

@@ -5,0 +5,0 @@ "main": "lib.js",

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