New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

enmap

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enmap - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

package.json
{
"name": "enmap",
"version": "0.5.0",
"version": "0.6.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -68,2 +68,24 @@ /**

/**
* Modify the property of a value inside the enmap, assuming this value is an object.
* This is a shortcut to loading the key, changing the value, and setting it back.
* @param {*} key Required. The key of the element to add to the EnMap object.
* If the EnMap is persistent this value MUST be a string or number.
* @param {*} prop Required. The property to modify inside the value object.
* @param {*} val Required. The value to apply to the specified property.
* @param {boolean} save Optional. Whether to save to persistent DB (used as false in init)
* @return {Map} The EnMap object.
*/
setProp(key, prop, val, save = true) {
const data = super.get(key);
if (typeof data !== 'object') {
throw 'Method can only be used when the value is an object';
}
data[prop] = val;
if (this.persistent && save) {
this.db.set(key, data);
}
return super.set(key, data);
}
/**
*

@@ -70,0 +92,0 @@ * @param {*} key Required. The key of the element to add to the EnMap object.

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