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

just-map-values

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-map-values - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

7

index.js

@@ -5,5 +5,6 @@ module.exports = map;

// returns a new object with the predicate applied to each value
// like just-map-object, but only the value argument is available
// like just-map-object, but (value, key, object) are passed to the predicate
map({a: 3, b: 5, c: 9}, (value) => value + 1); // {a: 4, b: 6, c: 10}
map({a: 3, b: null, c: undefined}, (value) => Boolean); // {a: 3, b: false, c: false}
map({a: 3, b: 5, c: 9}, (value, key) => value + key); // {a: 3a, b: 5b, c: 9c}
map({a: 3, b: 5, c: 9}, (value, key, object) => object.b); // {a: 5, b: 5, c: 5}
*/

@@ -17,5 +18,5 @@

var key = keys[i];
result[key] = predicate(obj[key]);
result[key] = predicate(obj[key], key, obj);
}
return result;
}
{
"name": "just-map-values",
"version": "1.0.0",
"description": "map an object, passing value to predicate",
"version": "1.0.1",
"description": "map an object, passing (value, key, object) to predicate",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -11,6 +11,7 @@ ## just-map-object

// map an object, passing the value to the predicate
// like just-map-object, but only the value argument is available
map({a: 3, b: 5, c: 9}, (value) => value + 1); // {a: 4, b: 6, c: 10}
map({a: 3, b: null, c: undefined}, (value) => Boolean); // {a: 3, b: false, c: false}
// map an object, applying the predicate to the value
// like just-map-object, but (value, key, object) is passed to the predicate
map({a: 3, b: 5, c: 9}, (value) => value + 1); // {a: 4, b: 6, c: 10}
map({a: 3, b: 5, c: 9}, (value, key) => value + key); // {a: 3a, b: 5b, c: 9c}
map({a: 3, b: 5, c: 9}, (value, key, object) => object.b); // {a: 5, b: 5, c: 5}
```
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