Socket
Socket
Sign inDemoInstall

pick-util

Package Overview
Dependencies
1
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.3

15

package.json
{
"name": "pick-util",
"version": "1.1.2",
"version": "1.1.3",
"description": "Return a copy of the object only containing the whitelisted properties.",

@@ -29,2 +29,3 @@ "main": "index.js",

},
"license": "MIT",
"bugs": {

@@ -35,13 +36,13 @@ "url": "https://github.com/jonkemp/pick-util/issues"

"devDependencies": {
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.8.0",
"eslint": "^7.11.0",
"has-util": "^1.0.0",
"mocha": "^7.1.1",
"rollup": "^2.3.1"
"mocha": "^8.2.0",
"rollup": "^2.32.0"
},
"dependencies": {
"@jonkemp/package-utils": "^1.0.4"
"@jonkemp/package-utils": "^1.0.6"
}
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.pick = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.pick = factory());
}(this, (function () { 'use strict';

@@ -108,18 +108,2 @@

var lib = {
shallowProperty,
getLength,
isArrayLike,
isFunction,
isObject,
isArguments,
identity,
getKeys,
property,
matcher,
isMatch,
optimizeCb,
cb
};
var forEach = (obj, iteratee, context) => {

@@ -183,46 +167,39 @@ iteratee = optimizeCb(iteratee, context);

var lib = {
shallowProperty,
getLength,
isArrayLike,
isFunction,
isObject,
isArguments,
identity,
getKeys,
property,
matcher,
isMatch,
optimizeCb,
cb,
forEach,
map,
flatten: flatten_1
};
const {
getLength: getLength$1,
isArrayLike: isArrayLike$1,
isFunction: isFunction$1,
isObject: isObject$1,
isArguments: isArguments$1,
identity: identity$1,
getKeys: getKeys$1,
property: property$1,
matcher: matcher$1,
isMatch: isMatch$1,
optimizeCb: optimizeCb$1,
cb: cb$1
cb: cb$1,
forEach: forEach$1,
map: map$1,
flatten: flatten$1
} = lib;
const isNumber = obj => toString.call(obj) === '[object Number]';
const isString = obj => toString.call(obj) === '[object String]';
const isUndefined = obj => obj === void 0;
const has = (obj, path) => obj != null && Object.prototype.hasOwnProperty.call(obj, path);
const hasProperty = (obj, path) => {
if (!Array.isArray(path)) {
return has(obj, path);
}
const { length } = path;
for (let i = 0; i < length; i++) {
const key = path[i];
if (obj == null || !Object.prototype.hasOwnProperty.call(obj, key)) {
return false;
}
obj = obj[key];
}
return !!length;
};
const constant = value => () => value;

@@ -241,128 +218,10 @@

const values = (obj) => {
const keys = getKeys$1(obj);
const { length } = keys;
const values = Array(length);
for (let i = 0; i < length; i++) {
values[i] = obj[keys[i]];
}
return values;
};
const toPairs = (obj) => {
const keys = getKeys$1(obj);
const pairs = [];
for (const key of keys) {
pairs.push([key, obj[key]]);
}
return pairs;
};
const noop = () => {};
const initial = (array, n, guard) => Array.prototype.slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
const createPredicateIndexFinder = dir => (array, predicate, context) => {
predicate = cb$1(predicate, context);
const length = getLength$1(array);
let index = dir > 0 ? 0 : length - 1;
for (; index >= 0 && index < length; index += dir) {
if (predicate(array[index], index, array)) return index;
}
return -1;
};
const findIndex = createPredicateIndexFinder(1);
const range = (start, stop, step) => {
if (stop == null) {
stop = start || 0;
start = 0;
}
if (!step) {
step = stop < start ? -1 : 1;
}
const length = Math.max(Math.ceil((stop - start) / step), 0);
const range = Array(length);
for (let idx = 0; idx < length; idx++, start += step) {
range[idx] = start;
}
return range;
};
const findKey = (obj, predicate, context) => {
predicate = cb$1(predicate, context);
const keys = getKeys$1(obj);
let key;
for (let i = 0, { length } = keys; i < length; i++) {
key = keys[i];
if (predicate(obj[key], key, obj)) return key;
}
};
const find = (obj, predicate, context) => {
const keyFinder = isArrayLike$1(obj) ? findIndex : findKey;
const key = keyFinder(obj, predicate, context);
if (key !== void 0 && key !== -1) return obj[key];
};
const filter = (obj, predicate, context) => {
const results = [];
predicate = cb$1(predicate, context);
forEach(obj, (value, index, list) => {
if (predicate(value, index, list)) results.push(value);
});
return results;
};
const reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
const toArray = (obj) => {
if (!obj) return [];
if (Array.isArray(obj)) return Array.prototype.slice.call(obj);
if (isString(obj)) {
// Keep surrogate pair characters together
return obj.match(reStrSymbol);
}
if (isArrayLike$1(obj)) return map(identity$1);
return values(obj);
};
const first = (array, n, guard) => {
if (array == null || array.length < 1) return n == null ? void 0 : [];
if (n == null || guard) return array[0];
return initial(array, array.length - n);
};
var packageUtils = {
getLength: getLength$1,
isArrayLike: isArrayLike$1,
optimizeCb: optimizeCb$1,
isFunction: isFunction$1,
isNumber,
isArguments: isArguments$1,
isString,
isUndefined,
isObject: isObject$1,
getKeys: getKeys$1,
hasProperty,
property: property$1,
isMatch: isMatch$1,
matcher: matcher$1,
findKey,
identity: identity$1,

@@ -372,16 +231,6 @@ constant,

allKeys,
values,
toPairs,
cb: cb$1,
noop,
forEach,
map,
find,
filter,
toArray,
first,
initial,
flatten: flatten_1,
findIndex,
range
forEach: forEach$1,
map: map$1,
flatten: flatten$1
};

@@ -394,3 +243,3 @@

isFunction: isFunction$2,
flatten: flatten$1
flatten: flatten$2
} = packageUtils;

@@ -411,3 +260,3 @@

iteratee = keyInObj$1;
keys = flatten$1(keys);
keys = flatten$2(keys);
obj = Object(obj);

@@ -414,0 +263,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc