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

enmap

Package Overview
Dependencies
Maintainers
1
Versions
172
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 2.6.3 to 2.7.0

2

package.json
{
"name": "enmap",
"version": "2.6.3",
"version": "2.7.0",
"description": "",

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

@@ -193,3 +193,3 @@ const dotProp = require('dot-prop');

if (!this.has(key)) {
throw 'This key does not exist';
throw `The key ${key} does not exist in the enmap ${this.name}`;
}

@@ -214,3 +214,3 @@ const data = super.get(key);

if (!this.has(key)) {
throw 'This key does not exist';
throw `The key ${key} does not exist in the enmap ${this.name}`;
}

@@ -238,3 +238,3 @@ const data = super.get(key);

if (!this.has(key)) {
throw 'This key does not exist';
throw `The key ${key} does not exist in the enmap ${this.name}`;
}

@@ -255,2 +255,38 @@ const data = super.get(key);

_mathop(base, op, opand) {
if (!base || !op || !opand) throw `Math Operation requires base, operation, and right operand`;
switch (op) {
case 'add' :
case 'addition' :
case '+' :
return base + opand;
case 'sub' :
case 'subtract' :
case '-' :
return base - opand;
case 'mult' :
case 'multiply' :
case '*' :
return base * opand;
case 'div' :
case 'divide' :
case '/' :
return base / opand;
case 'exp' :
return Math.pow(base, opand);
case 'mod' :
case 'modulo' :
case '%' :
return base % opand;
}
return null;
}
math(key, operation, operand = null) {
if (!this.has(key)) {
throw `The key ${key} does not exist in the enmap ${this.name}`;
}
return this.set(key, this._mathop(this.get(key), operation, operand));
}
/* METHODS THAT GETS THINGS FROM ENMAP */

@@ -257,0 +293,0 @@

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