@riotjs/util
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -76,1 +76,13 @@ import { isObject } from './checks.js' | ||
} | ||
/** | ||
* Generate a new object picking only the properties from a given array | ||
* @param {Object} source - target object | ||
* @param {Array} keys - list of keys that we want to copy over to the new object | ||
* @return {Object} a new object conaining only the keys that we have picked from the keys array list | ||
*/ | ||
export function pick(source, keys) { | ||
return isObject(source) | ||
? Object.fromEntries(keys.map((key) => [key, source[key]])) | ||
: source | ||
} |
{ | ||
"name": "@riotjs/util", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Riot.js util functions", | ||
@@ -5,0 +5,0 @@ "main": "index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32691
866