@better-auth/memory-adapter 1.6.10 → 1.6.11
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.mjs +11 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -110,7 +110,10 @@ const memoryAdapter = (db, config) => {
|
|
|
110
110
|
case "gte": return value != null && Boolean(record[field] >= value);
|
|
111
111
|
case "lt": return value != null && Boolean(record[field] < value);
|
|
112
112
|
case "lte": return value != null && Boolean(record[field] <= value);
|
|
113
|
-
default:
|
|
113
|
+
default:
|
|
114
|
+
if (isInsensitive) return insensitiveCompare(record[field], value);
|
|
115
|
+
if (value === null) return record[field] == null;
|
|
116
|
+
return record[field] === value;
|
|
114
117
|
}
|
|
115
118
|
};
|
|
116
119
|
let records = table.filter((record) => {
|
|
@@ -234,6 +237,13 @@ const memoryAdapter = (db, config) => {
|
|
|
234
237
|
});
|
|
235
238
|
return count;
|
|
236
239
|
},
|
|
240
|
+
consumeOne: async ({ model, where }) => {
|
|
241
|
+
const table = db[model];
|
|
242
|
+
const target = convertWhereClause(where, model)[0];
|
|
243
|
+
if (!target) return null;
|
|
244
|
+
db[model] = table.filter((record) => record !== target);
|
|
245
|
+
return target;
|
|
246
|
+
},
|
|
237
247
|
updateMany({ model, where, update }) {
|
|
238
248
|
const res = convertWhereClause(where, model);
|
|
239
249
|
res.forEach((record) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/memory-adapter",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.11",
|
|
4
4
|
"description": "Memory adapter for Better Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@better-auth/utils": "0.4.0",
|
|
39
|
-
"@better-auth/core": "^1.6.
|
|
39
|
+
"@better-auth/core": "^1.6.11"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@better-auth/utils": "0.4.0",
|
|
43
43
|
"tsdown": "0.21.1",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
|
-
"@better-auth/core": "1.6.
|
|
45
|
+
"@better-auth/core": "1.6.11"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsdown",
|