utilitas 2001.1.106 → 2001.1.107

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/lib/manifest.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "2001.1.106",
4
+ "version": "2001.1.107",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/memory.mjs CHANGED
@@ -87,8 +87,15 @@ const get = async (key, options) => {
87
87
 
88
88
  const del = async (key, options) => {
89
89
  options = { ...options || {}, ...defaultKey };
90
- return await ((key = assertKey(key, { ignoreError: options?.force }))
91
- ? deleteById(table, key, options) : deleteAll(table, options));
90
+ let result;
91
+ if ((key = assertKey(key, { ignoreError: options?.force })) && !options?.asPrefix) {
92
+ result = deleteById(table, key, options);
93
+ } else if (key && options?.asPrefix) {
94
+ result = deleteById(table, { 'LIKE': `${key}/%` }, options);
95
+ } else {
96
+ result = deleteAll(table, options);
97
+ }
98
+ return await result;
92
99
  };
93
100
 
94
101
  export { del, get, init, set };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "2001.1.106",
4
+ "version": "2001.1.107",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",