Comparing version 5.2.1 to 5.2.2
{ | ||
"name": "enmap", | ||
"version": "5.2.1", | ||
"version": "5.2.2", | ||
"description": "A simple database wrapper to make sqlite database interactions much easier for beginners, with additional array helper methods.", | ||
@@ -5,0 +5,0 @@ "types": "index.d.ts", |
@@ -408,4 +408,4 @@ // Lodash should probably be a core lib but hey, it's useful! | ||
this[_fetchCheck](key); | ||
const data = this.get(key); | ||
this[_check](key, 'Array', path); | ||
const data = super.get(key); | ||
if (!isNil(path)) { | ||
@@ -573,3 +573,3 @@ const propValue = _get(data, path); | ||
if (this.ensureProps) this.ensure(key, {}); | ||
if (!super.has(key)) throw new Err(`Key "${key}" does not exist in "${this.name}" to ensure a property`, 'EnmapKeyError'); | ||
if (!this.has(key)) throw new Err(`Key "${key}" does not exist in "${this.name}" to ensure a property`, 'EnmapKeyError'); | ||
if (this.hasProp(key, path)) return this.getProp(key, path); | ||
@@ -579,10 +579,10 @@ this.set(key, defaultValue, path); | ||
} | ||
if (this.ensureProps && isObject(super.get(key))) { | ||
if (this.ensureProps && isObject(this.get(key))) { | ||
if (!isObject(clonedValue)) throw new Err(`Default value for "${key}" in enmap "${this.name}" must be an object when merging with an object value.`, 'EnmapArgumentError'); | ||
// const merged = Object.assign(clonedValue, super.get(key)); | ||
const merged = merge(clonedValue, super.get(key)); | ||
const merged = merge(clonedValue, this.get(key)); | ||
super.set(key, merged); | ||
return merged; | ||
} | ||
if (super.has(key)) return super.get(key); | ||
if (this.has(key)) return this.get(key); | ||
this.set(key, clonedValue); | ||
@@ -613,3 +613,3 @@ return clonedValue; | ||
this[_check](key, 'Object'); | ||
const data = super.get(key); | ||
const data = this.get(key); | ||
return _has(data, path); | ||
@@ -647,3 +647,3 @@ } | ||
this[_check](key, ['Array', 'Object']); | ||
const data = super.get(key); | ||
const data = this.get(key); | ||
if (!isNil(path)) { | ||
@@ -650,0 +650,0 @@ const propValue = _get(data, path); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161192