UNPKG

coders.db

Version:

A better sqlite3 system that is easy to install and easy to use, easy to config, non-locking. Made in coders code (https://discord.gg/cxJbCaqBPu)

15 lines (14 loc) 576 B
this.unpush = function(key, value, ops) { this.messages = this.lang ? require(`../language/${this.lang.toLowerCase()}.json`) : require(`../language/en.json`); if (!key) throw new TypeError(this.messages["errors"].dontKey); if (!value && value != 0) throw new TypeError(this.messages["errors"].dontUnPushValue); var emptyArray = []; var newArray = []; if(this.has(key)) { emptyArray = this.get(key); } emptyArray = emptyArray.filter((XXXX) => XXXX !== value); newArray = emptyArray this.set(key, newArray); return this.get(key); };