@geekmidas/testkit 10.0.0-alpha.4 → 10.0.0-alpha.41

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.
Files changed (295) hide show
  1. package/README.md +74 -0
  2. package/dist/Factory.cjs +51 -2
  3. package/dist/Factory.cjs.map +1 -0
  4. package/dist/Factory.d.cts +143 -3
  5. package/dist/Factory.d.cts.map +1 -0
  6. package/dist/Factory.d.mts +143 -3
  7. package/dist/Factory.d.mts.map +1 -0
  8. package/dist/Factory.mjs +50 -2
  9. package/dist/Factory.mjs.map +1 -0
  10. package/dist/KyselyFactory.cjs +237 -4
  11. package/dist/KyselyFactory.cjs.map +1 -0
  12. package/dist/KyselyFactory.d.cts +224 -4
  13. package/dist/KyselyFactory.d.cts.map +1 -0
  14. package/dist/KyselyFactory.d.mts +224 -4
  15. package/dist/KyselyFactory.d.mts.map +1 -0
  16. package/dist/KyselyFactory.mjs +236 -4
  17. package/dist/KyselyFactory.mjs.map +1 -0
  18. package/dist/ObjectionFactory.cjs +265 -4
  19. package/dist/ObjectionFactory.cjs.map +1 -0
  20. package/dist/ObjectionFactory.d.cts +237 -4
  21. package/dist/ObjectionFactory.d.cts.map +1 -0
  22. package/dist/ObjectionFactory.d.mts +237 -4
  23. package/dist/ObjectionFactory.d.mts.map +1 -0
  24. package/dist/ObjectionFactory.mjs +264 -4
  25. package/dist/ObjectionFactory.mjs.map +1 -0
  26. package/dist/PostgresKyselyMigrator.cjs +94 -3
  27. package/dist/PostgresKyselyMigrator.cjs.map +1 -0
  28. package/dist/PostgresKyselyMigrator.d.cts +80 -3
  29. package/dist/PostgresKyselyMigrator.d.cts.map +1 -0
  30. package/dist/PostgresKyselyMigrator.d.mts +80 -3
  31. package/dist/PostgresKyselyMigrator.d.mts.map +1 -0
  32. package/dist/PostgresKyselyMigrator.mjs +93 -3
  33. package/dist/PostgresKyselyMigrator.mjs.map +1 -0
  34. package/dist/{PostgresMigrator-C_QQ6q35.d.mts → PostgresMigrator-CDPnnwMJ.d.cts} +11 -5
  35. package/dist/PostgresMigrator-CDPnnwMJ.d.cts.map +1 -0
  36. package/dist/{PostgresMigrator-CeYy-eHF.d.cts → PostgresMigrator-CDPnnwMJ.d.mts} +11 -5
  37. package/dist/PostgresMigrator-CDPnnwMJ.d.mts.map +1 -0
  38. package/dist/PostgresMigrator.cjs +178 -2
  39. package/dist/PostgresMigrator.cjs.map +1 -0
  40. package/dist/PostgresMigrator.d.cts +1 -1
  41. package/dist/PostgresMigrator.d.mts +1 -1
  42. package/dist/PostgresMigrator.mjs +175 -2
  43. package/dist/PostgresMigrator.mjs.map +1 -0
  44. package/dist/PostgresObjectionMigrator.cjs +118 -3
  45. package/dist/PostgresObjectionMigrator.cjs.map +1 -0
  46. package/dist/PostgresObjectionMigrator.d.cts +75 -3
  47. package/dist/PostgresObjectionMigrator.d.cts.map +1 -0
  48. package/dist/PostgresObjectionMigrator.d.mts +75 -3
  49. package/dist/PostgresObjectionMigrator.d.mts.map +1 -0
  50. package/dist/PostgresObjectionMigrator.mjs +117 -3
  51. package/dist/PostgresObjectionMigrator.mjs.map +1 -0
  52. package/dist/VitestKyselyTransactionIsolator.cjs +66 -3
  53. package/dist/VitestKyselyTransactionIsolator.cjs.map +1 -0
  54. package/dist/VitestKyselyTransactionIsolator.d.cts +60 -3
  55. package/dist/VitestKyselyTransactionIsolator.d.cts.map +1 -0
  56. package/dist/VitestKyselyTransactionIsolator.d.mts +60 -3
  57. package/dist/VitestKyselyTransactionIsolator.d.mts.map +1 -0
  58. package/dist/VitestKyselyTransactionIsolator.mjs +65 -3
  59. package/dist/VitestKyselyTransactionIsolator.mjs.map +1 -0
  60. package/dist/VitestObjectionTransactionIsolator.cjs +62 -3
  61. package/dist/VitestObjectionTransactionIsolator.cjs.map +1 -0
  62. package/dist/VitestObjectionTransactionIsolator.d.cts +56 -3
  63. package/dist/VitestObjectionTransactionIsolator.d.cts.map +1 -0
  64. package/dist/VitestObjectionTransactionIsolator.d.mts +56 -3
  65. package/dist/VitestObjectionTransactionIsolator.d.mts.map +1 -0
  66. package/dist/VitestObjectionTransactionIsolator.mjs +61 -3
  67. package/dist/VitestObjectionTransactionIsolator.mjs.map +1 -0
  68. package/dist/VitestTransactionIsolator.cjs +187 -4
  69. package/dist/VitestTransactionIsolator.cjs.map +1 -0
  70. package/dist/VitestTransactionIsolator.d.cts +219 -2
  71. package/dist/VitestTransactionIsolator.d.cts.map +1 -0
  72. package/dist/VitestTransactionIsolator.d.mts +219 -2
  73. package/dist/VitestTransactionIsolator.d.mts.map +1 -0
  74. package/dist/VitestTransactionIsolator.mjs +184 -2
  75. package/dist/VitestTransactionIsolator.mjs.map +1 -0
  76. package/dist/aws.cjs +3 -4
  77. package/dist/aws.cjs.map +1 -1
  78. package/dist/aws.d.cts +3 -8
  79. package/dist/aws.d.cts.map +1 -1
  80. package/dist/aws.d.mts +3 -8
  81. package/dist/aws.d.mts.map +1 -1
  82. package/dist/aws.mjs +1 -2
  83. package/dist/aws.mjs.map +1 -1
  84. package/dist/benchmark.cjs +2 -2
  85. package/dist/benchmark.cjs.map +1 -1
  86. package/dist/benchmark.d.cts +4 -6
  87. package/dist/benchmark.d.cts.map +1 -1
  88. package/dist/benchmark.d.mts +4 -6
  89. package/dist/benchmark.d.mts.map +1 -1
  90. package/dist/benchmark.mjs +1 -1
  91. package/dist/benchmark.mjs.map +1 -1
  92. package/dist/better-auth.cjs +17 -8
  93. package/dist/better-auth.cjs.map +1 -1
  94. package/dist/better-auth.d.cts +13142 -5
  95. package/dist/better-auth.d.cts.map +1 -1
  96. package/dist/better-auth.d.mts +13142 -5
  97. package/dist/better-auth.d.mts.map +1 -1
  98. package/dist/better-auth.mjs +15 -6
  99. package/dist/better-auth.mjs.map +1 -1
  100. package/dist/browser.cjs +127 -0
  101. package/dist/browser.cjs.map +1 -0
  102. package/dist/browser.d.cts +47 -0
  103. package/dist/browser.d.cts.map +1 -0
  104. package/dist/browser.d.mts +47 -0
  105. package/dist/browser.d.mts.map +1 -0
  106. package/dist/browser.mjs +125 -0
  107. package/dist/browser.mjs.map +1 -0
  108. package/dist/context.cjs +80 -0
  109. package/dist/context.cjs.map +1 -0
  110. package/dist/context.d.cts +55 -0
  111. package/dist/context.d.cts.map +1 -0
  112. package/dist/context.d.mts +55 -0
  113. package/dist/context.d.mts.map +1 -0
  114. package/dist/context.mjs +73 -0
  115. package/dist/context.mjs.map +1 -0
  116. package/dist/faker.cjs +313 -8
  117. package/dist/faker.cjs.map +1 -0
  118. package/dist/faker.d.cts +169 -2
  119. package/dist/faker.d.cts.map +1 -0
  120. package/dist/faker.d.mts +169 -2
  121. package/dist/faker.d.mts.map +1 -0
  122. package/dist/faker.mjs +305 -2
  123. package/dist/faker.mjs.map +1 -0
  124. package/dist/helpers.cjs +6 -5
  125. package/dist/helpers.cjs.map +1 -1
  126. package/dist/helpers.d.cts +1 -5
  127. package/dist/helpers.d.cts.map +1 -1
  128. package/dist/helpers.d.mts +1 -5
  129. package/dist/helpers.d.mts.map +1 -1
  130. package/dist/helpers.mjs +1 -2
  131. package/dist/helpers.mjs.map +1 -1
  132. package/dist/initScript.cjs +15 -15
  133. package/dist/initScript.cjs.map +1 -1
  134. package/dist/initScript.d.cts +2 -4
  135. package/dist/initScript.d.cts.map +1 -1
  136. package/dist/initScript.d.mts +2 -4
  137. package/dist/initScript.d.mts.map +1 -1
  138. package/dist/initScript.mjs +10 -12
  139. package/dist/initScript.mjs.map +1 -1
  140. package/dist/kysely.cjs +10 -13
  141. package/dist/kysely.cjs.map +1 -1
  142. package/dist/kysely.d.cts +10 -14
  143. package/dist/kysely.d.cts.map +1 -1
  144. package/dist/kysely.d.mts +10 -14
  145. package/dist/kysely.d.mts.map +1 -1
  146. package/dist/kysely.mjs +10 -14
  147. package/dist/kysely.mjs.map +1 -1
  148. package/dist/logger.cjs +3 -4
  149. package/dist/logger.cjs.map +1 -1
  150. package/dist/logger.d.cts +1 -5
  151. package/dist/logger.d.cts.map +1 -1
  152. package/dist/logger.d.mts +1 -5
  153. package/dist/logger.d.mts.map +1 -1
  154. package/dist/logger.mjs +1 -2
  155. package/dist/logger.mjs.map +1 -1
  156. package/dist/mailbox.cjs +95 -0
  157. package/dist/mailbox.cjs.map +1 -0
  158. package/dist/mailbox.d.cts +58 -0
  159. package/dist/mailbox.d.cts.map +1 -0
  160. package/dist/mailbox.d.mts +58 -0
  161. package/dist/mailbox.d.mts.map +1 -0
  162. package/dist/mailbox.mjs +92 -0
  163. package/dist/mailbox.mjs.map +1 -0
  164. package/dist/objection.cjs +10 -13
  165. package/dist/objection.cjs.map +1 -1
  166. package/dist/objection.d.cts +10 -14
  167. package/dist/objection.d.cts.map +1 -1
  168. package/dist/objection.d.mts +10 -14
  169. package/dist/objection.d.mts.map +1 -1
  170. package/dist/objection.mjs +10 -14
  171. package/dist/objection.mjs.map +1 -1
  172. package/dist/os/directory.cjs +31 -2
  173. package/dist/os/directory.cjs.map +1 -0
  174. package/dist/os/directory.d.cts +9 -2
  175. package/dist/os/directory.d.cts.map +1 -0
  176. package/dist/os/directory.d.mts +9 -2
  177. package/dist/os/directory.d.mts.map +1 -0
  178. package/dist/os/directory.mjs +25 -2
  179. package/dist/os/directory.mjs.map +1 -0
  180. package/dist/os/index.cjs +3 -3
  181. package/dist/os/index.d.cts +1 -1
  182. package/dist/os/index.d.mts +1 -1
  183. package/dist/os/index.mjs +2 -3
  184. package/dist/requestContext.cjs +10 -11
  185. package/dist/requestContext.cjs.map +1 -1
  186. package/dist/requestContext.d.cts +4 -8
  187. package/dist/requestContext.d.cts.map +1 -1
  188. package/dist/requestContext.d.mts +4 -8
  189. package/dist/requestContext.d.mts.map +1 -1
  190. package/dist/requestContext.mjs +1 -2
  191. package/dist/requestContext.mjs.map +1 -1
  192. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-VH7oDXx4.cjs} +8 -10
  193. package/dist/timer.cjs +2 -2
  194. package/dist/timer.cjs.map +1 -1
  195. package/dist/timer.d.cts +1 -4
  196. package/dist/timer.d.cts.map +1 -1
  197. package/dist/timer.d.mts +1 -4
  198. package/dist/timer.d.mts.map +1 -1
  199. package/dist/timer.mjs +1 -1
  200. package/dist/timer.mjs.map +1 -1
  201. package/dist/transactions.cjs +123 -0
  202. package/dist/transactions.cjs.map +1 -0
  203. package/dist/transactions.d.cts +44 -0
  204. package/dist/transactions.d.cts.map +1 -0
  205. package/dist/transactions.d.mts +44 -0
  206. package/dist/transactions.d.mts.map +1 -0
  207. package/dist/transactions.mjs +118 -0
  208. package/dist/transactions.mjs.map +1 -0
  209. package/package.json +51 -8
  210. package/dist/Factory-AWn1IulI.d.cts +0 -147
  211. package/dist/Factory-AWn1IulI.d.cts.map +0 -1
  212. package/dist/Factory-BFVnMMCC.mjs +0 -51
  213. package/dist/Factory-BFVnMMCC.mjs.map +0 -1
  214. package/dist/Factory-BhjUOBWN.cjs +0 -57
  215. package/dist/Factory-BhjUOBWN.cjs.map +0 -1
  216. package/dist/Factory-C15SSK8_.d.mts +0 -147
  217. package/dist/Factory-C15SSK8_.d.mts.map +0 -1
  218. package/dist/KyselyFactory-BFqVIn_0.cjs +0 -246
  219. package/dist/KyselyFactory-BFqVIn_0.cjs.map +0 -1
  220. package/dist/KyselyFactory-C9Snz24z.d.mts +0 -228
  221. package/dist/KyselyFactory-C9Snz24z.d.mts.map +0 -1
  222. package/dist/KyselyFactory-CxUJCi--.d.cts +0 -228
  223. package/dist/KyselyFactory-CxUJCi--.d.cts.map +0 -1
  224. package/dist/KyselyFactory-DMswpwji.mjs +0 -241
  225. package/dist/KyselyFactory-DMswpwji.mjs.map +0 -1
  226. package/dist/ObjectionFactory-BeFBYcan.cjs +0 -272
  227. package/dist/ObjectionFactory-BeFBYcan.cjs.map +0 -1
  228. package/dist/ObjectionFactory-CYvaa0kU.d.cts +0 -241
  229. package/dist/ObjectionFactory-CYvaa0kU.d.cts.map +0 -1
  230. package/dist/ObjectionFactory-Cf2WI4o_.d.mts +0 -241
  231. package/dist/ObjectionFactory-Cf2WI4o_.d.mts.map +0 -1
  232. package/dist/ObjectionFactory-QCJ7u0Ql.mjs +0 -267
  233. package/dist/ObjectionFactory-QCJ7u0Ql.mjs.map +0 -1
  234. package/dist/PostgresKyselyMigrator-B2M6Gjvv.d.cts +0 -84
  235. package/dist/PostgresKyselyMigrator-B2M6Gjvv.d.cts.map +0 -1
  236. package/dist/PostgresKyselyMigrator-BGBxjnFv.cjs +0 -101
  237. package/dist/PostgresKyselyMigrator-BGBxjnFv.cjs.map +0 -1
  238. package/dist/PostgresKyselyMigrator-CvwXycJE.d.mts +0 -84
  239. package/dist/PostgresKyselyMigrator-CvwXycJE.d.mts.map +0 -1
  240. package/dist/PostgresKyselyMigrator-PI0QhvB1.mjs +0 -95
  241. package/dist/PostgresKyselyMigrator-PI0QhvB1.mjs.map +0 -1
  242. package/dist/PostgresMigrator-C_QQ6q35.d.mts.map +0 -1
  243. package/dist/PostgresMigrator-CeYy-eHF.d.cts.map +0 -1
  244. package/dist/PostgresMigrator-DVAY04qN.mjs +0 -166
  245. package/dist/PostgresMigrator-DVAY04qN.mjs.map +0 -1
  246. package/dist/PostgresMigrator-M9jpzOvN.cjs +0 -172
  247. package/dist/PostgresMigrator-M9jpzOvN.cjs.map +0 -1
  248. package/dist/PostgresObjectionMigrator-1j6YIB1c.d.mts +0 -79
  249. package/dist/PostgresObjectionMigrator-1j6YIB1c.d.mts.map +0 -1
  250. package/dist/PostgresObjectionMigrator-DHVC9h_P.d.cts +0 -79
  251. package/dist/PostgresObjectionMigrator-DHVC9h_P.d.cts.map +0 -1
  252. package/dist/PostgresObjectionMigrator-DSaPhwjY.cjs +0 -123
  253. package/dist/PostgresObjectionMigrator-DSaPhwjY.cjs.map +0 -1
  254. package/dist/PostgresObjectionMigrator-DjPKdUbm.mjs +0 -118
  255. package/dist/PostgresObjectionMigrator-DjPKdUbm.mjs.map +0 -1
  256. package/dist/VitestKyselyTransactionIsolator-1Saieke7.mjs +0 -67
  257. package/dist/VitestKyselyTransactionIsolator-1Saieke7.mjs.map +0 -1
  258. package/dist/VitestKyselyTransactionIsolator-BjJSXryR.cjs +0 -72
  259. package/dist/VitestKyselyTransactionIsolator-BjJSXryR.cjs.map +0 -1
  260. package/dist/VitestKyselyTransactionIsolator-CwlTo6yf.d.mts +0 -64
  261. package/dist/VitestKyselyTransactionIsolator-CwlTo6yf.d.mts.map +0 -1
  262. package/dist/VitestKyselyTransactionIsolator-DJasVuIZ.d.cts +0 -64
  263. package/dist/VitestKyselyTransactionIsolator-DJasVuIZ.d.cts.map +0 -1
  264. package/dist/VitestObjectionTransactionIsolator-B_VSWFum.mjs +0 -63
  265. package/dist/VitestObjectionTransactionIsolator-B_VSWFum.mjs.map +0 -1
  266. package/dist/VitestObjectionTransactionIsolator-CTTjvTPO.d.cts +0 -60
  267. package/dist/VitestObjectionTransactionIsolator-CTTjvTPO.d.cts.map +0 -1
  268. package/dist/VitestObjectionTransactionIsolator-CyZG6nq4.d.mts +0 -60
  269. package/dist/VitestObjectionTransactionIsolator-CyZG6nq4.d.mts.map +0 -1
  270. package/dist/VitestObjectionTransactionIsolator-DDoJTu7e.cjs +0 -68
  271. package/dist/VitestObjectionTransactionIsolator-DDoJTu7e.cjs.map +0 -1
  272. package/dist/VitestTransactionIsolator-BLaw80cx.d.mts +0 -223
  273. package/dist/VitestTransactionIsolator-BLaw80cx.d.mts.map +0 -1
  274. package/dist/VitestTransactionIsolator-CvwPecpl.mjs +0 -188
  275. package/dist/VitestTransactionIsolator-CvwPecpl.mjs.map +0 -1
  276. package/dist/VitestTransactionIsolator-DyiX-QtK.cjs +0 -206
  277. package/dist/VitestTransactionIsolator-DyiX-QtK.cjs.map +0 -1
  278. package/dist/VitestTransactionIsolator-glcxyS_R.d.cts +0 -223
  279. package/dist/VitestTransactionIsolator-glcxyS_R.d.cts.map +0 -1
  280. package/dist/directory-BxjqmtCT.mjs +0 -27
  281. package/dist/directory-BxjqmtCT.mjs.map +0 -1
  282. package/dist/directory-DD_xQoSh.cjs +0 -33
  283. package/dist/directory-DD_xQoSh.cjs.map +0 -1
  284. package/dist/directory-DiQ_DkaF.d.mts +0 -13
  285. package/dist/directory-DiQ_DkaF.d.mts.map +0 -1
  286. package/dist/directory-zIEh5ZPl.d.cts +0 -13
  287. package/dist/directory-zIEh5ZPl.d.cts.map +0 -1
  288. package/dist/faker-B14IEMIN.cjs +0 -304
  289. package/dist/faker-B14IEMIN.cjs.map +0 -1
  290. package/dist/faker-B6bmbGCM.d.mts +0 -166
  291. package/dist/faker-B6bmbGCM.d.mts.map +0 -1
  292. package/dist/faker-BGKYFoCT.mjs +0 -262
  293. package/dist/faker-BGKYFoCT.mjs.map +0 -1
  294. package/dist/faker-DvxiCtxc.d.cts +0 -166
  295. package/dist/faker-DvxiCtxc.d.cts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"better-auth.cjs","names":["initialData?: Record<string, any[]>","data: Map<string, any>","modelName: string","result: Record<string, any[]>","record: any","where?: Where[]","result: boolean | null","records: any[]","sortBy?: SortBy","config: MemoryAdapterConfig","toDelete: string[]"],"sources":["../src/better-auth.ts"],"sourcesContent":["import {\n\tcreateAdapterFactory,\n\ttype DBAdapterDebugLogOption,\n\ttype Where,\n} from 'better-auth/adapters';\n\ninterface MemoryAdapterConfig {\n\tdebugLogs?: DBAdapterDebugLogOption;\n\tusePlural?: boolean;\n\tinitialData?: Record<string, any[]>;\n}\n\nclass MemoryStore {\n\tconstructor(\n\t\tinitialData?: Record<string, any[]>,\n\t\tprivate readonly data: Map<string, any> = new Map(),\n\t) {\n\t\tif (initialData) {\n\t\t\tfor (const [model, records] of Object.entries(initialData)) {\n\t\t\t\tconst modelData = new Map();\n\t\t\t\tfor (const record of records) {\n\t\t\t\t\tmodelData.set(record.id, { ...record });\n\t\t\t\t}\n\t\t\t\tthis.data.set(model, modelData);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetModel(modelName: string): Map<string, any> {\n\t\tif (!this.data.has(modelName)) {\n\t\t\tthis.data.set(modelName, new Map());\n\t\t}\n\t\treturn this.data.get(modelName)!;\n\t}\n\n\tclear() {\n\t\tthis.data.clear();\n\t}\n\n\tgetAllData() {\n\t\tconst result: Record<string, any[]> = {};\n\t\tfor (const [model, records] of this.data.entries()) {\n\t\t\tresult[model] = Array.from(records.values());\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction matchesWhere(record: any, where?: Where[]): boolean {\n\tif (!where || where.length === 0) return true;\n\n\tlet result: boolean | null = null;\n\n\tfor (const condition of where) {\n\t\tconst { field, value, operator = 'eq', connector = 'AND' } = condition;\n\t\tconst recordValue = record[field];\n\n\t\tlet matches = false;\n\n\t\tswitch (operator) {\n\t\t\tcase 'eq':\n\t\t\t\tmatches = recordValue === value;\n\t\t\t\tbreak;\n\t\t\tcase 'ne':\n\t\t\t\tmatches = recordValue !== value;\n\t\t\t\tbreak;\n\t\t\tcase 'lt':\n\t\t\t\tmatches = value != null && recordValue < value;\n\t\t\t\tbreak;\n\t\t\tcase 'lte':\n\t\t\t\tmatches = value != null && recordValue <= value;\n\t\t\t\tbreak;\n\t\t\tcase 'gt':\n\t\t\t\tmatches = value != null && recordValue > value;\n\t\t\t\tbreak;\n\t\t\tcase 'gte':\n\t\t\t\tmatches = value != null && recordValue >= value;\n\t\t\t\tbreak;\n\t\t\tcase 'in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && (value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'not_in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && !(value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'contains':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.includes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'starts_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.startsWith(value);\n\t\t\t\tbreak;\n\t\t\tcase 'ends_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.endsWith(value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmatches = recordValue === value;\n\t\t}\n\n\t\t// Apply connector logic\n\t\tif (result === null) {\n\t\t\tresult = matches;\n\t\t} else if (connector === 'OR') {\n\t\t\tresult = result || matches;\n\t\t} else {\n\t\t\t// Default: AND\n\t\t\tresult = result && matches;\n\t\t}\n\t}\n\n\treturn result ?? true;\n}\ntype SortBy = {\n\tfield: string;\n\tdirection: 'asc' | 'desc';\n};\n\nfunction applySorting(records: any[], sortBy?: SortBy): any[] {\n\tif (!sortBy) return records;\n\n\tconst { field, direction } = sortBy;\n\n\treturn records.sort((a, b) => {\n\t\tconst aVal = a[field];\n\t\tconst bVal = b[field];\n\n\t\tif (aVal === bVal) return 0;\n\t\tif (aVal == null) return direction === 'asc' ? -1 : 1;\n\t\tif (bVal == null) return direction === 'asc' ? 1 : -1;\n\n\t\tconst comparison = aVal < bVal ? -1 : 1;\n\t\treturn direction === 'asc' ? comparison : -comparison;\n\t});\n}\n\nexport const memoryAdapter = (\n\tconfig: MemoryAdapterConfig = {},\n\tstore = new Map(),\n) => {\n\tconst storeInstance = new MemoryStore(config.initialData, store);\n\n\tconst adapterInstance = createAdapterFactory({\n\t\tconfig: {\n\t\t\tadapterId: 'memory-adapter',\n\t\t\tadapterName: 'Memory Adapter',\n\t\t\tusePlural: config.usePlural ?? false,\n\t\t\tdebugLogs: config.debugLogs ?? false,\n\t\t\tsupportsJSON: true,\n\t\t\tsupportsDates: true,\n\t\t\tsupportsBooleans: true,\n\t\t\tsupportsNumericIds: false,\n\t\t},\n\n\t\t// Note: The framework automatically transforms field names in both directions:\n\t\t// - Input data is already transformed before reaching the adapter (e.g., email -> email_address)\n\t\t// - Output data is automatically transformed after the adapter returns (e.g., email_address -> email)\n\t\t// Therefore, we should NOT call transformInput or transformOutput ourselves.\n\t\tadapter: ({ debugLog, getModelName, transformWhereClause }) => ({\n\t\t\tcreate: async ({ data, model }) => {\n\t\t\t\tdebugLog('CREATE', { model, data });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\n\t\t\t\t// Data is already transformed by the framework - store directly\n\t\t\t\tconst record = data as Record<string, unknown>;\n\t\t\t\tif (!record.id) {\n\t\t\t\t\trecord.id = crypto.randomUUID();\n\t\t\t\t}\n\n\t\t\t\tconst id = record.id as string;\n\t\t\t\tmodelData.set(id, { ...record });\n\t\t\t\treturn modelData.get(id);\n\t\t\t},\n\n\t\t\tfindOne: async ({ where, model }) => {\n\t\t\t\tdebugLog('FIND_ONE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findOne',\n\t\t\t\t});\n\n\t\t\t\tfor (const record of modelData.values()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\treturn record;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tfindMany: async ({ where, model, limit, offset, sortBy }) => {\n\t\t\t\tdebugLog('FIND_MANY', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findMany',\n\t\t\t\t});\n\n\t\t\t\tlet results = Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t);\n\n\t\t\t\tif (sortBy) {\n\t\t\t\t\tresults = applySorting(results, sortBy);\n\t\t\t\t}\n\n\t\t\t\tif (offset) {\n\t\t\t\t\tresults = results.slice(offset);\n\t\t\t\t}\n\t\t\t\tif (limit) {\n\t\t\t\t\tresults = results.slice(0, limit);\n\t\t\t\t}\n\n\t\t\t\treturn results;\n\t\t\t},\n\n\t\t\tupdate: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'update',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tconst updated = { ...record, ...update };\n\t\t\t\t\t\tmodelData.set(id, updated);\n\t\t\t\t\t\treturn updated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tupdateMany: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'updateMany',\n\t\t\t\t});\n\n\t\t\t\tlet count = 0;\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tmodelData.set(id, { ...record, ...update });\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t},\n\n\t\t\tdelete: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'delete',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeleteMany: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'deleteMany',\n\t\t\t\t});\n\n\t\t\t\tconst toDelete: string[] = [];\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\ttoDelete.push(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const id of toDelete) {\n\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t}\n\t\t\t\treturn toDelete.length;\n\t\t\t},\n\n\t\t\tcount: async ({ where, model }) => {\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'count',\n\t\t\t\t});\n\n\t\t\t\treturn Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t).length;\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Add utility methods to the adapter\n\treturn Object.assign(adapterInstance, {\n\t\tclear: () => store.clear(),\n\t\tgetAllData: () => storeInstance.getAllData(),\n\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;IACzC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAC7C;KACA;KACA,QAAQ;IACR,EAAC;IAEF,MAAMC,WAAqB,CAAE;AAC7B,SAAK,MAAM,CAAC,IAAI,OAAO,IAAI,UAAU,SAAS,CAC7C,KAAI,aAAa,QAAQ,iBAAiB,CACzC,UAAS,KAAK,GAAG;AAInB,SAAK,MAAM,MAAM,SAChB,WAAU,OAAO,GAAG;AAErB,WAAO,SAAS;GAChB;GAED,OAAO,OAAO,EAAE,OAAO,OAAO,KAAK;IAClC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAC7C;KACA;KACA,QAAQ;IACR,EAAC;AAEF,WAAO,MAAM,KAAK,UAAU,QAAQ,CAAC,CAAC,OAAO,CAAC,WAC7C,aAAa,QAAQ,iBAAiB,CACtC,CAAC;GACF;EACD;CACD,EAAC;AAGF,QAAO,OAAO,OAAO,iBAAiB;EACrC,OAAO,MAAM,MAAM,OAAO;EAC1B,YAAY,MAAM,cAAc,YAAY;EAC5C,UAAU,MAAM;CAChB,EAAC;AACF"}
1
+ {"version":3,"file":"better-auth.cjs","names":["createAdapterFactory"],"sources":["../src/better-auth.ts"],"sourcesContent":["import {\n\tcreateAdapterFactory,\n\ttype DBAdapterDebugLogOption,\n\ttype Where,\n} from 'better-auth/adapters';\n\ninterface MemoryAdapterConfig {\n\tdebugLogs?: DBAdapterDebugLogOption;\n\tusePlural?: boolean;\n\tinitialData?: Record<string, any[]>;\n}\n\nclass MemoryStore {\n\tconstructor(\n\t\tinitialData?: Record<string, any[]>,\n\t\tprivate readonly data: Map<string, any> = new Map(),\n\t) {\n\t\tif (initialData) {\n\t\t\tfor (const [model, records] of Object.entries(initialData)) {\n\t\t\t\tconst modelData = new Map();\n\t\t\t\tfor (const record of records) {\n\t\t\t\t\tmodelData.set(record.id, { ...record });\n\t\t\t\t}\n\t\t\t\tthis.data.set(model, modelData);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetModel(modelName: string): Map<string, any> {\n\t\tif (!this.data.has(modelName)) {\n\t\t\tthis.data.set(modelName, new Map());\n\t\t}\n\t\treturn this.data.get(modelName)!;\n\t}\n\n\tclear() {\n\t\tthis.data.clear();\n\t}\n\n\tgetAllData() {\n\t\tconst result: Record<string, any[]> = {};\n\t\tfor (const [model, records] of this.data.entries()) {\n\t\t\tresult[model] = Array.from(records.values());\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction matchesWhere(record: any, where?: Where[]): boolean {\n\tif (!where || where.length === 0) return true;\n\n\tlet result: boolean | null = null;\n\n\tfor (const condition of where) {\n\t\tconst { field, operator = 'eq', connector = 'AND', mode } = condition;\n\t\t// `mode: 'insensitive'` compares strings case-folded on both sides — in\n\t\t// `in`/`not_in` lists too — the way the SQL adapters use ILIKE/LOWER().\n\t\tconst fold =\n\t\t\tmode === 'insensitive'\n\t\t\t\t? (v: unknown) => (typeof v === 'string' ? v.toLowerCase() : v)\n\t\t\t\t: (v: unknown) => v;\n\t\tconst recordValue = fold(record[field]) as any;\n\t\tconst value = (\n\t\t\tArray.isArray(condition.value)\n\t\t\t\t? (condition.value as unknown[]).map(fold)\n\t\t\t\t: fold(condition.value)\n\t\t) as any;\n\n\t\tlet matches = false;\n\n\t\tswitch (operator) {\n\t\t\tcase 'eq':\n\t\t\t\tmatches = recordValue === value;\n\t\t\t\tbreak;\n\t\t\tcase 'ne':\n\t\t\t\tmatches = recordValue !== value;\n\t\t\t\tbreak;\n\t\t\tcase 'lt':\n\t\t\t\tmatches = value != null && recordValue < value;\n\t\t\t\tbreak;\n\t\t\tcase 'lte':\n\t\t\t\tmatches = value != null && recordValue <= value;\n\t\t\t\tbreak;\n\t\t\tcase 'gt':\n\t\t\t\tmatches = value != null && recordValue > value;\n\t\t\t\tbreak;\n\t\t\tcase 'gte':\n\t\t\t\tmatches = value != null && recordValue >= value;\n\t\t\t\tbreak;\n\t\t\tcase 'in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && (value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'not_in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && !(value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'contains':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.includes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'starts_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.startsWith(value);\n\t\t\t\tbreak;\n\t\t\tcase 'ends_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.endsWith(value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmatches = recordValue === value;\n\t\t}\n\n\t\t// Apply connector logic\n\t\tif (result === null) {\n\t\t\tresult = matches;\n\t\t} else if (connector === 'OR') {\n\t\t\tresult = result || matches;\n\t\t} else {\n\t\t\t// Default: AND\n\t\t\tresult = result && matches;\n\t\t}\n\t}\n\n\treturn result ?? true;\n}\ntype SortBy = {\n\tfield: string;\n\tdirection: 'asc' | 'desc';\n};\n\nfunction applySorting(records: any[], sortBy?: SortBy): any[] {\n\tif (!sortBy) return records;\n\n\tconst { field, direction } = sortBy;\n\n\treturn records.sort((a, b) => {\n\t\tconst aVal = a[field];\n\t\tconst bVal = b[field];\n\n\t\tif (aVal === bVal) return 0;\n\t\tif (aVal == null) return direction === 'asc' ? -1 : 1;\n\t\tif (bVal == null) return direction === 'asc' ? 1 : -1;\n\n\t\tconst comparison = aVal < bVal ? -1 : 1;\n\t\treturn direction === 'asc' ? comparison : -comparison;\n\t});\n}\n\nexport const memoryAdapter = (\n\tconfig: MemoryAdapterConfig = {},\n\tstore = new Map(),\n) => {\n\tconst storeInstance = new MemoryStore(config.initialData, store);\n\n\tconst adapterInstance = createAdapterFactory({\n\t\tconfig: {\n\t\t\tadapterId: 'memory-adapter',\n\t\t\tadapterName: 'Memory Adapter',\n\t\t\tusePlural: config.usePlural ?? false,\n\t\t\tdebugLogs: config.debugLogs ?? false,\n\t\t\tsupportsJSON: true,\n\t\t\tsupportsDates: true,\n\t\t\tsupportsBooleans: true,\n\t\t\tsupportsNumericIds: false,\n\t\t},\n\n\t\t// Note: The framework automatically transforms field names in both directions:\n\t\t// - Input data is already transformed before reaching the adapter (e.g., email -> email_address)\n\t\t// - Output data is automatically transformed after the adapter returns (e.g., email_address -> email)\n\t\t// Therefore, we should NOT call transformInput or transformOutput ourselves.\n\t\tadapter: ({\n\t\t\tdebugLog,\n\t\t\tgetModelName,\n\t\t\tgetFieldName,\n\t\t\ttransformWhereClause,\n\t\t}) => ({\n\t\t\tcreate: async ({ data, model }) => {\n\t\t\t\tdebugLog('CREATE', { model, data });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\n\t\t\t\t// Data is already transformed by the framework - store directly\n\t\t\t\tconst record = data as Record<string, unknown>;\n\t\t\t\tif (!record.id) {\n\t\t\t\t\trecord.id = crypto.randomUUID();\n\t\t\t\t}\n\n\t\t\t\tconst id = record.id as string;\n\t\t\t\tmodelData.set(id, { ...record });\n\t\t\t\treturn modelData.get(id);\n\t\t\t},\n\n\t\t\tfindOne: async ({ where, model }) => {\n\t\t\t\tdebugLog('FIND_ONE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findOne',\n\t\t\t\t});\n\n\t\t\t\tfor (const record of modelData.values()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\treturn record;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tfindMany: async ({ where, model, limit, offset, sortBy, select }) => {\n\t\t\t\tdebugLog('FIND_MANY', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findMany',\n\t\t\t\t});\n\n\t\t\t\tlet results = Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t);\n\n\t\t\t\tif (sortBy) {\n\t\t\t\t\tresults = applySorting(results, sortBy);\n\t\t\t\t}\n\n\t\t\t\tif (offset) {\n\t\t\t\t\tresults = results.slice(offset);\n\t\t\t\t}\n\t\t\t\tif (limit) {\n\t\t\t\t\tresults = results.slice(0, limit);\n\t\t\t\t}\n\n\t\t\t\t// Only the fields asked for, as a SELECT list would return — under\n\t\t\t\t// their stored names, which differ when the schema renames a field\n\t\t\t\t// (`fields: { email: 'email_address' }`).\n\t\t\t\tif (select?.length) {\n\t\t\t\t\tconst columns = select.map((field) => getFieldName({ model, field }));\n\t\t\t\t\treturn results.map((record) =>\n\t\t\t\t\t\tObject.fromEntries(\n\t\t\t\t\t\t\tcolumns.map((column) => [column, record[column]]),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn results;\n\t\t\t},\n\n\t\t\tupdate: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'update',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tconst updated = { ...record, ...update };\n\t\t\t\t\t\tmodelData.set(id, updated);\n\t\t\t\t\t\treturn updated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tupdateMany: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'updateMany',\n\t\t\t\t});\n\n\t\t\t\tlet count = 0;\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tmodelData.set(id, { ...record, ...update });\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t},\n\n\t\t\tdelete: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'delete',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeleteMany: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'deleteMany',\n\t\t\t\t});\n\n\t\t\t\tconst toDelete: string[] = [];\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\ttoDelete.push(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const id of toDelete) {\n\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t}\n\t\t\t\treturn toDelete.length;\n\t\t\t},\n\n\t\t\tcount: async ({ where, model }) => {\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'count',\n\t\t\t\t});\n\n\t\t\t\treturn Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t).length;\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Add utility methods to the adapter\n\treturn Object.assign(adapterInstance, {\n\t\tclear: () => store.clear(),\n\t\tgetAllData: () => storeInstance.getAllData(),\n\t\tgetStore: () => store,\n\t});\n};\n"],"mappings":";;;AAYA,IAAM,cAAN,MAAkB;CAGC;CAFlB,YACC,aACA,uBAA0C,IAAI,IAAI,GACjD;EADgB,KAAA,OAAA;EAEjB,IAAI,aACH,KAAK,MAAM,CAAC,OAAO,YAAY,OAAO,QAAQ,WAAW,GAAG;GAC3D,MAAM,4BAAY,IAAI,IAAI;GAC1B,KAAK,MAAM,UAAU,SACpB,UAAU,IAAI,OAAO,IAAI,EAAE,GAAG,OAAO,CAAC;GAEvC,KAAK,KAAK,IAAI,OAAO,SAAS;EAC/B;CAEF;CAEA,SAAS,W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