@ztimson/utils 0.26.6 → 0.26.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -483,7 +483,9 @@ ${opts.message || this.desc}`;
|
|
|
483
483
|
if (((_a = persists.storage) == null ? void 0 : _a.database) != void 0) {
|
|
484
484
|
persists.storage.createTable({ name: persists.key, key: this.key }).then((table) => {
|
|
485
485
|
if (key) {
|
|
486
|
-
|
|
486
|
+
const value = this.get(key);
|
|
487
|
+
if (value != null) table.set(value, key);
|
|
488
|
+
else table.delete(key);
|
|
487
489
|
} else {
|
|
488
490
|
table.clear();
|
|
489
491
|
this.all().forEach((row) => table.add(row));
|
|
@@ -2045,6 +2047,10 @@ ${opts.message || this.desc}`;
|
|
|
2045
2047
|
return a == b;
|
|
2046
2048
|
case "!=":
|
|
2047
2049
|
return a != b;
|
|
2050
|
+
case "+":
|
|
2051
|
+
return a.includes(b);
|
|
2052
|
+
case "-":
|
|
2053
|
+
return !a.includes(b);
|
|
2048
2054
|
case ">":
|
|
2049
2055
|
return a > b;
|
|
2050
2056
|
case ">=":
|
|
@@ -2061,7 +2067,7 @@ ${opts.message || this.desc}`;
|
|
|
2061
2067
|
return -1 != or.findIndex((p) => {
|
|
2062
2068
|
const and = p.split("&&").map((p2) => p2.trim()).filter((p2) => !!p2);
|
|
2063
2069
|
return and.filter((p2) => {
|
|
2064
|
-
const prop = /(\S+)\s*(
|
|
2070
|
+
const prop = /(\S+)\s*(==?|!=|\+|-|>=|>|<=|<)\s*(\S+)/g.exec(p2);
|
|
2065
2071
|
if (prop) {
|
|
2066
2072
|
const key = Object.keys(target).find((k) => k.toLowerCase() == prop[1].toLowerCase());
|
|
2067
2073
|
return evalBoolean(dotNotation(target, key || prop[1]), prop[2], JSONAttemptParse(prop[3]));
|