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.33.0 to 0.34.0

docs/arrays/fromPairs.md

20

dist/absurdum.cjs.js

@@ -346,2 +346,21 @@ 'use strict';

/**
* FromPairs takes an array of arrays with key-value pairs and returns an
* object composed from key-value pairs.
*
* @param {Array} array input key-value pairs in an array of arrays
* @returns {object} object filtered to only include elemnts with a key from the filter
*
* @example
* const result = objects.fromPairs([['age', 12034], ['name', 'Trair'],['state', 'Floating']]);
* console.log(result);
* > { age: 12034, name: 'Trair', state: 'Floating' }
*/
function fromPairs (array) {
return array.reduce((acc, curr) => {
acc[curr[0]] = curr[1];
return acc;
}, {});
}
/**
* IndexOf method returns the first index at which a given element can be found in the array

@@ -581,2 +600,3 @@ * beyond the starting index, or -1 if it is not present.

flat: flat,
fromPairs: fromPairs,
indexOf: indexOf,

@@ -583,0 +603,0 @@ map: map,

@@ -342,2 +342,21 @@ /**

/**
* FromPairs takes an array of arrays with key-value pairs and returns an
* object composed from key-value pairs.
*
* @param {Array} array input key-value pairs in an array of arrays
* @returns {object} object filtered to only include elemnts with a key from the filter
*
* @example
* const result = objects.fromPairs([['age', 12034], ['name', 'Trair'],['state', 'Floating']]);
* console.log(result);
* > { age: 12034, name: 'Trair', state: 'Floating' }
*/
function fromPairs (array) {
return array.reduce((acc, curr) => {
acc[curr[0]] = curr[1];
return acc;
}, {});
}
/**
* IndexOf method returns the first index at which a given element can be found in the array

@@ -577,2 +596,3 @@ * beyond the starting index, or -1 if it is not present.

flat: flat,
fromPairs: fromPairs,
indexOf: indexOf,

@@ -579,0 +599,0 @@ map: map,

2

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

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

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

- [flat][arrays.flat]
- [fromPairs][arrays.fromPairs]
- [indexOf][arrays.indexOf]

@@ -86,2 +87,3 @@ - [map][arrays.map]

[arrays.flat]: ./docs/arrays/flat.md
[arrays.fromPairs]: ./docs/arrays/fromPairs.md
[arrays.indexOf]: ./docs/arrays/indexOf.md

@@ -88,0 +90,0 @@ [arrays.map]: ./docs/arrays/map.md

@@ -14,2 +14,3 @@ export { chunk } from "./chunk.js";

export { flat } from "./flat.js";
export { fromPairs } from "./fromPairs.js";
export { indexOf } from "./indexOf.js";

@@ -16,0 +17,0 @@ export { map } from "./map.js";

@@ -14,2 +14,3 @@ export { chunk } from './chunk.js';

export { flat } from './flat.js';
export { fromPairs } from './fromPairs.js';
export { indexOf } from './indexOf.js';

@@ -16,0 +17,0 @@ export { map } from './map.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