Comparing version 4.3.2 to 4.3.3
{ | ||
"name": "enmap", | ||
"version": "4.3.2", | ||
"version": "4.3.3", | ||
"description": "A simple database wrapper to make sqlite database interactions much easier for beginners, with additional array helper methods.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# Enmap - Enhanced Maps | ||
<div align="center"> | ||
<p> | ||
<a href="https://discord.gg/N7ZKH3P"><img src="https://discordapp.com/api/guilds/298508738623438848/embed.png" alt="Discord server" /></a> | ||
<a href="https://www.npmjs.com/package/enmap"><img src="https://img.shields.io/npm/v/enmap.svg?maxAge=3600" alt="NPM version" /></a> | ||
<a href="https://www.npmjs.com/package/enmap"><img src="https://img.shields.io/npm/dt/enmap.svg?maxAge=3600" alt="NPM downloads" /></a> | ||
<a href="https://david-dm.org/eslachance/enmap"><img src="https://img.shields.io/david/eslachance/enmap.svg?maxAge=3600" alt="Dependencies" /></a> | ||
<a href="https://www.patreon.com/eviecodes"><img src="https://img.shields.io/badge/donate-patreon-F96854.svg" alt="Patreon" /></a> | ||
</p> | ||
<p> | ||
<a href="https://nodei.co/npm/enmap/"><img src="https://nodei.co/npm/enmap.png?downloads=true&stars=true" alt="npm installnfo" /></a> | ||
</p> | ||
</div> | ||
Enhanced Maps are a data structure that can be used to store data in memory that can also be saved in a database behind the scenes. These operations are fast, safe, and painless. | ||
@@ -4,0 +17,0 @@ |
@@ -34,3 +34,3 @@ // Lodash should probably be a core lib but hey, it's useful! | ||
} | ||
super(iterable); | ||
super(); | ||
@@ -146,2 +146,12 @@ let cloneLevel; | ||
} | ||
if (iterable) { | ||
if (options.name) { | ||
console.log(`Iterable ignored for persistent Enmap ${options.name}`); | ||
} else { | ||
for (const [key, value] of iterable) { | ||
this.set(key, value); | ||
} | ||
} | ||
} | ||
} | ||
@@ -177,3 +187,3 @@ | ||
let data = super.get(key); | ||
const oldValue = super.has(key) ? data : null; | ||
const oldValue = super.has(key) ? this[_clone](data) : null; | ||
if (!_.isNil(path)) { | ||
@@ -1116,3 +1126,3 @@ if (_.isNil(data)) data = {}; | ||
if (thisArg) fn = fn.bind(thisArg); | ||
const results = new Enmap(); | ||
const results = new this.constructor(); | ||
for (const [key, val] of this) { | ||
@@ -1150,3 +1160,3 @@ if (fn(val, key, this)) results.set(key, val); | ||
if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg); | ||
const results = [new this.contructor(), new this.constructor()]; | ||
const results = [new this.constructor(), new this.constructor()]; | ||
for (const [key, val] of this) { | ||
@@ -1153,0 +1163,0 @@ if (fn(val, key, this)) { |
89550
1805
62