lakutata 2.0.80 → 2.0.82

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 (556) hide show
  1. package/com/cacher.cjs +8 -10
  2. package/com/cacher.d.ts +83 -14
  3. package/com/cacher.mjs +8 -10
  4. package/com/database.cjs +11 -11
  5. package/com/database.mjs +11 -11
  6. package/com/docker.cjs +17 -19
  7. package/com/docker.d.ts +3 -141
  8. package/com/docker.mjs +13 -15
  9. package/com/entrypoint.cjs +7 -5
  10. package/com/entrypoint.mjs +7 -5
  11. package/com/logger.cjs +7 -7
  12. package/com/logger.mjs +7 -7
  13. package/com/monitor.cjs +5 -3
  14. package/com/monitor.mjs +5 -3
  15. package/decorator/ctrl.cjs +3 -3
  16. package/decorator/ctrl.mjs +3 -3
  17. package/decorator/orm.cjs +98 -98
  18. package/decorator/orm.mjs +142 -56
  19. package/helper.cjs +9 -11
  20. package/helper.mjs +5 -7
  21. package/lakutata.cjs +23 -30
  22. package/lakutata.mjs +14 -18
  23. package/orm.cjs +1421 -884
  24. package/orm.mjs +1474 -724
  25. package/package.json +1 -1
  26. package/provider/database.cjs +11 -11
  27. package/provider/database.mjs +11 -11
  28. package/provider/passwordHash.cjs +4 -2
  29. package/provider/passwordHash.mjs +4 -2
  30. package/src/components/Database.cjs +13 -13
  31. package/src/components/Database.mjs +17 -17
  32. package/src/components/Logger.cjs +7 -7
  33. package/src/components/Logger.mjs +7 -7
  34. package/src/components/cacher/Cacher.cjs +1186 -272
  35. package/src/components/cacher/Cacher.mjs +1094 -180
  36. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +478 -2962
  37. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +468 -2946
  38. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +12 -12
  39. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +11 -11
  40. package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +16 -16
  41. package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +14 -14
  42. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +11 -11
  43. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +11 -11
  44. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +12 -12
  45. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +13 -13
  46. package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +2 -2
  47. package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +2 -2
  48. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +10 -10
  49. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +10 -10
  50. package/src/components/cacher/lib/IsDriverPackageInstalled.cjs +2 -2
  51. package/src/components/cacher/lib/IsDriverPackageInstalled.mjs +5 -5
  52. package/src/components/docker/ConnectionOptionsBuilder.cjs +23 -25
  53. package/src/components/docker/ConnectionOptionsBuilder.mjs +19 -21
  54. package/src/components/docker/Docker.cjs +5035 -5096
  55. package/src/components/docker/Docker.mjs +4955 -5016
  56. package/src/components/docker/lib/DockerContainer.cjs +23 -25
  57. package/src/components/docker/lib/DockerContainer.mjs +17 -19
  58. package/src/components/docker/lib/DockerContainerTTY.cjs +9 -11
  59. package/src/components/docker/lib/DockerContainerTTY.mjs +9 -11
  60. package/src/components/docker/lib/DockerImage.cjs +4 -2
  61. package/src/components/docker/lib/DockerImage.mjs +4 -2
  62. package/src/components/docker/lib/ParseEnvToRecord.cjs +2 -2
  63. package/src/components/docker/lib/ParseEnvToRecord.mjs +12 -12
  64. package/src/components/docker/lib/ParseRepositoryTag.cjs +9 -9
  65. package/src/components/docker/lib/ParseRepositoryTag.mjs +11 -11
  66. package/src/components/entrypoint/Entrypoint.cjs +2179 -1687
  67. package/src/components/entrypoint/Entrypoint.mjs +2182 -1690
  68. package/src/components/entrypoint/lib/AccessControl.cjs +4 -2
  69. package/src/components/entrypoint/lib/AccessControl.mjs +4 -2
  70. package/src/components/entrypoint/lib/AccessControlRule.cjs +4 -2
  71. package/src/components/entrypoint/lib/AccessControlRule.mjs +4 -2
  72. package/src/components/entrypoint/lib/Controller.cjs +4 -2
  73. package/src/components/entrypoint/lib/Controller.mjs +4 -2
  74. package/src/components/monitor/AliveMonitor.cjs +6 -4
  75. package/src/components/monitor/AliveMonitor.mjs +6 -4
  76. package/src/components/monitor/CpuMonitor.cjs +5 -3
  77. package/src/components/monitor/CpuMonitor.mjs +5 -3
  78. package/src/components/monitor/EventLoopMonitor.cjs +4 -2
  79. package/src/components/monitor/EventLoopMonitor.mjs +4 -2
  80. package/src/components/monitor/HttpRequestMonitor.cjs +5 -3
  81. package/src/components/monitor/HttpRequestMonitor.mjs +5 -3
  82. package/src/components/monitor/MemoryMonitor.cjs +8 -6
  83. package/src/components/monitor/MemoryMonitor.mjs +5 -3
  84. package/src/decorators/asst/After.cjs +3 -3
  85. package/src/decorators/asst/After.mjs +2 -2
  86. package/src/decorators/asst/Before.cjs +2 -2
  87. package/src/decorators/asst/Before.mjs +4 -4
  88. package/src/decorators/ctrl/CLIAction.cjs +5 -5
  89. package/src/decorators/ctrl/CLIAction.mjs +10 -10
  90. package/src/decorators/ctrl/HTTPAction.cjs +9 -9
  91. package/src/decorators/ctrl/HTTPAction.mjs +7 -7
  92. package/src/decorators/ctrl/ServiceAction.cjs +6 -6
  93. package/src/decorators/ctrl/ServiceAction.mjs +7 -7
  94. package/src/decorators/ctrl/http/DELETE.cjs +5 -5
  95. package/src/decorators/ctrl/http/DELETE.mjs +5 -5
  96. package/src/decorators/ctrl/http/GET.cjs +5 -5
  97. package/src/decorators/ctrl/http/GET.mjs +5 -5
  98. package/src/decorators/ctrl/http/HEAD.cjs +5 -5
  99. package/src/decorators/ctrl/http/HEAD.mjs +5 -5
  100. package/src/decorators/ctrl/http/OPTIONS.cjs +5 -5
  101. package/src/decorators/ctrl/http/OPTIONS.mjs +5 -5
  102. package/src/decorators/ctrl/http/PATCH.cjs +5 -5
  103. package/src/decorators/ctrl/http/PATCH.mjs +5 -5
  104. package/src/decorators/ctrl/http/POST.cjs +5 -5
  105. package/src/decorators/ctrl/http/POST.mjs +5 -5
  106. package/src/decorators/ctrl/http/PUT.cjs +5 -5
  107. package/src/decorators/ctrl/http/PUT.mjs +5 -5
  108. package/src/decorators/di/Autoload.cjs +2 -2
  109. package/src/decorators/di/Autoload.mjs +2 -2
  110. package/src/decorators/di/Configurable.cjs +3 -3
  111. package/src/decorators/di/Configurable.mjs +2 -2
  112. package/src/decorators/di/Inject.cjs +6 -6
  113. package/src/decorators/di/Inject.mjs +11 -11
  114. package/src/decorators/di/Lifetime.cjs +18 -18
  115. package/src/decorators/di/Lifetime.mjs +13 -13
  116. package/src/decorators/dto/Accept.cjs +3 -3
  117. package/src/decorators/dto/Accept.mjs +2 -2
  118. package/src/decorators/dto/Expect.cjs +2 -2
  119. package/src/decorators/dto/Expect.mjs +3 -3
  120. package/src/decorators/dto/IndexSignature.cjs +2 -2
  121. package/src/decorators/dto/IndexSignature.mjs +3 -3
  122. package/src/decorators/dto/Return.cjs +3 -3
  123. package/src/decorators/dto/Return.mjs +2 -2
  124. package/src/decorators/orm/AfterInsert.cjs +17 -39
  125. package/src/decorators/orm/AfterInsert.mjs +18 -38
  126. package/src/decorators/orm/AfterLoad.cjs +17 -39
  127. package/src/decorators/orm/AfterLoad.mjs +18 -38
  128. package/src/decorators/orm/AfterRecover.cjs +17 -39
  129. package/src/decorators/orm/AfterRecover.mjs +18 -38
  130. package/src/decorators/orm/AfterRemove.cjs +17 -39
  131. package/src/decorators/orm/AfterRemove.mjs +18 -38
  132. package/src/decorators/orm/AfterSoftRemove.cjs +17 -39
  133. package/src/decorators/orm/AfterSoftRemove.mjs +18 -38
  134. package/src/decorators/orm/AfterUpdate.cjs +17 -39
  135. package/src/decorators/orm/AfterUpdate.mjs +18 -38
  136. package/src/decorators/orm/BeforeInsert.cjs +17 -39
  137. package/src/decorators/orm/BeforeInsert.mjs +18 -38
  138. package/src/decorators/orm/BeforeRecover.cjs +17 -39
  139. package/src/decorators/orm/BeforeRecover.mjs +18 -38
  140. package/src/decorators/orm/BeforeRemove.cjs +17 -39
  141. package/src/decorators/orm/BeforeRemove.mjs +18 -38
  142. package/src/decorators/orm/BeforeSoftRemove.cjs +17 -39
  143. package/src/decorators/orm/BeforeSoftRemove.mjs +18 -38
  144. package/src/decorators/orm/BeforeUpdate.cjs +17 -39
  145. package/src/decorators/orm/BeforeUpdate.mjs +18 -38
  146. package/src/decorators/orm/Check.cjs +17 -42
  147. package/src/decorators/orm/Check.mjs +18 -41
  148. package/src/decorators/orm/ChildEntity.cjs +17 -42
  149. package/src/decorators/orm/ChildEntity.mjs +18 -41
  150. package/src/decorators/orm/Column.cjs +17 -74
  151. package/src/decorators/orm/Column.mjs +19 -74
  152. package/src/decorators/orm/CreateDateColumn.cjs +17 -38
  153. package/src/decorators/orm/CreateDateColumn.mjs +18 -37
  154. package/src/decorators/orm/DeleteDateColumn.cjs +17 -38
  155. package/src/decorators/orm/DeleteDateColumn.mjs +17 -36
  156. package/src/decorators/orm/Entity.cjs +17 -48
  157. package/src/decorators/orm/Entity.mjs +17 -46
  158. package/src/decorators/orm/EventSubscriber.cjs +17 -35
  159. package/src/decorators/orm/EventSubscriber.mjs +18 -34
  160. package/src/decorators/orm/Exclusion.cjs +17 -42
  161. package/src/decorators/orm/Exclusion.mjs +18 -41
  162. package/src/decorators/orm/Generated.cjs +17 -37
  163. package/src/decorators/orm/Generated.mjs +18 -36
  164. package/src/decorators/orm/Index.cjs +17 -54
  165. package/src/decorators/orm/Index.mjs +19 -54
  166. package/src/decorators/orm/JoinColumn.cjs +17 -42
  167. package/src/decorators/orm/JoinColumn.mjs +18 -41
  168. package/src/decorators/orm/JoinTable.cjs +17 -43
  169. package/src/decorators/orm/JoinTable.mjs +17 -41
  170. package/src/decorators/orm/ManyToMany.cjs +17 -55
  171. package/src/decorators/orm/ManyToMany.mjs +17 -53
  172. package/src/decorators/orm/ManyToOne.cjs +17 -55
  173. package/src/decorators/orm/ManyToOne.mjs +17 -53
  174. package/src/decorators/orm/ObjectIdColumn.cjs +17 -41
  175. package/src/decorators/orm/ObjectIdColumn.mjs +18 -40
  176. package/src/decorators/orm/OneToMany.cjs +17 -47
  177. package/src/decorators/orm/OneToMany.mjs +19 -47
  178. package/src/decorators/orm/OneToOne.cjs +17 -55
  179. package/src/decorators/orm/OneToOne.mjs +17 -53
  180. package/src/decorators/orm/PrimaryColumn.cjs +17 -62
  181. package/src/decorators/orm/PrimaryColumn.mjs +19 -62
  182. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +17 -67
  183. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +19 -67
  184. package/src/decorators/orm/RelationId.cjs +17 -39
  185. package/src/decorators/orm/RelationId.mjs +18 -38
  186. package/src/decorators/orm/TableInheritance.cjs +17 -39
  187. package/src/decorators/orm/TableInheritance.mjs +18 -38
  188. package/src/decorators/orm/Tree.cjs +17 -37
  189. package/src/decorators/orm/Tree.mjs +18 -36
  190. package/src/decorators/orm/TreeChildren.cjs +17 -44
  191. package/src/decorators/orm/TreeChildren.mjs +17 -42
  192. package/src/decorators/orm/TreeLevelColumn.cjs +17 -38
  193. package/src/decorators/orm/TreeLevelColumn.mjs +17 -36
  194. package/src/decorators/orm/TreeParent.cjs +17 -44
  195. package/src/decorators/orm/TreeParent.mjs +17 -42
  196. package/src/decorators/orm/Unique.cjs +17 -57
  197. package/src/decorators/orm/Unique.mjs +19 -57
  198. package/src/decorators/orm/UpdateDateColumn.cjs +17 -38
  199. package/src/decorators/orm/UpdateDateColumn.mjs +18 -37
  200. package/src/decorators/orm/VersionColumn.cjs +17 -38
  201. package/src/decorators/orm/VersionColumn.mjs +18 -37
  202. package/src/decorators/orm/ViewColumn.cjs +17 -38
  203. package/src/decorators/orm/ViewColumn.mjs +18 -37
  204. package/src/decorators/orm/ViewEntity.cjs +17 -47
  205. package/src/decorators/orm/ViewEntity.mjs +18 -46
  206. package/src/decorators/orm/VirtualColumn.cjs +17 -55
  207. package/src/decorators/orm/VirtualColumn.mjs +17 -53
  208. package/src/lib/base/BaseObject.cjs +4 -2
  209. package/src/lib/base/BaseObject.mjs +4 -2
  210. package/src/lib/base/EventEmitter.cjs +1202 -1195
  211. package/src/lib/base/EventEmitter.mjs +1202 -1195
  212. package/src/lib/base/async-constructor/Append.cjs +11 -11
  213. package/src/lib/base/async-constructor/Append.mjs +7 -7
  214. package/src/lib/base/internal/ApplicationConfigLoader.cjs +4 -2
  215. package/src/lib/base/internal/ApplicationConfigLoader.mjs +4 -2
  216. package/src/lib/base/internal/BasicInfo.cjs +10 -10
  217. package/src/lib/base/internal/BasicInfo.mjs +9 -9
  218. package/src/lib/base/internal/CamelCase.cjs +4 -4
  219. package/src/lib/base/internal/CamelCase.mjs +11 -11
  220. package/src/lib/base/internal/ConfigurableRecordsInjection.cjs +19 -19
  221. package/src/lib/base/internal/ConfigurableRecordsInjection.mjs +18 -18
  222. package/src/lib/base/internal/ConstructorSymbol.cjs +10 -10
  223. package/src/lib/base/internal/ConstructorSymbol.mjs +8 -8
  224. package/src/lib/base/internal/ControllerEntrypoint.cjs +67 -67
  225. package/src/lib/base/internal/ControllerEntrypoint.mjs +38 -38
  226. package/src/lib/base/internal/DataValidator.cjs +176 -179
  227. package/src/lib/base/internal/DataValidator.mjs +221 -224
  228. package/src/lib/base/internal/GetActionDTOAndOptions.cjs +9 -9
  229. package/src/lib/base/internal/GetActionDTOAndOptions.mjs +10 -10
  230. package/src/lib/base/internal/IEEE754.cjs +74 -74
  231. package/src/lib/base/internal/IEEE754.mjs +70 -70
  232. package/src/lib/base/internal/MethodAssistantFunction.cjs +28 -28
  233. package/src/lib/base/internal/MethodAssistantFunction.mjs +38 -38
  234. package/src/lib/base/internal/MethodValidation.cjs +25 -25
  235. package/src/lib/base/internal/MethodValidation.mjs +20 -20
  236. package/src/lib/base/internal/ModuleConfigLoader.cjs +4 -3
  237. package/src/lib/base/internal/ModuleConfigLoader.mjs +4 -3
  238. package/src/lib/base/internal/ObjectConfiguration.cjs +10 -10
  239. package/src/lib/base/internal/ObjectConfiguration.mjs +15 -15
  240. package/src/lib/base/internal/ObjectContainer.cjs +7 -7
  241. package/src/lib/base/internal/ObjectContainer.mjs +6 -6
  242. package/src/lib/base/internal/ObjectInjection.cjs +16 -16
  243. package/src/lib/base/internal/ObjectInjection.mjs +13 -13
  244. package/src/lib/base/internal/ObjectLifetime.cjs +10 -10
  245. package/src/lib/base/internal/ObjectLifetime.mjs +9 -9
  246. package/src/lib/base/internal/ObjectType.cjs +4 -2
  247. package/src/lib/base/internal/ObjectType.mjs +4 -2
  248. package/src/lib/base/internal/ObjectWeakRefs.cjs +11 -11
  249. package/src/lib/base/internal/ObjectWeakRefs.mjs +9 -9
  250. package/src/lib/base/internal/PatternManager.cjs +744 -739
  251. package/src/lib/base/internal/PatternManager.mjs +748 -743
  252. package/src/lib/base/internal/StringifyPattern.cjs +26 -26
  253. package/src/lib/base/internal/StringifyPattern.mjs +26 -26
  254. package/src/lib/base/internal/ThrowWarning.cjs +2 -2
  255. package/src/lib/base/internal/ThrowWarning.mjs +2 -2
  256. package/src/lib/core/Alias.cjs +5 -5
  257. package/src/lib/core/Application.cjs +146 -142
  258. package/src/lib/core/Application.mjs +204 -202
  259. package/src/lib/core/Component.cjs +4 -2
  260. package/src/lib/core/Component.mjs +4 -2
  261. package/src/lib/core/Container.cjs +4 -2
  262. package/src/lib/core/Container.mjs +4 -2
  263. package/src/lib/core/Module.cjs +5 -3
  264. package/src/lib/core/Module.mjs +5 -3
  265. package/src/lib/core/Provider.cjs +4 -2
  266. package/src/lib/core/Provider.mjs +4 -2
  267. package/src/lib/helpers/ArrayToSet.cjs +2 -2
  268. package/src/lib/helpers/ArrayToSet.mjs +3 -3
  269. package/src/lib/helpers/As.cjs +2 -2
  270. package/src/lib/helpers/As.mjs +2 -2
  271. package/src/lib/helpers/ConvertArrayLikeToIterable.cjs +3 -3
  272. package/src/lib/helpers/ConvertArrayLikeToIterable.mjs +3 -3
  273. package/src/lib/helpers/ConvertArrayLikeToStream.cjs +2 -2
  274. package/src/lib/helpers/ConvertArrayLikeToStream.mjs +2 -2
  275. package/src/lib/helpers/Delay.cjs +2 -2
  276. package/src/lib/helpers/Delay.mjs +2 -2
  277. package/src/lib/helpers/DevNull.cjs +2 -2
  278. package/src/lib/helpers/DevNull.mjs +2 -2
  279. package/src/lib/helpers/GetObjectNestingDepth.cjs +12 -12
  280. package/src/lib/helpers/GetObjectNestingDepth.mjs +11 -11
  281. package/src/lib/helpers/GetObjectPropertyPaths.cjs +7 -7
  282. package/src/lib/helpers/GetObjectPropertyPaths.mjs +9 -9
  283. package/src/lib/helpers/Glob.cjs +1192 -943
  284. package/src/lib/helpers/Glob.mjs +1256 -1007
  285. package/src/lib/helpers/GraceExit.cjs +3 -3
  286. package/src/lib/helpers/GraceExit.mjs +7 -7
  287. package/src/lib/helpers/HexToIEEE754.cjs +4 -4
  288. package/src/lib/helpers/HexToIEEE754.mjs +2 -2
  289. package/src/lib/helpers/HexToSigned.cjs +5 -5
  290. package/src/lib/helpers/HexToSigned.mjs +4 -4
  291. package/src/lib/helpers/HexToUnsigned.cjs +2 -2
  292. package/src/lib/helpers/HexToUnsigned.mjs +2 -2
  293. package/src/lib/helpers/IEEE754ToHex.cjs +5 -5
  294. package/src/lib/helpers/IEEE754ToHex.mjs +5 -5
  295. package/src/lib/helpers/IsAbortError.cjs +2 -2
  296. package/src/lib/helpers/IsAbortError.mjs +3 -3
  297. package/src/lib/helpers/IsEmptyObject.cjs +3 -3
  298. package/src/lib/helpers/IsEmptyObject.mjs +3 -3
  299. package/src/lib/helpers/IsExists.cjs +5 -5
  300. package/src/lib/helpers/IsExists.mjs +4 -4
  301. package/src/lib/helpers/IsHtml.cjs +18 -8
  302. package/src/lib/helpers/IsHtml.mjs +18 -8
  303. package/src/lib/helpers/IsNativeFunction.cjs +2 -2
  304. package/src/lib/helpers/IsNativeFunction.mjs +2 -2
  305. package/src/lib/helpers/IsPath.cjs +2 -2
  306. package/src/lib/helpers/IsPath.mjs +5 -5
  307. package/src/lib/helpers/IsPromise.cjs +2 -2
  308. package/src/lib/helpers/IsPromise.mjs +2 -2
  309. package/src/lib/helpers/IsPromiseLike.cjs +5 -5
  310. package/src/lib/helpers/IsPromiseLike.mjs +6 -6
  311. package/src/lib/helpers/IsXML.cjs +1525 -1531
  312. package/src/lib/helpers/IsXML.mjs +1521 -1527
  313. package/src/lib/helpers/MD5.cjs +3 -3
  314. package/src/lib/helpers/MD5.mjs +3 -3
  315. package/src/lib/helpers/MergeArray.cjs +3 -3
  316. package/src/lib/helpers/MergeArray.mjs +3 -3
  317. package/src/lib/helpers/MergeMap.cjs +3 -3
  318. package/src/lib/helpers/MergeMap.mjs +3 -3
  319. package/src/lib/helpers/MergeSet.cjs +2 -2
  320. package/src/lib/helpers/MergeSet.mjs +3 -3
  321. package/src/lib/helpers/NoCase.cjs +27 -27
  322. package/src/lib/helpers/NoCase.mjs +24 -24
  323. package/src/lib/helpers/NonceStr.cjs +3 -3
  324. package/src/lib/helpers/NonceStr.mjs +3 -3
  325. package/src/lib/helpers/ObjectConstructor.cjs +2 -2
  326. package/src/lib/helpers/ObjectConstructor.mjs +4 -4
  327. package/src/lib/helpers/ObjectHash.cjs +385 -378
  328. package/src/lib/helpers/ObjectHash.mjs +381 -374
  329. package/src/lib/helpers/ObjectParentConstructor.cjs +2 -2
  330. package/src/lib/helpers/ObjectParentConstructor.mjs +5 -5
  331. package/src/lib/helpers/ObjectParentConstructors.cjs +6 -6
  332. package/src/lib/helpers/ObjectParentConstructors.mjs +2 -2
  333. package/src/lib/helpers/ObjectPrototype.cjs +2 -2
  334. package/src/lib/helpers/ObjectPrototype.mjs +2 -2
  335. package/src/lib/helpers/ObjectToMap.cjs +2 -2
  336. package/src/lib/helpers/ObjectToMap.mjs +3 -3
  337. package/src/lib/helpers/Paginator.cjs +2 -2
  338. package/src/lib/helpers/Paginator.mjs +6 -6
  339. package/src/lib/helpers/RandomString.cjs +170 -149
  340. package/src/lib/helpers/RandomString.mjs +167 -146
  341. package/src/lib/helpers/SHA1.cjs +3 -3
  342. package/src/lib/helpers/SHA1.mjs +3 -3
  343. package/src/lib/helpers/SHA256.cjs +3 -3
  344. package/src/lib/helpers/SHA256.mjs +3 -3
  345. package/src/lib/helpers/SetToArray.cjs +2 -2
  346. package/src/lib/helpers/SetToArray.mjs +2 -2
  347. package/src/lib/helpers/SignedToHex.cjs +4 -4
  348. package/src/lib/helpers/SignedToHex.mjs +4 -4
  349. package/src/lib/helpers/SortArray.cjs +17 -17
  350. package/src/lib/helpers/SortArray.mjs +16 -16
  351. package/src/lib/helpers/SortKeys.cjs +41 -41
  352. package/src/lib/helpers/SortKeys.mjs +41 -41
  353. package/src/lib/helpers/SortObject.cjs +2 -2
  354. package/src/lib/helpers/SortObject.mjs +2 -2
  355. package/src/lib/helpers/Statistics.cjs +1 -1
  356. package/src/lib/helpers/Statistics.mjs +1 -1
  357. package/src/lib/helpers/Templating.cjs +25 -25
  358. package/src/lib/helpers/Templating.mjs +25 -25
  359. package/src/lib/helpers/URLBuilder.cjs +355 -355
  360. package/src/lib/helpers/URLBuilder.mjs +349 -349
  361. package/src/lib/helpers/UUID.cjs +1 -1
  362. package/src/lib/helpers/UUID.mjs +1 -1
  363. package/src/lib/helpers/UniqueArray.cjs +3 -3
  364. package/src/lib/helpers/UniqueArray.mjs +2 -2
  365. package/src/lib/helpers/UnsignedToHex.cjs +3 -3
  366. package/src/lib/helpers/UnsignedToHex.mjs +3 -3
  367. package/src/lib/ioc/DependencyInjectionContainer.cjs +111 -109
  368. package/src/lib/ioc/DependencyInjectionContainer.mjs +123 -121
  369. package/src/lib/ioc/FunctionTokenizer.cjs +115 -115
  370. package/src/lib/ioc/FunctionTokenizer.mjs +102 -102
  371. package/src/lib/ioc/Lifetime.cjs +5 -5
  372. package/src/lib/ioc/Lifetime.mjs +5 -5
  373. package/src/lib/ioc/ListModules.cjs +5222 -5297
  374. package/src/lib/ioc/ListModules.mjs +5187 -5262
  375. package/src/lib/ioc/LoadModules.cjs +56 -56
  376. package/src/lib/ioc/LoadModules.mjs +69 -69
  377. package/src/lib/ioc/ParamParser.cjs +30 -30
  378. package/src/lib/ioc/ParamParser.mjs +41 -41
  379. package/src/lib/ioc/Resolvers.cjs +87 -87
  380. package/src/lib/ioc/Resolvers.mjs +109 -109
  381. package/src/lib/ioc/Utils.cjs +12 -12
  382. package/src/lib/ioc/Utils.mjs +18 -18
  383. package/src/lib/validation/VLD.cjs +4198 -4020
  384. package/src/lib/validation/VLD.mjs +3137 -2959
  385. package/src/options/ApplicationOptions.cjs +4 -2
  386. package/src/options/ApplicationOptions.mjs +4 -2
  387. package/src/options/LoadAnonymousObjectOptions.cjs +4 -2
  388. package/src/options/LoadAnonymousObjectOptions.mjs +4 -2
  389. package/src/options/LoadNamedObjectOptions.cjs +4 -2
  390. package/src/options/LoadNamedObjectOptions.mjs +4 -2
  391. package/src/options/LoadObjectOptions.cjs +4 -2
  392. package/src/options/LoadObjectOptions.mjs +4 -2
  393. package/src/options/ModuleLoadObjectsOptions.cjs +4 -2
  394. package/src/options/ModuleLoadObjectsOptions.mjs +4 -2
  395. package/src/options/ModuleOptions.cjs +4 -4
  396. package/src/options/ModuleOptions.mjs +4 -4
  397. package/src/options/OverridableNamedObjectOptions.cjs +4 -2
  398. package/src/options/OverridableNamedObjectOptions.mjs +4 -2
  399. package/src/options/OverridableObjectOptions.cjs +4 -2
  400. package/src/options/OverridableObjectOptions.mjs +4 -2
  401. package/src/providers/Database.cjs +13 -13
  402. package/src/providers/Database.mjs +18 -18
  403. package/src/providers/PasswordHash.cjs +334 -332
  404. package/src/providers/PasswordHash.mjs +389 -387
  405. package/src/providers/migration/GenerateMigration.cjs +15 -19
  406. package/src/providers/migration/GenerateMigration.mjs +15 -19
  407. package/vendor/Package.1.cjs +256 -256
  408. package/vendor/Package.1.mjs +254 -254
  409. package/vendor/Package.10.cjs +2 -8
  410. package/vendor/Package.10.mjs +2 -8
  411. package/vendor/Package.11.cjs +5 -83
  412. package/vendor/Package.11.mjs +5 -77
  413. package/vendor/Package.112.cjs +48900 -0
  414. package/vendor/Package.112.mjs +48764 -0
  415. package/vendor/Package.12.cjs +4 -2
  416. package/vendor/Package.12.mjs +6 -4
  417. package/vendor/Package.13.cjs +87 -1
  418. package/vendor/Package.13.mjs +81 -1
  419. package/vendor/Package.14.cjs +1 -14057
  420. package/vendor/Package.14.mjs +1 -14031
  421. package/vendor/Package.15.cjs +1 -1
  422. package/vendor/Package.15.mjs +1 -1
  423. package/vendor/Package.16.cjs +18115 -1921
  424. package/vendor/Package.16.mjs +18115 -1839
  425. package/vendor/Package.17.cjs +1926 -47922
  426. package/vendor/Package.17.mjs +1852 -47915
  427. package/vendor/Package.18.cjs +35 -1
  428. package/vendor/Package.18.mjs +35 -1
  429. package/vendor/Package.19.cjs +37 -0
  430. package/vendor/Package.19.mjs +35 -0
  431. package/vendor/Package.2.cjs +5856 -5827
  432. package/vendor/Package.2.mjs +5854 -5825
  433. package/vendor/Package.20.cjs +37 -0
  434. package/vendor/Package.20.mjs +35 -0
  435. package/vendor/Package.21.cjs +37 -0
  436. package/vendor/Package.21.mjs +35 -0
  437. package/vendor/Package.22.cjs +37 -0
  438. package/vendor/Package.22.mjs +35 -0
  439. package/vendor/Package.23.cjs +37 -0
  440. package/vendor/Package.23.mjs +35 -0
  441. package/vendor/Package.24.cjs +37 -0
  442. package/vendor/Package.24.mjs +35 -0
  443. package/vendor/Package.25.cjs +37 -0
  444. package/vendor/Package.25.mjs +35 -0
  445. package/vendor/Package.26.cjs +37 -0
  446. package/vendor/Package.26.mjs +35 -0
  447. package/vendor/Package.27.cjs +37 -0
  448. package/vendor/Package.27.mjs +35 -0
  449. package/vendor/Package.28.cjs +37 -0
  450. package/vendor/Package.28.mjs +35 -0
  451. package/vendor/Package.29.cjs +40 -0
  452. package/vendor/Package.29.mjs +38 -0
  453. package/vendor/Package.3.cjs +60 -60
  454. package/vendor/Package.3.mjs +85 -85
  455. package/vendor/Package.30.cjs +41 -0
  456. package/vendor/Package.30.mjs +39 -0
  457. package/vendor/Package.31.cjs +72 -0
  458. package/vendor/Package.31.mjs +70 -0
  459. package/vendor/Package.32.cjs +37 -0
  460. package/vendor/Package.32.mjs +35 -0
  461. package/vendor/Package.33.cjs +37 -0
  462. package/vendor/Package.33.mjs +35 -0
  463. package/vendor/Package.34.cjs +46 -0
  464. package/vendor/Package.34.mjs +44 -0
  465. package/vendor/Package.35.cjs +34 -0
  466. package/vendor/Package.35.mjs +32 -0
  467. package/vendor/Package.36.cjs +40 -0
  468. package/vendor/Package.36.mjs +38 -0
  469. package/vendor/Package.37.cjs +36 -0
  470. package/vendor/Package.37.mjs +34 -0
  471. package/vendor/Package.38.cjs +52 -0
  472. package/vendor/Package.38.mjs +50 -0
  473. package/vendor/Package.39.cjs +41 -0
  474. package/vendor/Package.39.mjs +39 -0
  475. package/vendor/Package.4.cjs +884 -874
  476. package/vendor/Package.4.mjs +887 -877
  477. package/vendor/Package.40.cjs +42 -0
  478. package/vendor/Package.40.mjs +40 -0
  479. package/vendor/Package.41.cjs +53 -0
  480. package/vendor/Package.41.mjs +51 -0
  481. package/vendor/Package.42.cjs +53 -0
  482. package/vendor/Package.42.mjs +51 -0
  483. package/vendor/Package.43.cjs +40 -0
  484. package/vendor/Package.43.mjs +38 -0
  485. package/vendor/Package.44.cjs +46 -0
  486. package/vendor/Package.44.mjs +44 -0
  487. package/vendor/Package.45.cjs +53 -0
  488. package/vendor/Package.45.mjs +51 -0
  489. package/vendor/Package.46.cjs +59 -0
  490. package/vendor/Package.46.mjs +57 -0
  491. package/vendor/Package.47.cjs +65 -0
  492. package/vendor/Package.47.mjs +63 -0
  493. package/vendor/Package.48.cjs +38 -0
  494. package/vendor/Package.48.mjs +36 -0
  495. package/vendor/Package.49.cjs +38 -0
  496. package/vendor/Package.49.mjs +36 -0
  497. package/vendor/Package.5.cjs +19 -15
  498. package/vendor/Package.5.mjs +14 -10
  499. package/vendor/Package.50.cjs +36 -0
  500. package/vendor/Package.50.mjs +34 -0
  501. package/vendor/Package.51.cjs +43 -0
  502. package/vendor/Package.51.mjs +41 -0
  503. package/vendor/Package.52.cjs +37 -0
  504. package/vendor/Package.52.mjs +35 -0
  505. package/vendor/Package.53.cjs +43 -0
  506. package/vendor/Package.53.mjs +41 -0
  507. package/vendor/Package.54.cjs +55 -0
  508. package/vendor/Package.54.mjs +53 -0
  509. package/vendor/Package.55.cjs +37 -0
  510. package/vendor/Package.55.mjs +35 -0
  511. package/vendor/Package.56.cjs +37 -0
  512. package/vendor/Package.56.mjs +35 -0
  513. package/vendor/Package.57.cjs +37 -0
  514. package/vendor/Package.57.mjs +35 -0
  515. package/vendor/Package.58.cjs +45 -0
  516. package/vendor/Package.58.mjs +43 -0
  517. package/vendor/Package.59.cjs +53 -0
  518. package/vendor/Package.59.mjs +51 -0
  519. package/vendor/Package.6.cjs +2067 -2058
  520. package/vendor/Package.6.mjs +2073 -2064
  521. package/vendor/Package.60.cjs +47649 -0
  522. package/vendor/Package.60.mjs +47606 -0
  523. package/vendor/Package.610.cjs +19 -19
  524. package/vendor/Package.610.mjs +11 -11
  525. package/vendor/Package.611.cjs +40 -30
  526. package/vendor/Package.611.mjs +30 -20
  527. package/vendor/Package.612.cjs +48 -42
  528. package/vendor/Package.612.mjs +39 -33
  529. package/vendor/Package.613.cjs +64 -63
  530. package/vendor/Package.613.mjs +34 -33
  531. package/vendor/Package.62.cjs +300 -297
  532. package/vendor/Package.62.mjs +283 -280
  533. package/vendor/Package.63.cjs +511 -168
  534. package/vendor/Package.63.mjs +490 -165
  535. package/vendor/Package.64.cjs +139 -511
  536. package/vendor/Package.64.mjs +139 -491
  537. package/vendor/Package.65.cjs +4135 -150
  538. package/vendor/Package.65.mjs +4143 -150
  539. package/vendor/Package.66.cjs +346 -4150
  540. package/vendor/Package.66.mjs +346 -4158
  541. package/vendor/Package.67.cjs +433 -282
  542. package/vendor/Package.67.mjs +431 -280
  543. package/vendor/Package.68.cjs +248 -397
  544. package/vendor/Package.68.mjs +81 -230
  545. package/vendor/Package.69.cjs +8 -8
  546. package/vendor/Package.7.cjs +3 -3
  547. package/vendor/Package.7.mjs +3 -3
  548. package/vendor/Package.8.cjs +0 -4
  549. package/vendor/Package.8.mjs +0 -4
  550. package/vendor/Package.9.cjs +138 -124
  551. package/vendor/Package.9.mjs +135 -121
  552. package/vendor/TypeDef.internal.3.d.ts +0 -4
  553. package/vendor/Package.102.cjs +0 -48773
  554. package/vendor/Package.102.mjs +0 -48697
  555. package/vendor/Package.122.cjs +0 -3
  556. package/vendor/Package.122.mjs +0 -1
@@ -1,57 +1,59 @@
1
1
  "use strict";
2
2
 
3
- const e = require("buffer");
3
+ const t = require("buffer");
4
4
 
5
- var t = s => {
6
- if (s === void 0 || s === null) {
5
+ var _serialize = (e, s = true) => {
6
+ if (e === void 0 || e === null) {
7
7
  return "null";
8
8
  }
9
- if (typeof s === "string") {
10
- return JSON.stringify(s.startsWith(":") ? ":" + s : s);
9
+ if (typeof e === "string") {
10
+ return JSON.stringify(s && e.startsWith(":") ? `:${e}` : e);
11
11
  }
12
- if (e.Buffer.isBuffer(s)) {
13
- return JSON.stringify(":base64:" + s.toString("base64"));
12
+ if (t.Buffer.isBuffer(e)) {
13
+ return JSON.stringify(`:base64:${e.toString("base64")}`);
14
14
  }
15
- if (s?.toJSON) {
16
- s = s.toJSON();
15
+ if (e?.toJSON) {
16
+ e = e.toJSON();
17
17
  }
18
- if (typeof s === "object") {
19
- let e = "";
20
- const i = Array.isArray(s);
21
- e = i ? "[" : "{";
18
+ if (typeof e === "object") {
19
+ let t = "";
20
+ const i = Array.isArray(e);
21
+ t = i ? "[" : "{";
22
22
  let r = true;
23
- for (const o in s) {
24
- const a = typeof s[o] === "function" || !i && s[o] === void 0;
25
- if (!Object.hasOwn(s, o) || a) {
23
+ for (const o in e) {
24
+ const a = typeof e[o] === "function" || !i && e[o] === void 0;
25
+ if (!Object.hasOwn(e, o) || a) {
26
26
  continue;
27
27
  }
28
28
  if (!r) {
29
- e += ",";
29
+ t += ",";
30
30
  }
31
31
  r = false;
32
32
  if (i) {
33
- e += t(s[o]);
34
- } else if (s[o] !== void 0) {
35
- e += t(o) + ":" + t(s[o]);
33
+ t += _serialize(e[o], s);
34
+ } else if (e[o] !== void 0) {
35
+ t += `${_serialize(o, false)}:${_serialize(e[o], s)}`;
36
36
  }
37
37
  }
38
- e += i ? "]" : "}";
39
- return e;
38
+ t += i ? "]" : "}";
39
+ return t;
40
40
  }
41
- return JSON.stringify(s);
41
+ return JSON.stringify(e);
42
42
  };
43
43
 
44
- var s = t => JSON.parse(t, ((t, s) => {
44
+ var defaultSerialize = t => _serialize(t, true);
45
+
46
+ var defaultDeserialize = e => JSON.parse(e, ((e, s) => {
45
47
  if (typeof s === "string") {
46
48
  if (s.startsWith(":base64:")) {
47
- return e.Buffer.from(s.slice(8), "base64");
49
+ return t.Buffer.from(s.slice(8), "base64");
48
50
  }
49
51
  return s.startsWith(":") ? s.slice(1) : s;
50
52
  }
51
53
  return s;
52
54
  }));
53
55
 
54
- var i = class {
56
+ var e = class {
55
57
  _eventListeners;
56
58
  _maxListeners;
57
59
  constructor() {
@@ -61,98 +63,98 @@ var i = class {
61
63
  maxListeners() {
62
64
  return this._maxListeners;
63
65
  }
64
- addListener(e, t) {
65
- this.on(e, t);
66
+ addListener(t, e) {
67
+ this.on(t, e);
66
68
  }
67
- on(e, t) {
68
- if (!this._eventListeners.has(e)) {
69
- this._eventListeners.set(e, []);
69
+ on(t, e) {
70
+ if (!this._eventListeners.has(t)) {
71
+ this._eventListeners.set(t, []);
70
72
  }
71
- const s = this._eventListeners.get(e);
73
+ const s = this._eventListeners.get(t);
72
74
  if (s) {
73
75
  if (s.length >= this._maxListeners) {
74
- console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${s.length + 1} ${e} listeners added. Use setMaxListeners() to increase limit.`);
76
+ console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${s.length + 1} ${t} listeners added. Use setMaxListeners() to increase limit.`);
75
77
  }
76
- s.push(t);
78
+ s.push(e);
77
79
  }
78
80
  return this;
79
81
  }
80
- removeListener(e, t) {
81
- this.off(e, t);
82
+ removeListener(t, e) {
83
+ this.off(t, e);
82
84
  }
83
- off(e, t) {
84
- const s = this._eventListeners.get(e) ?? [];
85
- const i = s.indexOf(t);
85
+ off(t, e) {
86
+ const s = this._eventListeners.get(t) ?? [];
87
+ const i = s.indexOf(e);
86
88
  if (i !== -1) {
87
89
  s.splice(i, 1);
88
90
  }
89
91
  if (s.length === 0) {
90
- this._eventListeners.delete(e);
92
+ this._eventListeners.delete(t);
91
93
  }
92
94
  }
93
- once(e, t) {
94
- const s = (...i) => {
95
- t(...i);
96
- this.off(e, s);
95
+ once(t, e) {
96
+ const onceListener = (...s) => {
97
+ e(...s);
98
+ this.off(t, onceListener);
97
99
  };
98
- this.on(e, s);
100
+ this.on(t, onceListener);
99
101
  }
100
- emit(e, ...t) {
101
- const s = this._eventListeners.get(e);
102
+ emit(t, ...e) {
103
+ const s = this._eventListeners.get(t);
102
104
  if (s && s.length > 0) {
103
- for (const e of s) {
104
- e(...t);
105
+ for (const t of s) {
106
+ t(...e);
105
107
  }
106
108
  }
107
109
  }
108
- listeners(e) {
109
- return this._eventListeners.get(e) ?? [];
110
+ listeners(t) {
111
+ return this._eventListeners.get(t) ?? [];
110
112
  }
111
- removeAllListeners(e) {
112
- if (e) {
113
- this._eventListeners.delete(e);
113
+ removeAllListeners(t) {
114
+ if (t) {
115
+ this._eventListeners.delete(t);
114
116
  } else {
115
117
  this._eventListeners.clear();
116
118
  }
117
119
  }
118
- setMaxListeners(e) {
119
- this._maxListeners = e;
120
+ setMaxListeners(t) {
121
+ this._maxListeners = t;
120
122
  }
121
123
  };
122
124
 
123
- var r = i;
125
+ var s = e;
124
126
 
125
- var o = class extends r {
127
+ var i = class extends s {
126
128
  _hookHandlers;
127
129
  constructor() {
128
130
  super();
129
131
  this._hookHandlers = new Map;
130
132
  }
131
- addHandler(e, t) {
132
- const s = this._hookHandlers.get(e);
133
+ addHandler(t, e) {
134
+ const s = this._hookHandlers.get(t);
133
135
  if (s) {
134
- s.push(t);
136
+ s.push(e);
135
137
  } else {
136
- this._hookHandlers.set(e, [ t ]);
138
+ this._hookHandlers.set(t, [ e ]);
137
139
  }
138
140
  }
139
- removeHandler(e, t) {
140
- const s = this._hookHandlers.get(e);
141
+ removeHandler(t, e) {
142
+ const s = this._hookHandlers.get(t);
141
143
  if (s) {
142
- const e = s.indexOf(t);
143
- if (e !== -1) {
144
- s.splice(e, 1);
144
+ const t = s.indexOf(e);
145
+ if (t !== -1) {
146
+ s.splice(t, 1);
145
147
  }
146
148
  }
147
149
  }
148
- trigger(e, t) {
149
- const s = this._hookHandlers.get(e);
150
+ trigger(t, e) {
151
+ const s = this._hookHandlers.get(t);
150
152
  if (s) {
151
153
  for (const i of s) {
152
154
  try {
153
- i(t);
154
- } catch (t) {
155
- this.emit("error", new Error(`Error in hook handler for event "${e}": ${t.message}`));
155
+ i(e);
156
+ } catch (e) {
157
+ this.emit("error", new Error(`Error in hook handler for event "${t}": ${e.message}`));
156
158
  }
157
159
  }
158
160
  }
@@ -162,19 +164,19 @@ var o = class extends r {
162
164
  }
163
165
  };
164
166
 
165
- var a = o;
167
+ var r = i;
166
168
 
167
- var n = class extends r {
169
+ var o = class extends s {
168
170
  enabled=true;
169
171
  hits=0;
170
172
  misses=0;
171
173
  sets=0;
172
174
  deletes=0;
173
175
  errors=0;
174
- constructor(e) {
176
+ constructor(t) {
175
177
  super();
176
- if (e !== void 0) {
177
- this.enabled = e;
178
+ if (t !== void 0) {
179
+ this.enabled = t;
178
180
  }
179
181
  this.reset();
180
182
  }
@@ -198,6 +200,15 @@ var n = class extends r {
198
200
  this.deletes++;
199
201
  }
200
202
  }
203
+ hitsOrMisses(t) {
204
+ for (const e of t) {
205
+ if (e === void 0) {
206
+ this.miss();
207
+ } else {
208
+ this.hit();
209
+ }
210
+ }
211
+ }
201
212
  reset() {
202
213
  this.hits = 0;
203
214
  this.misses = 0;
@@ -207,52 +218,57 @@ var n = class extends r {
207
218
  }
208
219
  };
209
220
 
210
- var h = n;
221
+ var a = o;
211
222
 
212
- var l = (e => {
213
- e["PRE_SET"] = "preSet";
214
- e["POST_SET"] = "postSet";
215
- e["PRE_GET"] = "preGet";
216
- e["POST_GET"] = "postGet";
217
- e["PRE_GET_MANY"] = "preGetMany";
218
- e["POST_GET_MANY"] = "postGetMany";
219
- e["PRE_DELETE"] = "preDelete";
220
- e["POST_DELETE"] = "postDelete";
221
- return e;
222
- })(l || {});
223
+ var n = (t => {
224
+ t["PRE_SET"] = "preSet";
225
+ t["POST_SET"] = "postSet";
226
+ t["PRE_GET"] = "preGet";
227
+ t["POST_GET"] = "postGet";
228
+ t["PRE_GET_MANY"] = "preGetMany";
229
+ t["POST_GET_MANY"] = "postGetMany";
230
+ t["PRE_GET_RAW"] = "preGetRaw";
231
+ t["POST_GET_RAW"] = "postGetRaw";
232
+ t["PRE_GET_MANY_RAW"] = "preGetManyRaw";
233
+ t["POST_GET_MANY_RAW"] = "postGetManyRaw";
234
+ t["PRE_DELETE"] = "preDelete";
235
+ t["POST_DELETE"] = "postDelete";
236
+ return t;
237
+ })(n || {});
223
238
 
224
- var c = [ "sqlite", "postgres", "mysql", "mongo", "redis", "valkey", "etcd" ];
239
+ var h = [ "sqlite", "postgres", "mysql", "mongo", "redis", "valkey", "etcd" ];
225
240
 
226
- var f = class extends r {
241
+ var l = class extends s {
227
242
  opts;
228
243
  iterator;
229
- hooks=new a;
230
- stats=new h(false);
244
+ hooks=new r;
245
+ stats=new a(false);
231
246
  _ttl;
232
247
  _namespace;
233
248
  _store=new Map;
234
- _serialize=t;
235
- _deserialize=s;
249
+ _serialize=defaultSerialize;
250
+ _deserialize=defaultDeserialize;
236
251
  _compression;
237
252
  _useKeyPrefix=true;
238
- constructor(e, i) {
253
+ _throwOnErrors=false;
254
+ constructor(t, e) {
239
255
  super();
240
- i ??= {};
241
256
  e ??= {};
257
+ t ??= {};
242
258
  this.opts = {
243
259
  namespace: "keyv",
244
- serialize: t,
245
- deserialize: s,
260
+ serialize: defaultSerialize,
261
+ deserialize: defaultDeserialize,
246
262
  emitErrors: true,
247
263
  store: new Map,
248
- ...i
264
+ ...e
249
265
  };
250
- if (e && e.get) {
251
- this.opts.store = e;
266
+ if (t && t.get) {
267
+ this.opts.store = t;
252
268
  } else {
253
269
  this.opts = {
254
270
  ...this.opts,
255
- ...e
271
+ ...t
256
272
  };
257
273
  }
258
274
  this._store = this.opts.store ?? new Map;
@@ -267,7 +283,7 @@ var f = class extends r {
267
283
  throw new Error("Invalid storage adapter");
268
284
  }
269
285
  if (typeof this._store.on === "function") {
270
- this._store.on("error", (e => this.emit("error", e)));
286
+ this._store.on("error", (t => this.emit("error", t)));
271
287
  }
272
288
  this._store.namespace = this._namespace;
273
289
  if (typeof this._store[Symbol.iterator] === "function" && this._store instanceof Map) {
@@ -285,24 +301,27 @@ var f = class extends r {
285
301
  if (this.opts.useKeyPrefix !== void 0) {
286
302
  this._useKeyPrefix = this.opts.useKeyPrefix;
287
303
  }
304
+ if (this.opts.throwOnErrors !== void 0) {
305
+ this._throwOnErrors = this.opts.throwOnErrors;
306
+ }
288
307
  }
289
308
  get store() {
290
309
  return this._store;
291
310
  }
292
- set store(e) {
293
- if (this._isValidStorageAdapter(e)) {
294
- this._store = e;
295
- this.opts.store = e;
296
- if (typeof e.on === "function") {
297
- e.on("error", (e => this.emit("error", e)));
311
+ set store(t) {
312
+ if (this._isValidStorageAdapter(t)) {
313
+ this._store = t;
314
+ this.opts.store = t;
315
+ if (typeof t.on === "function") {
316
+ t.on("error", (t => this.emit("error", t)));
298
317
  }
299
318
  if (this._namespace) {
300
319
  this._store.namespace = this._namespace;
301
320
  }
302
- if (typeof e[Symbol.iterator] === "function" && e instanceof Map) {
303
- this.iterator = this.generateIterator(e);
304
- } else if ("iterator" in e && e.opts && this._checkIterableAdapter()) {
305
- this.iterator = this.generateIterator(e.iterator.bind(e));
321
+ if (typeof t[Symbol.iterator] === "function" && t instanceof Map) {
322
+ this.iterator = this.generateIterator(t);
323
+ } else if ("iterator" in t && t.opts && this._checkIterableAdapter()) {
324
+ this.iterator = this.generateIterator(t.iterator?.bind(t));
306
325
  }
307
326
  } else {
308
327
  throw new Error("Invalid storage adapter");
@@ -311,187 +330,298 @@ var f = class extends r {
311
330
  get compression() {
312
331
  return this._compression;
313
332
  }
314
- set compression(e) {
315
- this._compression = e;
333
+ set compression(t) {
334
+ this._compression = t;
316
335
  }
317
336
  get namespace() {
318
337
  return this._namespace;
319
338
  }
320
- set namespace(e) {
321
- this._namespace = e;
322
- this.opts.namespace = e;
323
- this._store.namespace = e;
339
+ set namespace(t) {
340
+ this._namespace = t;
341
+ this.opts.namespace = t;
342
+ this._store.namespace = t;
324
343
  if (this.opts.store) {
325
- this.opts.store.namespace = e;
344
+ this.opts.store.namespace = t;
326
345
  }
327
346
  }
328
347
  get ttl() {
329
348
  return this._ttl;
330
349
  }
331
- set ttl(e) {
332
- this.opts.ttl = e;
333
- this._ttl = e;
350
+ set ttl(t) {
351
+ this.opts.ttl = t;
352
+ this._ttl = t;
334
353
  }
335
354
  get serialize() {
336
355
  return this._serialize;
337
356
  }
338
- set serialize(e) {
339
- this.opts.serialize = e;
340
- this._serialize = e;
357
+ set serialize(t) {
358
+ this.opts.serialize = t;
359
+ this._serialize = t;
341
360
  }
342
361
  get deserialize() {
343
362
  return this._deserialize;
344
363
  }
345
- set deserialize(e) {
346
- this.opts.deserialize = e;
347
- this._deserialize = e;
364
+ set deserialize(t) {
365
+ this.opts.deserialize = t;
366
+ this._deserialize = t;
348
367
  }
349
368
  get useKeyPrefix() {
350
369
  return this._useKeyPrefix;
351
370
  }
352
- set useKeyPrefix(e) {
353
- this._useKeyPrefix = e;
354
- this.opts.useKeyPrefix = e;
371
+ set useKeyPrefix(t) {
372
+ this._useKeyPrefix = t;
373
+ this.opts.useKeyPrefix = t;
374
+ }
375
+ get throwOnErrors() {
376
+ return this._throwOnErrors;
377
+ }
378
+ set throwOnErrors(t) {
379
+ this._throwOnErrors = t;
380
+ this.opts.throwOnErrors = t;
355
381
  }
356
- generateIterator(e) {
357
- const t = async function*() {
358
- for await (const [t, s] of typeof e === "function" ? e(this._store.namespace) : e) {
359
- const e = await this.deserializeData(s);
360
- if (this._useKeyPrefix && this._store.namespace && !t.includes(this._store.namespace)) {
382
+ generateIterator(t) {
383
+ const function_ = async function*() {
384
+ for await (const [e, s] of typeof t === "function" ? t(this._store.namespace) : t) {
385
+ const t = await this.deserializeData(s);
386
+ if (this._useKeyPrefix && this._store.namespace && !e.includes(this._store.namespace)) {
361
387
  continue;
362
388
  }
363
- if (typeof e.expires === "number" && Date.now() > e.expires) {
364
- this.delete(t);
389
+ if (typeof t.expires === "number" && Date.now() > t.expires) {
390
+ this.delete(e);
365
391
  continue;
366
392
  }
367
- yield [ this._getKeyUnprefix(t), e.value ];
393
+ yield [ this._getKeyUnprefix(e), t.value ];
368
394
  }
369
395
  };
370
- return t.bind(this);
396
+ return function_.bind(this);
371
397
  }
372
398
  _checkIterableAdapter() {
373
- return c.includes(this._store.opts.dialect) || c.some((e => this._store.opts.url.includes(e)));
399
+ return h.includes(this._store.opts.dialect) || h.some((t => this._store.opts.url.includes(t)));
374
400
  }
375
- _getKeyPrefix(e) {
401
+ _getKeyPrefix(t) {
376
402
  if (!this._useKeyPrefix) {
377
- return e;
403
+ return t;
378
404
  }
379
405
  if (!this._namespace) {
380
- return e;
406
+ return t;
381
407
  }
382
- return `${this._namespace}:${e}`;
408
+ return `${this._namespace}:${t}`;
383
409
  }
384
- _getKeyPrefixArray(e) {
410
+ _getKeyPrefixArray(t) {
385
411
  if (!this._useKeyPrefix) {
386
- return e;
412
+ return t;
387
413
  }
388
414
  if (!this._namespace) {
389
- return e;
415
+ return t;
390
416
  }
391
- return e.map((e => `${this._namespace}:${e}`));
417
+ return t.map((t => `${this._namespace}:${t}`));
392
418
  }
393
- _getKeyUnprefix(e) {
419
+ _getKeyUnprefix(t) {
394
420
  if (!this._useKeyPrefix) {
395
- return e;
421
+ return t;
396
422
  }
397
- return e.split(":").splice(1).join(":");
423
+ return t.split(":").splice(1).join(":");
398
424
  }
399
- _isValidStorageAdapter(e) {
400
- return e instanceof Map || typeof e.get === "function" && typeof e.set === "function" && typeof e.delete === "function" && typeof e.clear === "function";
425
+ _isValidStorageAdapter(t) {
426
+ return t instanceof Map || typeof t.get === "function" && typeof t.set === "function" && typeof t.delete === "function" && typeof t.clear === "function";
401
427
  }
402
- async get(e, t) {
428
+ async get(t, e) {
403
429
  const {store: s} = this.opts;
404
- const i = Array.isArray(e);
405
- const r = i ? this._getKeyPrefixArray(e) : this._getKeyPrefix(e);
406
- const o = e => typeof e.expires === "number" && Date.now() > e.expires;
430
+ const i = Array.isArray(t);
431
+ const r = i ? this._getKeyPrefixArray(t) : this._getKeyPrefix(t);
432
+ const isDataExpired = t => typeof t.expires === "number" && Date.now() > t.expires;
407
433
  if (i) {
408
- if (t?.raw === true) {
409
- return this.getMany(e, {
434
+ if (e?.raw === true) {
435
+ return this.getMany(t, {
410
436
  raw: true
411
437
  });
412
438
  }
413
- return this.getMany(e, {
439
+ return this.getMany(t, {
414
440
  raw: false
415
441
  });
416
442
  }
417
443
  this.hooks.trigger("preGet", {
418
444
  key: r
419
445
  });
420
- const a = await s.get(r);
421
- const n = typeof a === "string" || this.opts.compression ? await this.deserializeData(a) : a;
422
- if (n === void 0 || n === null) {
446
+ let o;
447
+ try {
448
+ o = await s.get(r);
449
+ } catch (t) {
450
+ if (this.throwOnErrors) {
451
+ throw t;
452
+ }
453
+ }
454
+ const a = typeof o === "string" || this.opts.compression ? await this.deserializeData(o) : o;
455
+ if (a === void 0 || a === null) {
456
+ this.hooks.trigger("postGet", {
457
+ key: r,
458
+ value: void 0
459
+ });
423
460
  this.stats.miss();
424
461
  return void 0;
425
462
  }
426
- if (o(n)) {
427
- await this.delete(e);
463
+ if (isDataExpired(a)) {
464
+ await this.delete(t);
465
+ this.hooks.trigger("postGet", {
466
+ key: r,
467
+ value: void 0
468
+ });
428
469
  this.stats.miss();
429
470
  return void 0;
430
471
  }
431
472
  this.hooks.trigger("postGet", {
432
473
  key: r,
433
- value: n
474
+ value: a
434
475
  });
435
476
  this.stats.hit();
436
- return t?.raw ? n : n.value;
477
+ return e?.raw ? a : a.value;
437
478
  }
438
- async getMany(e, t) {
479
+ async getMany(t, e) {
439
480
  const {store: s} = this.opts;
440
- const i = this._getKeyPrefixArray(e);
441
- const r = e => typeof e.expires === "number" && Date.now() > e.expires;
481
+ const i = this._getKeyPrefixArray(t);
482
+ const isDataExpired = t => typeof t.expires === "number" && Date.now() > t.expires;
442
483
  this.hooks.trigger("preGetMany", {
443
484
  keys: i
444
485
  });
445
486
  if (s.getMany === void 0) {
446
- const e = i.map((async e => {
447
- const i = await s.get(e);
448
- const o = typeof i === "string" || this.opts.compression ? await this.deserializeData(i) : i;
449
- if (o === void 0 || o === null) {
487
+ const t = i.map((async t => {
488
+ const i = await s.get(t);
489
+ const r = typeof i === "string" || this.opts.compression ? await this.deserializeData(i) : i;
490
+ if (r === void 0 || r === null) {
450
491
  return void 0;
451
492
  }
452
- if (r(o)) {
453
- await this.delete(e);
493
+ if (isDataExpired(r)) {
494
+ await this.delete(t);
454
495
  return void 0;
455
496
  }
456
- return t?.raw ? o : o.value;
497
+ return e?.raw ? r : r.value;
457
498
  }));
458
- const o = await Promise.allSettled(e);
459
- const a = o.map((e => e.value));
460
- this.hooks.trigger("postGetMany", a);
461
- if (a.length > 0) {
499
+ const r = await Promise.allSettled(t);
500
+ const o = r.map((t => t.value));
501
+ this.hooks.trigger("postGetMany", o);
502
+ if (o.length > 0) {
462
503
  this.stats.hit();
463
504
  }
464
- return a;
505
+ return o;
465
506
  }
466
- const o = await s.getMany(i);
507
+ const r = await s.getMany(i);
508
+ const o = [];
467
509
  const a = [];
468
- for (const s in o) {
469
- let i = o[s];
510
+ for (const s in r) {
511
+ let i = r[s];
470
512
  if (typeof i === "string") {
471
513
  i = await this.deserializeData(i);
472
514
  }
473
515
  if (i === void 0 || i === null) {
474
- a.push(void 0);
516
+ o.push(void 0);
475
517
  continue;
476
518
  }
477
- if (r(i)) {
478
- await this.delete(e[s]);
479
- a.push(void 0);
519
+ if (isDataExpired(i)) {
520
+ a.push(t[s]);
521
+ o.push(void 0);
480
522
  continue;
481
523
  }
482
- const n = t?.raw ? i : i.value;
483
- a.push(n);
524
+ const n = e?.raw ? i : i.value;
525
+ o.push(n);
484
526
  }
485
- this.hooks.trigger("postGetMany", a);
486
527
  if (a.length > 0) {
528
+ await this.deleteMany(a);
529
+ }
530
+ this.hooks.trigger("postGetMany", o);
531
+ if (o.length > 0) {
487
532
  this.stats.hit();
488
533
  }
489
- return a;
534
+ return o;
490
535
  }
491
- async set(e, t, s) {
536
+ async getRaw(t) {
537
+ const {store: e} = this.opts;
538
+ const s = this._getKeyPrefix(t);
539
+ this.hooks.trigger("preGetRaw", {
540
+ key: s
541
+ });
542
+ const i = await e.get(s);
543
+ if (i === void 0 || i === null) {
544
+ this.hooks.trigger("postGetRaw", {
545
+ key: s,
546
+ value: void 0
547
+ });
548
+ this.stats.miss();
549
+ return void 0;
550
+ }
551
+ const r = typeof i === "string" || this.opts.compression ? await this.deserializeData(i) : i;
552
+ if (r !== void 0 && r.expires !== void 0 && r.expires !== null && r.expires < Date.now()) {
553
+ this.hooks.trigger("postGetRaw", {
554
+ key: s,
555
+ value: void 0
556
+ });
557
+ this.stats.miss();
558
+ await this.delete(t);
559
+ return void 0;
560
+ }
561
+ this.stats.hit();
562
+ this.hooks.trigger("postGetRaw", {
563
+ key: s,
564
+ value: r
565
+ });
566
+ return r;
567
+ }
568
+ async getManyRaw(t) {
569
+ const {store: e} = this.opts;
570
+ const s = this._getKeyPrefixArray(t);
571
+ if (t.length === 0) {
572
+ const e = Array.from({
573
+ length: t.length
574
+ }).fill(void 0);
575
+ this.stats.misses += t.length;
576
+ this.hooks.trigger("postGetManyRaw", {
577
+ keys: s,
578
+ values: e
579
+ });
580
+ return e;
581
+ }
582
+ let i = [];
583
+ if (e.getMany === void 0) {
584
+ const t = s.map((async t => {
585
+ const s = await e.get(t);
586
+ if (s !== void 0 && s !== null) {
587
+ return this.deserializeData(s);
588
+ }
589
+ return void 0;
590
+ }));
591
+ const r = await Promise.allSettled(t);
592
+ i = r.map((t => t.value));
593
+ } else {
594
+ const t = await e.getMany(s);
595
+ for (const e of t) {
596
+ if (e !== void 0 && e !== null) {
597
+ i.push(await this.deserializeData(e));
598
+ } else {
599
+ i.push(void 0);
600
+ }
601
+ }
602
+ }
603
+ const r = [];
604
+ const isDataExpired = t => typeof t.expires === "number" && Date.now() > t.expires;
605
+ for (const [t, e] of i.entries()) {
606
+ if (e !== void 0 && isDataExpired(e)) {
607
+ r.push(s[t]);
608
+ i[t] = void 0;
609
+ }
610
+ }
611
+ if (r.length > 0) {
612
+ await this.deleteMany(r);
613
+ }
614
+ this.stats.hitsOrMisses(i);
615
+ this.hooks.trigger("postGetManyRaw", {
616
+ keys: s,
617
+ values: i
618
+ });
619
+ return i;
620
+ }
621
+ async set(t, e, s) {
492
622
  const i = {
493
- key: e,
494
- value: t,
623
+ key: t,
624
+ value: e,
495
625
  ttl: s
496
626
  };
497
627
  this.hooks.trigger("preSet", i);
@@ -513,13 +643,16 @@ var f = class extends r {
513
643
  const h = await this.serializeData(n);
514
644
  let l = true;
515
645
  try {
516
- const e = await o.set(r, h, i.ttl);
517
- if (typeof e === "boolean") {
518
- l = e;
646
+ const t = await o.set(r, h, i.ttl);
647
+ if (typeof t === "boolean") {
648
+ l = t;
519
649
  }
520
- } catch (e) {
650
+ } catch (t) {
521
651
  l = false;
522
- this.emit("error", e);
652
+ this.emit("error", t);
653
+ if (this._throwOnErrors) {
654
+ throw t;
655
+ }
523
656
  }
524
657
  this.hooks.trigger("postSet", {
525
658
  key: r,
@@ -529,63 +662,71 @@ var f = class extends r {
529
662
  this.stats.set();
530
663
  return l;
531
664
  }
532
- async setMany(e) {
533
- let t = [];
665
+ async setMany(t) {
666
+ let e = [];
534
667
  try {
535
- if (this._store.setMany !== void 0) {
536
- const s = await Promise.all(e.map((async ({key: e, value: t, ttl: s}) => {
668
+ if (this._store.setMany === void 0) {
669
+ const s = [];
670
+ for (const e of t) {
671
+ s.push(this.set(e.key, e.value, e.ttl));
672
+ }
673
+ const i = await Promise.all(s);
674
+ e = i;
675
+ } else {
676
+ const s = await Promise.all(t.map((async ({key: t, value: e, ttl: s}) => {
537
677
  s ??= this._ttl;
538
678
  if (s === 0) {
539
679
  s = void 0;
540
680
  }
541
681
  const i = typeof s === "number" ? Date.now() + s : void 0;
542
- if (typeof t === "symbol") {
682
+ if (typeof e === "symbol") {
543
683
  this.emit("error", "symbol cannot be serialized");
544
684
  throw new Error("symbol cannot be serialized");
545
685
  }
546
686
  const r = {
547
- value: t,
687
+ value: e,
548
688
  expires: i
549
689
  };
550
690
  const o = await this.serializeData(r);
691
+ const a = this._getKeyPrefix(t);
551
692
  return {
552
- key: e,
693
+ key: a,
553
694
  value: o,
554
695
  ttl: s
555
696
  };
556
697
  })));
557
- t = await this._store.setMany(s);
698
+ e = await this._store.setMany(s);
558
699
  }
559
- const s = [];
560
- for (const t of e) {
561
- s.push(this.set(t.key, t.value, t.ttl));
562
- }
563
- const i = await Promise.allSettled(s);
564
- t = i.map((e => e.value));
565
700
  } catch (s) {
566
701
  this.emit("error", s);
567
- t = e.map((() => false));
702
+ if (this._throwOnErrors) {
703
+ throw s;
704
+ }
705
+ e = t.map((() => false));
568
706
  }
569
- return t;
707
+ return e;
570
708
  }
571
- async delete(e) {
572
- const {store: t} = this.opts;
573
- if (Array.isArray(e)) {
574
- return this.deleteMany(e);
709
+ async delete(t) {
710
+ const {store: e} = this.opts;
711
+ if (Array.isArray(t)) {
712
+ return this.deleteMany(t);
575
713
  }
576
- const s = this._getKeyPrefix(e);
714
+ const s = this._getKeyPrefix(t);
577
715
  this.hooks.trigger("preDelete", {
578
716
  key: s
579
717
  });
580
718
  let i = true;
581
719
  try {
582
- const e = await t.delete(s);
583
- if (typeof e === "boolean") {
584
- i = e;
720
+ const t = await e.delete(s);
721
+ if (typeof t === "boolean") {
722
+ i = t;
585
723
  }
586
- } catch (e) {
724
+ } catch (t) {
587
725
  i = false;
588
- this.emit("error", e);
726
+ this.emit("error", t);
727
+ if (this._throwOnErrors) {
728
+ throw t;
729
+ }
589
730
  }
590
731
  this.hooks.trigger("postDelete", {
591
732
  key: s,
@@ -594,69 +735,79 @@ var f = class extends r {
594
735
  this.stats.delete();
595
736
  return i;
596
737
  }
597
- async deleteMany(e) {
738
+ async deleteMany(t) {
598
739
  try {
599
- const {store: t} = this.opts;
600
- const s = this._getKeyPrefixArray(e);
740
+ const {store: e} = this.opts;
741
+ const s = this._getKeyPrefixArray(t);
601
742
  this.hooks.trigger("preDelete", {
602
743
  key: s
603
744
  });
604
- if (t.deleteMany !== void 0) {
605
- return await t.deleteMany(s);
745
+ if (e.deleteMany !== void 0) {
746
+ return await e.deleteMany(s);
606
747
  }
607
- const i = s.map((async e => t.delete(e)));
608
- const r = await Promise.allSettled(i);
609
- const o = r.every((e => e.value === true));
748
+ const i = s.map((async t => e.delete(t)));
749
+ const r = await Promise.all(i);
750
+ const o = r.every(Boolean);
610
751
  this.hooks.trigger("postDelete", {
611
752
  key: s,
612
753
  value: o
613
754
  });
614
755
  return o;
615
- } catch (e) {
616
- this.emit("error", e);
756
+ } catch (t) {
757
+ this.emit("error", t);
758
+ if (this._throwOnErrors) {
759
+ throw t;
760
+ }
617
761
  return false;
618
762
  }
619
763
  }
620
764
  async clear() {
621
765
  this.emit("clear");
622
- const {store: e} = this.opts;
766
+ const {store: t} = this.opts;
623
767
  try {
624
- await e.clear();
625
- } catch (e) {
626
- this.emit("error", e);
768
+ await t.clear();
769
+ } catch (t) {
770
+ this.emit("error", t);
771
+ if (this._throwOnErrors) {
772
+ throw t;
773
+ }
627
774
  }
628
775
  }
629
- async has(e) {
630
- if (Array.isArray(e)) {
631
- return this.hasMany(e);
776
+ async has(t) {
777
+ if (Array.isArray(t)) {
778
+ return this.hasMany(t);
632
779
  }
633
- const t = this._getKeyPrefix(e);
780
+ const e = this._getKeyPrefix(t);
634
781
  const {store: s} = this.opts;
635
782
  if (s.has !== void 0 && !(s instanceof Map)) {
636
- return s.has(t);
783
+ return s.has(e);
637
784
  }
638
785
  let i;
639
786
  try {
640
- i = await s.get(t);
641
- } catch (e) {
642
- this.emit("error", e);
787
+ i = await s.get(e);
788
+ } catch (t) {
789
+ this.emit("error", t);
790
+ if (this._throwOnErrors) {
791
+ throw t;
792
+ }
793
+ return false;
643
794
  }
644
795
  if (i) {
645
- const e = await this.deserializeData(i);
646
- if (e) {
647
- if (e.expires === void 0 || e.expires === null) {
796
+ const t = await this.deserializeData(i);
797
+ if (t) {
798
+ if (t.expires === void 0 || t.expires === null) {
648
799
  return true;
649
800
  }
650
- return e.expires > Date.now();
801
+ return t.expires > Date.now();
651
802
  }
652
803
  }
653
804
  return false;
654
805
  }
655
- async hasMany(e) {
656
- const t = this._getKeyPrefixArray(e);
806
+ async hasMany(t) {
807
+ const e = this._getKeyPrefixArray(t);
657
808
  const {store: s} = this.opts;
658
809
  if (s.hasMany !== void 0) {
659
- return s.hasMany(t);
810
+ return s.hasMany(e);
660
811
  }
661
812
  const i = [];
662
813
  for (const e of t) {
@@ -665,52 +816,52 @@ var f = class extends r {
665
816
  return i;
666
817
  }
667
818
  async disconnect() {
668
- const {store: e} = this.opts;
819
+ const {store: t} = this.opts;
669
820
  this.emit("disconnect");
670
- if (typeof e.disconnect === "function") {
671
- return e.disconnect();
821
+ if (typeof t.disconnect === "function") {
822
+ return t.disconnect();
672
823
  }
673
824
  }
674
- emit(e, ...t) {
675
- if (e === "error" && !this.opts.emitErrors) {
825
+ emit(t, ...e) {
826
+ if (t === "error" && !this.opts.emitErrors) {
676
827
  return;
677
828
  }
678
- super.emit(e, ...t);
829
+ super.emit(t, ...e);
679
830
  }
680
- async serializeData(e) {
831
+ async serializeData(t) {
681
832
  if (!this._serialize) {
682
- return e;
833
+ return t;
683
834
  }
684
835
  if (this._compression?.compress) {
685
836
  return this._serialize({
686
- value: await this._compression.compress(e.value),
687
- expires: e.expires
837
+ value: await this._compression.compress(t.value),
838
+ expires: t.expires
688
839
  });
689
840
  }
690
- return this._serialize(e);
841
+ return this._serialize(t);
691
842
  }
692
- async deserializeData(e) {
843
+ async deserializeData(t) {
693
844
  if (!this._deserialize) {
694
- return e;
845
+ return t;
695
846
  }
696
- if (this._compression?.decompress && typeof e === "string") {
697
- const t = await this._deserialize(e);
847
+ if (this._compression?.decompress && typeof t === "string") {
848
+ const e = await this._deserialize(t);
698
849
  return {
699
- value: await this._compression.decompress(t?.value),
700
- expires: t?.expires
850
+ value: await this._compression.decompress(e?.value),
851
+ expires: e?.expires
701
852
  };
702
853
  }
703
- if (typeof e === "string") {
704
- return this._deserialize(e);
854
+ if (typeof t === "string") {
855
+ return this._deserialize(t);
705
856
  }
706
857
  return void 0;
707
858
  }
708
859
  };
709
860
 
710
- var p = f;
861
+ var c = l;
711
862
 
712
- exports.Keyv = f;
863
+ exports.Keyv = l;
713
864
 
714
- exports.defaultDeserialize = s;
865
+ exports.defaultDeserialize = defaultDeserialize;
715
866
 
716
- exports.index_default = p;
867
+ exports.index_default = c;