🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

pluck-util

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pluck-util - npm Package Compare versions

Comparing version
1.0.3
to
1.0.4
+7
-7
package.json
{
"name": "pluck-util",
"version": "1.0.3",
"version": "1.0.4",
"description": "Extract a list of property values from a collection.",

@@ -37,12 +37,12 @@ "main": "index.js",

"devDependencies": {
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-node-resolve": "^13.1.3",
"babel-eslint": "^10.1.0",
"eslint": "^7.13.0",
"mocha": "^8.2.1",
"rollup": "^2.33.1"
"eslint": "^8.11.0",
"mocha": "^9.2.2",
"rollup": "^2.70.1"
},
"dependencies": {
"@jonkemp/package-utils": "^1.0.7"
"@jonkemp/package-utils": "^1.0.8"
}
}

@@ -1,2 +0,2 @@

# pluck-util [![Build Status](https://travis-ci.com/jonkemp/pluck-util.svg?branch=master)](https://travis-ci.com/jonkemp/pluck-util)
# pluck-util ![Build Status](https://github.com/jonkemp/pluck-util/actions/workflows/main.yml/badge.svg?branch=master)

@@ -3,0 +3,0 @@ > Extract a list of property values from a collection.

@@ -5,17 +5,21 @@ (function (global, factory) {

(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.pluck = factory());
}(this, (function () { 'use strict';
})(this, (function () { 'use strict';
var shallowProperty = key => obj => obj == null ? void 0 : obj[key];
var shallowProperty$3 = key => obj => obj == null ? void 0 : obj[key];
var getLength = shallowProperty('length');
const shallowProperty$2 = shallowProperty$3;
var isArrayLike = (collection) => {
const length = getLength(collection);
var getLength$3 = shallowProperty$2('length');
const getLength$2 = getLength$3;
var isArrayLike$4 = (collection) => {
const length = getLength$2(collection);
return typeof length == 'number' && length >= 0 && length <= Number.MAX_SAFE_INTEGER;
};
var isFunction = obj => toString.call(obj) === '[object Function]';
var isFunction$3 = obj => toString.call(obj) === '[object Function]';
var isObject = obj => {
var isObject$4 = obj => {
const type = typeof obj;

@@ -26,12 +30,16 @@

var isArguments = obj => toString.call(obj) === '[object Arguments]';
var isArguments$2 = obj => toString.call(obj) === '[object Arguments]';
var identity = value => value;
var identity$3 = value => value;
var getKeys = (obj) => {
if (!isObject(obj)) return [];
const isObject$3 = isObject$4;
var getKeys$4 = (obj) => {
if (!isObject$3(obj)) return [];
return Object.keys(obj);
};
const shallowProperty$1 = shallowProperty$3;
const deepGet = (obj, path) => {

@@ -48,5 +56,5 @@ const { length } = path;

var property = path => {
var property$4 = path => {
if (!Array.isArray(path)) {
return shallowProperty(path);
return shallowProperty$1(path);
}

@@ -57,4 +65,6 @@

var isMatch = (object, attrs) => {
const keys = getKeys(attrs);
const getKeys$3 = getKeys$4;
var isMatch$2 = (object, attrs) => {
const keys = getKeys$3(attrs);
const {length} = keys;

@@ -74,9 +84,11 @@

var matcher = attrs => {
const isMatch$1 = isMatch$2;
var matcher$3 = attrs => {
attrs = Object.assign({}, attrs);
return obj => isMatch(obj, attrs);
return obj => isMatch$1(obj, attrs);
};
var optimizeCb = (func, context, argCount) => {
var optimizeCb$4 = (func, context, argCount) => {
if (context === void 0) return func;

@@ -93,8 +105,20 @@ switch (argCount == null ? 3 : argCount) {

const identity$2 = identity$3;
const isFunction$2 = isFunction$3;
const optimizeCb$3 = optimizeCb$4;
const isObject$2 = isObject$4;
const matcher$2 = matcher$3;
const property$3 = property$4;
const baseIteratee = (value, context, argCount) => {
if (value == null) return identity;
if (isFunction(value)) return optimizeCb(value, context, argCount);
if (isObject(value) && !Array.isArray(value)) return matcher(value);
if (value == null) return identity$2;
if (isFunction$2(value)) return optimizeCb$3(value, context, argCount);
if (isObject$2(value) && !Array.isArray(value)) return matcher$2(value);
return property(value);
return property$3(value);
};

@@ -106,3 +130,3 @@

var cb = (value, context, argCount) => {
var cb$3 = (value, context, argCount) => {
if (iteratee !== exportIteratee) return iteratee(value, context);

@@ -113,5 +137,9 @@

var forEach = (obj, iteratee, context) => {
iteratee = optimizeCb(iteratee, context);
if (isArrayLike(obj)) {
const getKeys$2 = getKeys$4;
const isArrayLike$3 = isArrayLike$4;
const optimizeCb$2 = optimizeCb$4;
var forEach$3 = (obj, iteratee, context) => {
iteratee = optimizeCb$2(iteratee, context);
if (isArrayLike$3(obj)) {
let i = 0;

@@ -123,3 +151,3 @@

} else {
const keys = getKeys(obj);
const keys = getKeys$2(obj);

@@ -134,7 +162,10 @@ for (const key of keys) {

const flatten = (input, shallow, strict, output = []) => {
const isArrayLike$2 = isArrayLike$4;
const isArguments$1 = isArguments$2;
const forEach$2 = forEach$3;
const flatten$2 = (input, shallow, strict, output = []) => {
let idx = output.length;
forEach(input, value => {
if (isArrayLike(value) && (Array.isArray(value) || isArguments(value))) {
forEach$2(input, value => {
if (isArrayLike$2(value) && (Array.isArray(value) || isArguments$1(value))) {
if (shallow) {

@@ -146,3 +177,3 @@ let j = 0;

} else {
flatten(value, shallow, strict, output);
flatten$2(value, shallow, strict, output);
idx = output.length;

@@ -158,7 +189,11 @@ }

var flatten_1 = (array, shallow) => flatten(array, shallow, false);
var flatten_1 = (array, shallow) => flatten$2(array, shallow, false);
var map = (obj, iteratee, context) => {
iteratee = cb(iteratee, context);
const keys = !isArrayLike(obj) && getKeys(obj);
const getKeys$1 = getKeys$4;
const isArrayLike$1 = isArrayLike$4;
const cb$2 = cb$3;
var map$2 = (obj, iteratee, context) => {
iteratee = cb$2(iteratee, context);
const keys = !isArrayLike$1(obj) && getKeys$1(obj);
const { length } = keys || obj;

@@ -176,28 +211,46 @@ const results = Array(length);

const shallowProperty = shallowProperty$3;
const getLength$1 = getLength$3;
const isArrayLike = isArrayLike$4;
const isFunction$1 = isFunction$3;
const isObject$1 = isObject$4;
const isArguments = isArguments$2;
const identity$1 = identity$3;
const getKeys = getKeys$4;
const property$2 = property$4;
const matcher$1 = matcher$3;
const isMatch = isMatch$2;
const optimizeCb$1 = optimizeCb$4;
const cb$1 = cb$3;
const forEach$1 = forEach$3;
const flatten$1 = flatten_1;
const map$1 = map$2;
var lib = {
shallowProperty,
getLength,
getLength: getLength$1,
isArrayLike,
isFunction,
isObject,
isArguments,
identity,
getKeys,
property,
matcher,
isMatch,
optimizeCb,
cb,
forEach,
map,
flatten: flatten_1
};
const {
getLength: getLength$1,
isFunction: isFunction$1,
isObject: isObject$1,
isArguments,
identity: identity$1,
property: property$1,
getKeys,
property: property$2,
matcher: matcher$1,
isMatch,
optimizeCb: optimizeCb$1,

@@ -208,2 +261,16 @@ cb: cb$1,

flatten: flatten$1
};
const {
getLength,
isFunction,
isObject,
identity,
property: property$1,
matcher,
optimizeCb,
cb,
forEach,
map,
flatten
} = lib;

@@ -220,3 +287,3 @@

const allKeys = obj => {
if (!isObject$1(obj)) return [];
if (!isObject(obj)) return [];
const keys = [];

@@ -230,25 +297,25 @@

var packageUtils = {
getLength: getLength$1,
optimizeCb: optimizeCb$1,
isFunction: isFunction$1,
getLength,
optimizeCb,
isFunction,
isNumber,
isUndefined,
property: property$1,
matcher: matcher$1,
identity: identity$1,
matcher,
identity,
constant,
keyInObj,
allKeys,
cb: cb$1,
forEach: forEach$1,
map: map$1,
flatten: flatten$1
cb,
forEach,
map,
flatten
};
const { property: property$2 } = packageUtils;
const { property } = packageUtils;
var pluckUtil = (obj, key) => obj.map(property$2(key));
var pluckUtil = (obj, key) => obj.map(property(key));
return pluckUtil;
})));
}));