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.7.0 to 2.7.1

2

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

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

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

setAsync(key, val) {
if (val == null) throw `Value provided for ${key} was null or undefined. Please provide a value.`;
if (val == null) throw `Value provided for ${key} was null or undefined in ${this.db.name}. Please provide a value.`;
let insert = val;

@@ -194,3 +194,3 @@ if (val.constructor.name === 'Object') {

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

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

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

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

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

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

_mathop(base, op, opand) {
if (!base || !op || !opand) throw `Math Operation requires base, operation, and right operand`;
if (!base || !op) throw 'Math Operation requires base and operation';
switch (op) {

@@ -277,2 +277,4 @@ case 'add' :

case 'exp' :
case 'exponent' :
case '^' :
return Math.pow(base, opand);

@@ -289,4 +291,7 @@ case 'mod' :

if (!this.has(key)) {
throw `The key ${key} does not exist in the enmap ${this.name}`;
throw `The key ${key} does not exist in the enmap ${this.db.name}`;
}
if (operation === 'random' || operation === 'rand') {
return Math.random() * operand;
}
return this.set(key, this._mathop(this.get(key), operation, operand));

@@ -331,3 +336,3 @@ }

} else {
throw 'This key does not exist';
throw `The key ${key} does not exist in the enmap ${this.db.name}`;
}

@@ -382,3 +387,3 @@ } else {

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

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

return this.fetch(key).then(data => {
if (!data) throw 'This key does not exist';
if (!data) throw `The key ${key} does not exist in the enmap ${this.db.name}`;
if (data.constructor.name !== 'Object') {

@@ -482,3 +487,3 @@ throw 'The value of this key is not an object.';

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

@@ -510,3 +515,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.db.name}`;
}

@@ -542,3 +547,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.db.name}`;
}

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

return this.fetch(key).then(data => {
if (!data) throw 'This key does not exist';
if (!data) throw `The key ${key} does not exist in the enmap ${this.db.name}`;
if (typeof data !== 'object') {

@@ -556,0 +561,0 @@ throw 'The value of this key is not an 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