Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

absurdum

Package Overview
Dependencies
Maintainers
1
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absurdum - npm Package Compare versions

Comparing version 0.49.0 to 0.50.0

docs/objects/pick.md

31

dist/absurdum.esm.js

@@ -1235,4 +1235,32 @@ /**

/**
* Pick returns a new object composed from the selected object properties.
*
* @param {object} object input object
* @param {...(string|string[])} paths paths names of properties to be returned from an object
* @returns {object} object with selected properties
*
* @example
* const result = Objects.pick({ a: 'mixed', b34: 'toast', 45: 'pasta' }, 'a', 45);
* console.log(result);
* > { 45: 'pasta', a: 'mixed' }
*/
function pick (object, ...paths) {
if (paths.length === 0) { return {}; }
const args = new Set();
if (Array.isArray(paths[0])) {
paths[0].forEach(val => args.add(String(val)));
} else {
paths.forEach(val => args.add(String(val)));
}
return Object.keys(object).reduce((acc, curr) => {
if (args.has(curr)) { acc[curr] = object[curr]; }
return acc;
}, {});
}
var index$2 = /*#__PURE__*/Object.freeze({

@@ -1243,5 +1271,6 @@ __proto__: null,

invert: invert,
keys: keys
keys: keys,
pick: pick
});
export { index as arrays, index$2 as objects, index$1 as strings };

2

package.json
{
"name": "absurdum",
"version": "0.49.0",
"version": "0.50.0",
"description": "Reductio Ad Absurdum - The Ridiculous Application of Reduce",

@@ -5,0 +5,0 @@ "keywords": [

@@ -121,2 +121,3 @@ [![GitHub Releases](https://img.shields.io/github/release/vanillaes/absurdum.svg)](https://github.com/vanillaes/absurdum/releases)

- [keys][objects.keys]
- [pick][objects.pick]

@@ -127,2 +128,3 @@ [objects.exclude]: ./docs/objects/exclude.md

[objects.keys]: ./docs/objects/keys.md
[objects.pick]: ./docs/objects/pick.md

@@ -129,0 +131,0 @@ ### Strings

export { exclude } from "./exclude.js";
export { include } from "./include.js";
export { invert } from "./invert.js";
export { keys } from "./keys.js";
export { keys } from "./keys.js";
export { pick} from "./pick.js";
export { exclude } from './exclude.js';
export { include } from './include.js';
export { invert } from './invert.js';
export { keys } from './keys.js';
export { keys } from './keys.js';
export { pick } from './pick.js';

Sorry, the diff of this file is not supported yet

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