@powfix/core-js 0.14.5 → 0.15.0-beta-1

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 (322) hide show
  1. package/dist/client/constants/index.browser.d.ts +6 -0
  2. package/dist/{src → client}/constants/index.browser.js +6 -6
  3. package/dist/client/index.browser.d.ts +7 -0
  4. package/dist/{src → client}/index.browser.js +7 -7
  5. package/dist/{src → client}/interfaces/Point3.d.ts +1 -1
  6. package/dist/client/interfaces/index.browser.d.ts +4 -0
  7. package/dist/{src → client}/interfaces/index.browser.js +4 -4
  8. package/dist/{src → client}/managers/SessionManager.d.ts +2 -2
  9. package/dist/{src → client}/managers/SessionManager.type.d.ts +1 -1
  10. package/dist/client/managers/index.browser.d.ts +2 -0
  11. package/dist/{src → client}/managers/index.browser.js +2 -2
  12. package/dist/client/scripts/index.browser.d.ts +1 -0
  13. package/dist/{src → client}/scripts/index.browser.js +1 -1
  14. package/dist/client/services/index.browser.d.ts +1 -0
  15. package/dist/{src → client}/services/index.browser.js +1 -1
  16. package/dist/{src → client}/services/time/TimeService.d.ts +1 -1
  17. package/dist/client/services/time/index.d.ts +2 -0
  18. package/dist/client/services/time/index.js +18 -0
  19. package/dist/client/types/index.browser.d.ts +2 -0
  20. package/dist/{src → client}/types/index.browser.js +2 -2
  21. package/dist/{src → client}/utils/ArrayUtils.js +2 -2
  22. package/dist/{src → client}/utils/CoordinateUtils.d.ts +1 -1
  23. package/dist/{src → client}/utils/DateUtils.d.ts +1 -1
  24. package/dist/{src → client}/utils/DateUtils.js +17 -17
  25. package/dist/{src → client}/utils/JuminNumberUtils.js +2 -2
  26. package/dist/{src → client}/utils/ObjectIdUtils.js +3 -3
  27. package/dist/{src → client}/utils/Point3Utils.d.ts +1 -1
  28. package/dist/{src → client}/utils/Sequencer.js +2 -2
  29. package/dist/{src → client}/utils/UuidUtils.js +5 -2
  30. package/dist/{src → client}/utils/global/fallbackIfNull.js +2 -2
  31. package/dist/{src → client}/utils/global/fallbackIfUndefined.js +2 -2
  32. package/dist/client/utils/global/index.d.ts +11 -0
  33. package/dist/client/utils/global/index.js +27 -0
  34. package/dist/{src → client}/utils/global/processFirstNonNullish.js +2 -2
  35. package/dist/client/utils/index.browser.d.ts +17 -0
  36. package/dist/client/utils/index.browser.js +33 -0
  37. package/dist/client/utils/try-catch/index.d.ts +1 -0
  38. package/dist/{src/interfaces/nodejs/db → client/utils/try-catch}/index.js +1 -1
  39. package/dist/server/constants/COORDINATE.d.ts +7 -0
  40. package/dist/server/constants/COORDINATE.js +10 -0
  41. package/dist/server/constants/CRUD.d.ts +9 -0
  42. package/dist/server/constants/CRUD.js +22 -0
  43. package/dist/server/constants/DATE.d.ts +13 -0
  44. package/dist/server/constants/DATE.js +26 -0
  45. package/dist/server/constants/DISTANCE.d.ts +13 -0
  46. package/dist/server/constants/DISTANCE.js +18 -0
  47. package/dist/server/constants/DURATION.d.ts +16 -0
  48. package/dist/server/constants/DURATION.js +21 -0
  49. package/dist/server/constants/NOT_NULL.d.ts +1 -0
  50. package/dist/server/constants/NOT_NULL.js +4 -0
  51. package/dist/server/constants/index.browser.d.ts +6 -0
  52. package/dist/server/constants/index.browser.js +22 -0
  53. package/dist/server/constants/index.d.ts +2 -0
  54. package/dist/{src/interfaces → server/constants}/index.js +2 -2
  55. package/dist/server/constants/nodejs/index.d.ts +2 -0
  56. package/dist/{src → server}/constants/nodejs/index.js +2 -2
  57. package/dist/server/index.browser.d.ts +7 -0
  58. package/dist/server/index.browser.js +23 -0
  59. package/dist/server/index.d.ts +8 -0
  60. package/dist/{src → server}/index.js +8 -8
  61. package/dist/server/interfaces/Coordinate.d.ts +8 -0
  62. package/dist/server/interfaces/Point2.d.ts +4 -0
  63. package/dist/server/interfaces/Point3.d.ts +4 -0
  64. package/dist/server/interfaces/StorageProvider.d.ts +7 -0
  65. package/dist/server/interfaces/index.browser.d.ts +4 -0
  66. package/dist/server/interfaces/index.browser.js +20 -0
  67. package/dist/server/interfaces/index.d.ts +2 -0
  68. package/dist/server/interfaces/index.js +18 -0
  69. package/dist/server/interfaces/nodejs/db/index.d.ts +1 -0
  70. package/dist/server/interfaces/nodejs/db/index.js +17 -0
  71. package/dist/{src → server}/interfaces/nodejs/db/sequelize/Hook.d.ts +2 -2
  72. package/dist/{src → server}/interfaces/nodejs/db/sequelize/HookFn.d.ts +1 -1
  73. package/dist/server/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +4 -0
  74. package/dist/server/interfaces/nodejs/db/sequelize/UpsertOptions.js +2 -0
  75. package/dist/server/interfaces/nodejs/db/sequelize/index.d.ts +6 -0
  76. package/dist/server/interfaces/nodejs/db/sequelize/index.js +22 -0
  77. package/dist/server/interfaces/nodejs/index.d.ts +1 -0
  78. package/dist/{src/utils/try-catch → server/interfaces/nodejs}/index.js +1 -1
  79. package/dist/server/managers/SessionManager.d.ts +15 -0
  80. package/dist/server/managers/SessionManager.js +134 -0
  81. package/dist/server/managers/SessionManager.type.d.ts +9 -0
  82. package/dist/server/managers/SessionManager.type.js +2 -0
  83. package/dist/{src → server}/managers/TransactionManager.d.ts +2 -2
  84. package/dist/{src → server}/managers/TransactionManager.js +13 -13
  85. package/dist/{src → server}/managers/TransactionManager.types.d.ts +1 -1
  86. package/dist/server/managers/TransactionManager.types.js +2 -0
  87. package/dist/server/managers/index.browser.d.ts +2 -0
  88. package/dist/server/managers/index.browser.js +18 -0
  89. package/dist/server/managers/index.d.ts +2 -0
  90. package/dist/server/managers/index.js +18 -0
  91. package/dist/server/scripts/base64Polyfill.d.ts +1 -0
  92. package/dist/server/scripts/base64Polyfill.js +14 -0
  93. package/dist/server/scripts/index.browser.d.ts +1 -0
  94. package/dist/{index.browser.js → server/scripts/index.browser.js} +1 -1
  95. package/dist/server/scripts/index.d.ts +1 -0
  96. package/dist/{index.js → server/scripts/index.js} +1 -1
  97. package/dist/server/services/index.browser.d.ts +1 -0
  98. package/dist/{src/scripts/index.js → server/services/index.browser.js} +1 -1
  99. package/dist/server/services/index.d.ts +2 -0
  100. package/dist/{src/constants → server/services}/index.js +2 -2
  101. package/dist/{src → server}/services/redis/RedisPublisher.d.ts +1 -1
  102. package/dist/{src → server}/services/redis/RedisPublisher.js +2 -2
  103. package/dist/{src → server}/services/redis/RedisSubscriber.d.ts +2 -2
  104. package/dist/{src → server}/services/redis/RedisSubscriber.js +5 -5
  105. package/dist/server/services/redis/index.d.ts +3 -0
  106. package/dist/{src → server}/services/redis/index.js +3 -3
  107. package/dist/server/services/time/TimeService.d.ts +31 -0
  108. package/dist/server/services/time/TimeService.js +180 -0
  109. package/dist/server/services/time/TimeService.type.d.ts +21 -0
  110. package/dist/server/services/time/TimeService.type.js +2 -0
  111. package/dist/server/services/time/index.d.ts +2 -0
  112. package/dist/server/services/time/index.js +18 -0
  113. package/dist/server/types/IntRage.d.ts +3 -0
  114. package/dist/server/types/IntRage.js +2 -0
  115. package/dist/server/types/PartialExcept.d.ts +1 -0
  116. package/dist/server/types/PartialExcept.js +2 -0
  117. package/dist/server/types/UpsertResult.js +2 -0
  118. package/dist/server/types/index.browser.d.ts +2 -0
  119. package/dist/server/types/index.browser.js +18 -0
  120. package/dist/server/types/index.d.ts +2 -0
  121. package/dist/server/types/index.js +18 -0
  122. package/dist/server/utils/ArrayUtils.d.ts +12 -0
  123. package/dist/server/utils/ArrayUtils.js +30 -0
  124. package/dist/server/utils/AxiosUtils.d.ts +5 -0
  125. package/dist/server/utils/AxiosUtils.js +53 -0
  126. package/dist/server/utils/BooleanUtils.d.ts +1 -0
  127. package/dist/server/utils/BooleanUtils.js +8 -0
  128. package/dist/server/utils/Calc.d.ts +4 -0
  129. package/dist/server/utils/Calc.js +27 -0
  130. package/dist/server/utils/CoordinateUtils.d.ts +8 -0
  131. package/dist/server/utils/CoordinateUtils.js +42 -0
  132. package/dist/server/utils/DateUtils.d.ts +24 -0
  133. package/dist/server/utils/DateUtils.js +310 -0
  134. package/dist/server/utils/JuminNumberUtils.d.ts +4 -0
  135. package/dist/server/utils/JuminNumberUtils.js +50 -0
  136. package/dist/server/utils/NumberUtils.d.ts +4 -0
  137. package/dist/server/utils/NumberUtils.js +25 -0
  138. package/dist/server/utils/ObjectIdUtils.d.ts +4 -0
  139. package/dist/server/utils/ObjectIdUtils.js +24 -0
  140. package/dist/server/utils/Point3Utils.d.ts +4 -0
  141. package/dist/server/utils/Point3Utils.js +12 -0
  142. package/dist/server/utils/RandomUtils.d.ts +8 -0
  143. package/dist/server/utils/RandomUtils.js +64 -0
  144. package/dist/server/utils/Sequencer.d.ts +38 -0
  145. package/dist/server/utils/Sequencer.js +148 -0
  146. package/dist/server/utils/StringUtils.d.ts +5 -0
  147. package/dist/server/utils/StringUtils.js +37 -0
  148. package/dist/server/utils/UuidUtils.d.ts +14 -0
  149. package/dist/server/utils/UuidUtils.js +49 -0
  150. package/dist/server/utils/Validator.d.ts +48 -0
  151. package/dist/server/utils/Validator.js +118 -0
  152. package/dist/server/utils/global/between.d.ts +1 -0
  153. package/dist/server/utils/global/between.js +7 -0
  154. package/dist/server/utils/global/castArray.d.ts +1 -0
  155. package/dist/server/utils/global/castArray.js +6 -0
  156. package/dist/server/utils/global/circularDistance.d.ts +1 -0
  157. package/dist/server/utils/global/circularDistance.js +14 -0
  158. package/dist/server/utils/global/fallbackIfEqual.d.ts +1 -0
  159. package/dist/server/utils/global/fallbackIfEqual.js +9 -0
  160. package/dist/server/utils/global/fallbackIfNull.d.ts +1 -0
  161. package/dist/server/utils/global/fallbackIfNull.js +7 -0
  162. package/dist/server/utils/global/fallbackIfUndefined.d.ts +1 -0
  163. package/dist/server/utils/global/fallbackIfUndefined.js +7 -0
  164. package/dist/server/utils/global/firstNonNullish.d.ts +1 -0
  165. package/dist/server/utils/global/firstNonNullish.js +13 -0
  166. package/dist/server/utils/global/flat.d.ts +14 -0
  167. package/dist/server/utils/global/flat.js +117 -0
  168. package/dist/server/utils/global/index.d.ts +11 -0
  169. package/dist/server/utils/global/index.js +27 -0
  170. package/dist/server/utils/global/processFirstNonNullish.d.ts +1 -0
  171. package/dist/server/utils/global/processFirstNonNullish.js +11 -0
  172. package/dist/server/utils/global/pureEnum.d.ts +8 -0
  173. package/dist/server/utils/global/pureEnum.js +14 -0
  174. package/dist/server/utils/global/sleep.d.ts +1 -0
  175. package/dist/server/utils/global/sleep.js +5 -0
  176. package/dist/server/utils/index.browser.d.ts +17 -0
  177. package/dist/server/utils/index.browser.js +33 -0
  178. package/dist/server/utils/index.d.ts +2 -0
  179. package/dist/server/utils/index.js +18 -0
  180. package/dist/{src → server}/utils/nodejs/HookUtils.d.ts +1 -1
  181. package/dist/server/utils/nodejs/index.d.ts +2 -0
  182. package/dist/{src → server}/utils/nodejs/index.js +3 -3
  183. package/dist/{src → server}/utils/nodejs/sequelize-utils/SequelizeUtils.d.ts +1 -1
  184. package/dist/{src → server}/utils/nodejs/sequelize-utils/SequelizeUtils.js +8 -8
  185. package/dist/server/utils/nodejs/sequelize-utils/index.d.ts +1 -0
  186. package/dist/{src → server}/utils/nodejs/sequelize-utils/index.js +2 -2
  187. package/dist/server/utils/nodejs/sequelize-utils/types.js +2 -0
  188. package/dist/server/utils/try-catch/TryCatch.d.ts +24 -0
  189. package/dist/server/utils/try-catch/TryCatch.js +78 -0
  190. package/dist/server/utils/try-catch/index.d.ts +1 -0
  191. package/dist/{src/interfaces/nodejs → server/utils/try-catch}/index.js +1 -1
  192. package/package.json +56 -52
  193. package/dist/index.browser.d.ts +0 -1
  194. package/dist/index.d.ts +0 -1
  195. package/dist/src/constants/index.browser.d.ts +0 -6
  196. package/dist/src/constants/index.d.ts +0 -2
  197. package/dist/src/constants/nodejs/index.d.ts +0 -2
  198. package/dist/src/index.browser.d.ts +0 -7
  199. package/dist/src/index.d.ts +0 -8
  200. package/dist/src/interfaces/index.browser.d.ts +0 -4
  201. package/dist/src/interfaces/index.d.ts +0 -2
  202. package/dist/src/interfaces/nodejs/db/index.d.ts +0 -1
  203. package/dist/src/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +0 -4
  204. package/dist/src/interfaces/nodejs/db/sequelize/index.d.ts +0 -6
  205. package/dist/src/interfaces/nodejs/db/sequelize/index.js +0 -22
  206. package/dist/src/interfaces/nodejs/index.d.ts +0 -1
  207. package/dist/src/managers/index.browser.d.ts +0 -2
  208. package/dist/src/managers/index.d.ts +0 -2
  209. package/dist/src/managers/index.js +0 -18
  210. package/dist/src/scripts/index.browser.d.ts +0 -1
  211. package/dist/src/scripts/index.d.ts +0 -1
  212. package/dist/src/services/index.browser.d.ts +0 -1
  213. package/dist/src/services/index.d.ts +0 -2
  214. package/dist/src/services/index.js +0 -18
  215. package/dist/src/services/redis/index.d.ts +0 -3
  216. package/dist/src/services/time/index.d.ts +0 -2
  217. package/dist/src/services/time/index.js +0 -18
  218. package/dist/src/types/index.browser.d.ts +0 -2
  219. package/dist/src/types/index.d.ts +0 -2
  220. package/dist/src/types/index.js +0 -18
  221. package/dist/src/utils/global/index.d.ts +0 -11
  222. package/dist/src/utils/global/index.js +0 -27
  223. package/dist/src/utils/index.browser.d.ts +0 -17
  224. package/dist/src/utils/index.browser.js +0 -33
  225. package/dist/src/utils/index.d.ts +0 -2
  226. package/dist/src/utils/index.js +0 -18
  227. package/dist/src/utils/nodejs/index.d.ts +0 -2
  228. package/dist/src/utils/nodejs/sequelize-utils/index.d.ts +0 -1
  229. package/dist/src/utils/try-catch/index.d.ts +0 -1
  230. /package/dist/{src → client}/constants/COORDINATE.d.ts +0 -0
  231. /package/dist/{src → client}/constants/COORDINATE.js +0 -0
  232. /package/dist/{src → client}/constants/CRUD.d.ts +0 -0
  233. /package/dist/{src → client}/constants/CRUD.js +0 -0
  234. /package/dist/{src → client}/constants/DATE.d.ts +0 -0
  235. /package/dist/{src → client}/constants/DATE.js +0 -0
  236. /package/dist/{src → client}/constants/DISTANCE.d.ts +0 -0
  237. /package/dist/{src → client}/constants/DISTANCE.js +0 -0
  238. /package/dist/{src → client}/constants/DURATION.d.ts +0 -0
  239. /package/dist/{src → client}/constants/DURATION.js +0 -0
  240. /package/dist/{src → client}/constants/NOT_NULL.d.ts +0 -0
  241. /package/dist/{src → client}/constants/NOT_NULL.js +0 -0
  242. /package/dist/{src → client}/interfaces/Coordinate.d.ts +0 -0
  243. /package/dist/{src → client}/interfaces/Coordinate.js +0 -0
  244. /package/dist/{src → client}/interfaces/Point2.d.ts +0 -0
  245. /package/dist/{src → client}/interfaces/Point2.js +0 -0
  246. /package/dist/{src → client}/interfaces/Point3.js +0 -0
  247. /package/dist/{src → client}/interfaces/StorageProvider.d.ts +0 -0
  248. /package/dist/{src → client}/interfaces/StorageProvider.js +0 -0
  249. /package/dist/{src → client}/managers/SessionManager.js +0 -0
  250. /package/dist/{src → client}/managers/SessionManager.type.js +0 -0
  251. /package/dist/{src → client}/scripts/base64Polyfill.d.ts +0 -0
  252. /package/dist/{src → client}/scripts/base64Polyfill.js +0 -0
  253. /package/dist/{src → client}/services/time/TimeService.js +0 -0
  254. /package/dist/{src → client}/services/time/TimeService.type.d.ts +0 -0
  255. /package/dist/{src → client}/services/time/TimeService.type.js +0 -0
  256. /package/dist/{src → client}/types/IntRage.d.ts +0 -0
  257. /package/dist/{src → client}/types/IntRage.js +0 -0
  258. /package/dist/{src → client}/types/PartialExcept.d.ts +0 -0
  259. /package/dist/{src → client}/types/PartialExcept.js +0 -0
  260. /package/dist/{src → client}/utils/ArrayUtils.d.ts +0 -0
  261. /package/dist/{src → client}/utils/AxiosUtils.d.ts +0 -0
  262. /package/dist/{src → client}/utils/AxiosUtils.js +0 -0
  263. /package/dist/{src → client}/utils/BooleanUtils.d.ts +0 -0
  264. /package/dist/{src → client}/utils/BooleanUtils.js +0 -0
  265. /package/dist/{src → client}/utils/Calc.d.ts +0 -0
  266. /package/dist/{src → client}/utils/Calc.js +0 -0
  267. /package/dist/{src → client}/utils/CoordinateUtils.js +0 -0
  268. /package/dist/{src → client}/utils/JuminNumberUtils.d.ts +0 -0
  269. /package/dist/{src → client}/utils/NumberUtils.d.ts +0 -0
  270. /package/dist/{src → client}/utils/NumberUtils.js +0 -0
  271. /package/dist/{src → client}/utils/ObjectIdUtils.d.ts +0 -0
  272. /package/dist/{src → client}/utils/Point3Utils.js +0 -0
  273. /package/dist/{src → client}/utils/RandomUtils.d.ts +0 -0
  274. /package/dist/{src → client}/utils/RandomUtils.js +0 -0
  275. /package/dist/{src → client}/utils/Sequencer.d.ts +0 -0
  276. /package/dist/{src → client}/utils/StringUtils.d.ts +0 -0
  277. /package/dist/{src → client}/utils/StringUtils.js +0 -0
  278. /package/dist/{src → client}/utils/UuidUtils.d.ts +0 -0
  279. /package/dist/{src → client}/utils/Validator.d.ts +0 -0
  280. /package/dist/{src → client}/utils/Validator.js +0 -0
  281. /package/dist/{src → client}/utils/global/between.d.ts +0 -0
  282. /package/dist/{src → client}/utils/global/between.js +0 -0
  283. /package/dist/{src → client}/utils/global/castArray.d.ts +0 -0
  284. /package/dist/{src → client}/utils/global/castArray.js +0 -0
  285. /package/dist/{src → client}/utils/global/circularDistance.d.ts +0 -0
  286. /package/dist/{src → client}/utils/global/circularDistance.js +0 -0
  287. /package/dist/{src → client}/utils/global/fallbackIfEqual.d.ts +0 -0
  288. /package/dist/{src → client}/utils/global/fallbackIfEqual.js +0 -0
  289. /package/dist/{src → client}/utils/global/fallbackIfNull.d.ts +0 -0
  290. /package/dist/{src → client}/utils/global/fallbackIfUndefined.d.ts +0 -0
  291. /package/dist/{src → client}/utils/global/firstNonNullish.d.ts +0 -0
  292. /package/dist/{src → client}/utils/global/firstNonNullish.js +0 -0
  293. /package/dist/{src → client}/utils/global/flat.d.ts +0 -0
  294. /package/dist/{src → client}/utils/global/flat.js +0 -0
  295. /package/dist/{src → client}/utils/global/processFirstNonNullish.d.ts +0 -0
  296. /package/dist/{src → client}/utils/global/pureEnum.d.ts +0 -0
  297. /package/dist/{src → client}/utils/global/pureEnum.js +0 -0
  298. /package/dist/{src → client}/utils/global/sleep.d.ts +0 -0
  299. /package/dist/{src → client}/utils/global/sleep.js +0 -0
  300. /package/dist/{src → client}/utils/try-catch/TryCatch.d.ts +0 -0
  301. /package/dist/{src → client}/utils/try-catch/TryCatch.js +0 -0
  302. /package/dist/{src → server}/constants/nodejs/TransactionManagerLogLevel.d.ts +0 -0
  303. /package/dist/{src → server}/constants/nodejs/TransactionManagerLogLevel.js +0 -0
  304. /package/dist/{src → server}/constants/nodejs/TransactionManagerTimeoutAction.d.ts +0 -0
  305. /package/dist/{src → server}/constants/nodejs/TransactionManagerTimeoutAction.js +0 -0
  306. /package/dist/{src/interfaces/nodejs/db/sequelize/Hook.js → server/interfaces/Coordinate.js} +0 -0
  307. /package/dist/{src/interfaces/nodejs/db/sequelize/HookFn.js → server/interfaces/Point2.js} +0 -0
  308. /package/dist/{src/interfaces/nodejs/db/sequelize/HookType.js → server/interfaces/Point3.js} +0 -0
  309. /package/dist/{src/interfaces/nodejs/db/sequelize/ReloadOption.js → server/interfaces/StorageProvider.js} +0 -0
  310. /package/dist/{src/interfaces/nodejs/db/sequelize/TransactionOption.js → server/interfaces/nodejs/db/sequelize/Hook.js} +0 -0
  311. /package/dist/{src/interfaces/nodejs/db/sequelize/UpsertOptions.js → server/interfaces/nodejs/db/sequelize/HookFn.js} +0 -0
  312. /package/dist/{src → server}/interfaces/nodejs/db/sequelize/HookType.d.ts +0 -0
  313. /package/dist/{src/managers/TransactionManager.types.js → server/interfaces/nodejs/db/sequelize/HookType.js} +0 -0
  314. /package/dist/{src → server}/interfaces/nodejs/db/sequelize/ReloadOption.d.ts +0 -0
  315. /package/dist/{src/types/UpsertResult.js → server/interfaces/nodejs/db/sequelize/ReloadOption.js} +0 -0
  316. /package/dist/{src → server}/interfaces/nodejs/db/sequelize/TransactionOption.d.ts +0 -0
  317. /package/dist/{src/utils/nodejs/sequelize-utils/types.js → server/interfaces/nodejs/db/sequelize/TransactionOption.js} +0 -0
  318. /package/dist/{src → server}/services/redis/RedisClient.d.ts +0 -0
  319. /package/dist/{src → server}/services/redis/RedisClient.js +0 -0
  320. /package/dist/{src → server}/types/UpsertResult.d.ts +0 -0
  321. /package/dist/{src → server}/utils/nodejs/HookUtils.js +0 -0
  322. /package/dist/{src → server}/utils/nodejs/sequelize-utils/types.d.ts +0 -0
@@ -0,0 +1,38 @@
1
+ import EventEmitter3 from 'eventemitter3';
2
+ export interface Sequence {
3
+ key: string;
4
+ required?: boolean;
5
+ minimumExecutionTime?: number;
6
+ task: Function;
7
+ description?: string;
8
+ }
9
+ export declare enum SequencerStatus {
10
+ IDLE = 0,
11
+ RUNNING = 1,
12
+ ERROR = 2,
13
+ DONE = 3
14
+ }
15
+ export interface SequencerOption {
16
+ sequences?: Sequence[];
17
+ minimumExecutionTime?: number;
18
+ }
19
+ export declare enum SequencerEvent {
20
+ START = "START",
21
+ END = "END",
22
+ SEQUENCE_START = "SEQUENCE_START",
23
+ SEQUENCE_END = "SEQUENCE_END"
24
+ }
25
+ export declare class Sequencer {
26
+ protected readonly sequences: Sequence[];
27
+ protected status: SequencerStatus;
28
+ protected minimumExecutionTime: number;
29
+ currentSequence: Sequence | null;
30
+ startTimestamp: number | null;
31
+ endTimestamp: number | null;
32
+ eventEmitter: EventEmitter3<string | symbol, any>;
33
+ constructor(option?: SequencerOption);
34
+ get getCurrentTimeStamp(): number;
35
+ get executionTime(): number | null;
36
+ pushSequence: (sequence: Sequence) => void;
37
+ start: () => Promise<undefined>;
38
+ }
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Sequencer = exports.SequencerEvent = exports.SequencerStatus = void 0;
16
+ const moment_js_1 = __importDefault(require("moment/moment.js"));
17
+ const eventemitter3_1 = __importDefault(require("eventemitter3"));
18
+ var SequencerStatus;
19
+ (function (SequencerStatus) {
20
+ SequencerStatus[SequencerStatus["IDLE"] = 0] = "IDLE";
21
+ SequencerStatus[SequencerStatus["RUNNING"] = 1] = "RUNNING";
22
+ SequencerStatus[SequencerStatus["ERROR"] = 2] = "ERROR";
23
+ SequencerStatus[SequencerStatus["DONE"] = 3] = "DONE";
24
+ })(SequencerStatus || (exports.SequencerStatus = SequencerStatus = {}));
25
+ var SequencerEvent;
26
+ (function (SequencerEvent) {
27
+ SequencerEvent["START"] = "START";
28
+ SequencerEvent["END"] = "END";
29
+ SequencerEvent["SEQUENCE_START"] = "SEQUENCE_START";
30
+ SequencerEvent["SEQUENCE_END"] = "SEQUENCE_END";
31
+ })(SequencerEvent || (exports.SequencerEvent = SequencerEvent = {}));
32
+ class Sequencer {
33
+ constructor(option) {
34
+ this.sequences = [];
35
+ this.status = SequencerStatus.IDLE;
36
+ this.minimumExecutionTime = 0;
37
+ // Reset variables task is done
38
+ this.currentSequence = null;
39
+ this.startTimestamp = null;
40
+ this.endTimestamp = null;
41
+ // Emitter
42
+ this.eventEmitter = new eventemitter3_1.default();
43
+ this.pushSequence = (sequence) => {
44
+ this.sequences.push(sequence);
45
+ };
46
+ this.start = () => __awaiter(this, void 0, void 0, function* () {
47
+ if (this.status === SequencerStatus.RUNNING) {
48
+ console.warn('Sequencer status is', this.status);
49
+ return;
50
+ }
51
+ this.status = SequencerStatus.RUNNING;
52
+ this.currentSequence = null;
53
+ this.startTimestamp = this.getCurrentTimeStamp;
54
+ this.endTimestamp = null;
55
+ console.log(`Sequence started, started at ${this.startTimestamp}, MINIMUM_EXECUTION_TIME is ${this.minimumExecutionTime}`);
56
+ for (let sequence of this.sequences) {
57
+ console.log('Currently total execution time', this.executionTime);
58
+ const sequenceStartTimeStamp = this.getCurrentTimeStamp;
59
+ this.currentSequence = sequence;
60
+ // Emitter
61
+ this.eventEmitter.emit(SequencerEvent.SEQUENCE_START, sequence);
62
+ try {
63
+ yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
64
+ var _a;
65
+ try {
66
+ console.log(`Sequence ${sequence.key} start`);
67
+ yield ((_a = sequence.task) === null || _a === void 0 ? void 0 : _a.call(sequence));
68
+ const sequenceEndTimeStamp = this.getCurrentTimeStamp;
69
+ const sequenceExecutionTime = sequenceEndTimeStamp - sequenceStartTimeStamp;
70
+ console.log(`✅ Sequence ${sequence.key} done at`, sequenceEndTimeStamp);
71
+ console.log('Sequence execution time', sequenceExecutionTime, 'ms');
72
+ if (sequence.minimumExecutionTime) {
73
+ console.log(`Sequence has minimumExecutionTime`, sequence.minimumExecutionTime, 'ms');
74
+ if (sequenceExecutionTime < sequence.minimumExecutionTime) {
75
+ const delay = sequence.minimumExecutionTime - sequenceExecutionTime;
76
+ console.log(`Sequence will delay`, delay, 'ms');
77
+ let dotInterpreterBlocked = false;
78
+ const dotInterpreter = setInterval(() => {
79
+ if (dotInterpreterBlocked) {
80
+ console.log('!');
81
+ return;
82
+ }
83
+ console.log('.');
84
+ }, 100);
85
+ setTimeout(() => {
86
+ dotInterpreterBlocked = true;
87
+ clearInterval(dotInterpreter);
88
+ console.log('done');
89
+ resolve();
90
+ }, delay);
91
+ return;
92
+ }
93
+ console.log('Sequence execution time is greater than minimum execution time');
94
+ resolve();
95
+ return;
96
+ }
97
+ resolve();
98
+ }
99
+ catch (e) {
100
+ reject(e);
101
+ }
102
+ }));
103
+ console.log('Out of Promise');
104
+ // Emitter
105
+ this.eventEmitter.emit(SequencerEvent.SEQUENCE_END, sequence);
106
+ }
107
+ catch (e) {
108
+ if (sequence.required) {
109
+ console.error(`🚫 Sequence ${sequence.key} failed`, e);
110
+ this.status = SequencerStatus.ERROR;
111
+ this.currentSequence = null;
112
+ this.endTimestamp = this.currentSequence;
113
+ // IMPORTANT
114
+ return Promise.reject({
115
+ sequence,
116
+ reason: e,
117
+ });
118
+ }
119
+ console.log(`Sequence ${sequence.key} failed`, e);
120
+ // Emitter
121
+ this.eventEmitter.emit(SequencerEvent.SEQUENCE_END, sequence);
122
+ }
123
+ }
124
+ this.status = SequencerStatus.DONE;
125
+ this.currentSequence = null;
126
+ this.endTimestamp = this.currentSequence;
127
+ });
128
+ if (option === null || option === void 0 ? void 0 : option.sequences) {
129
+ this.sequences.push(...option.sequences);
130
+ }
131
+ }
132
+ get getCurrentTimeStamp() {
133
+ return parseInt((0, moment_js_1.default)().format('x'), 10);
134
+ }
135
+ get executionTime() {
136
+ if (this.status === SequencerStatus.IDLE) {
137
+ return null;
138
+ }
139
+ if (!this.startTimestamp) {
140
+ return null;
141
+ }
142
+ if (this.startTimestamp && this.endTimestamp) {
143
+ return this.endTimestamp - this.startTimestamp;
144
+ }
145
+ return this.getCurrentTimeStamp - this.startTimestamp;
146
+ }
147
+ }
148
+ exports.Sequencer = Sequencer;
@@ -0,0 +1,5 @@
1
+ export declare class StringUtils {
2
+ static numberWithCommas(x: string | any): string;
3
+ static getByte(s: string): number;
4
+ static levenshteinDistance: (str1?: string, str2?: string) => number;
5
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StringUtils = void 0;
4
+ class StringUtils {
5
+ static numberWithCommas(x) {
6
+ return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
7
+ }
8
+ static getByte(s) {
9
+ const getByteLength = (decimal) => {
10
+ const LINE_FEED = 10;
11
+ return (decimal >> 7) || (LINE_FEED === decimal) ? 2 : 1;
12
+ };
13
+ return s
14
+ .split('')
15
+ .map((s) => s.charCodeAt(0))
16
+ .reduce((prev, unicodeDecimalValue) => prev + getByteLength(unicodeDecimalValue), 0);
17
+ }
18
+ }
19
+ exports.StringUtils = StringUtils;
20
+ StringUtils.levenshteinDistance = (str1 = '', str2 = '') => {
21
+ const track = Array(str2.length + 1).fill(null).map(() => Array(str1.length + 1).fill(null));
22
+ for (let i = 0; i <= str1.length; i += 1) {
23
+ track[0][i] = i;
24
+ }
25
+ for (let j = 0; j <= str2.length; j += 1) {
26
+ track[j][0] = j;
27
+ }
28
+ for (let j = 1; j <= str2.length; j += 1) {
29
+ for (let i = 1; i <= str1.length; i += 1) {
30
+ const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1;
31
+ track[j][i] = Math.min(track[j][i - 1] + 1, // deletion
32
+ track[j - 1][i] + 1, // insertion
33
+ track[j - 1][i - 1] + indicator);
34
+ }
35
+ }
36
+ return track[str2.length][str1.length];
37
+ };
@@ -0,0 +1,14 @@
1
+ export declare class UuidUtils {
2
+ static v4(): string;
3
+ static format(uuid: string): string;
4
+ /**
5
+ * (UUID: Buffer) to (UUID: string)
6
+ * @param binary UUID
7
+ * @returns {string|null} When binary not exists return null
8
+ */
9
+ static toString(binary: Buffer): string;
10
+ /** (UUID: string) to (UUID: Buffer) */
11
+ static toBuffer(uuid: string): Buffer;
12
+ static toBuffer(uuid: string | null | undefined): Buffer | null;
13
+ static isValidUUID(uuid: string): boolean;
14
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UuidUtils = void 0;
7
+ const uuid_1 = __importDefault(require("uuid"));
8
+ function binaryToString(binary) {
9
+ return Buffer.from(binary).toString('hex');
10
+ }
11
+ class UuidUtils {
12
+ static v4() {
13
+ return uuid_1.default.v4();
14
+ }
15
+ static format(uuid) {
16
+ if (uuid.length === 32) {
17
+ // Without dash: ca23c587d7f84c76be59f53bbc9f91f8
18
+ return `${uuid.substring(0, 8)}-${uuid.substring(8, 12)}-${uuid.substring(12, 16)}-${uuid.substring(16, 20)}-${uuid.substring(20, 32)}`.toUpperCase();
19
+ }
20
+ else if (uuid.length === 36) {
21
+ // With dash: ca23c587-d7f8-4c76-be59-f53bbc9f91f8
22
+ return uuid.toUpperCase();
23
+ }
24
+ else {
25
+ // Unexpected uuid
26
+ console.warn('Unexpected uuid length', uuid);
27
+ return uuid;
28
+ }
29
+ }
30
+ static toString(binary) {
31
+ if (!binary)
32
+ return null;
33
+ return UuidUtils.format(binaryToString(binary));
34
+ }
35
+ static toBuffer(uuid) {
36
+ if (!uuid) {
37
+ return null;
38
+ }
39
+ return Buffer.from(uuid.replace(/-/g, ''), 'hex');
40
+ }
41
+ static isValidUUID(uuid) {
42
+ if (!uuid)
43
+ return false;
44
+ if (typeof uuid !== 'string')
45
+ return false;
46
+ return RegExp(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/i).test(uuid);
47
+ }
48
+ }
49
+ exports.UuidUtils = UuidUtils;
@@ -0,0 +1,48 @@
1
+ export declare class Validator {
2
+ static validate(value: string | null | undefined, options: Validator.Options): {
3
+ result: boolean;
4
+ validations: Validator.VALIDATION[];
5
+ passes: Validator.VALIDATION[];
6
+ errors: Validator.VALIDATION[];
7
+ };
8
+ }
9
+ export declare namespace Validator {
10
+ enum VALIDATION {
11
+ MIN_LENGTH = "MIN_LENGTH",
12
+ MAX_LENGTH = "MAX_LENGTH",
13
+ SPACE_MIN_COUNT = "SPACE_MIN_COUNT",
14
+ SPACE_MAX_COUNT = "SPACE_MAX_COUNT",
15
+ NUMBER_MIN_COUNT = "NUMBER_MIN_COUNT",
16
+ NUMBER_MAX_COUNT = "NUMBER_MAX_COUNT",
17
+ ALPHABET_MIN_COUNT = "ALPHABET_MIN_COUNT",
18
+ ALPHABET_MAX_COUNT = "ALPHABET_MAX_COUNT",
19
+ ALPHABET_LOWER_CASE_MIN_COUNT = "ALPHABET_LOWER_CASE_MIN_COUNT",
20
+ ALPHABET_LOWER_CASE_MAX_COUNT = "ALPHABET_LOWER_CASE_MAX_COUNT",
21
+ ALPHABET_UPPER_CASE_MIN_COUNT = "ALPHABET_UPPER_CASE_MIN_COUNT",
22
+ ALPHABET_UPPER_CASE_MAX_COUNT = "ALPHABET_UPPER_CASE_MAX_COUNT",
23
+ SPECIAL_CHARACTER_MIN_COUNT = "SPECIAL_CHARACTER_MIN_COUNT",
24
+ SPECIAL_CHARACTER_MAX_COUNT = "SPECIAL_CHARACTER_MAX_COUNT",
25
+ STARTS_WITH_ALPHABET = "STARTS_WITH_ALPHABET",
26
+ STARTS_WITH_NUMBER = "STARTS_WITH_NUMBER",
27
+ STARTS_WITH_SPECIAL_CHARACTER = "STARTS_WITH_SPECIAL_CHARACTER"
28
+ }
29
+ interface Options {
30
+ minLength?: number;
31
+ maxLength?: number;
32
+ spaceMinCount?: number;
33
+ spaceMaxCount?: number;
34
+ numberMinCount?: number;
35
+ numberMaxCount?: number;
36
+ alphabetMinCount?: number;
37
+ alphabetMaxCount?: number;
38
+ alphabetLowerCaseMinCount?: number;
39
+ alphabetLowerCaseMaxCount?: number;
40
+ alphabetUpperCaseMinCount?: number;
41
+ alphabetUpperCaseMaxCount?: number;
42
+ specialCharacterMinCount?: number;
43
+ specialCharacterMaxCount?: number;
44
+ startsWithNumber?: boolean;
45
+ startsWithAlphabet?: boolean;
46
+ startsWithSpecialCharacter?: boolean;
47
+ }
48
+ }
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Validator = void 0;
4
+ class Validator {
5
+ static validate(value, options) {
6
+ value = value || '';
7
+ const validations = [];
8
+ const errors = [];
9
+ const { length } = value;
10
+ const spaceCount = (value.match(/\s/g) || []).length;
11
+ const numberCount = (value.match(/\d/g) || []).length;
12
+ const alphabetCount = (value.match(/[A-Za-z]/g) || []).length;
13
+ const alphabetLowerCaseCount = (value.match(/[a-z]/g) || []).length;
14
+ const alphabetUpperCaseCount = (value.match(/[A-Z]/g) || []).length;
15
+ const specialCount = (value.match(/[~`!@#$%^&*()\-+={[}\]|\\:;"'<,>.?/]/g) || []).length;
16
+ const startsWithNumber = /^\d/.test(value);
17
+ const startsWithAlphabet = /^[A-Za-z]/.test(value);
18
+ const startsWithSpecialCharacter = /^[~`!@#$%^&*()\-+={[}\]|\\:;"'<,>.?/]/.test(value);
19
+ // 최소 길이
20
+ if (options.minLength !== undefined && options.minLength > -1) {
21
+ validations.push(Validator.VALIDATION.MIN_LENGTH);
22
+ if (length < options.minLength) {
23
+ errors.push(Validator.VALIDATION.MIN_LENGTH);
24
+ }
25
+ }
26
+ // 최대 길이
27
+ if (options.maxLength !== undefined && options.maxLength > -1) {
28
+ validations.push(Validator.VALIDATION.MAX_LENGTH);
29
+ if (length > options.maxLength) {
30
+ errors.push(Validator.VALIDATION.MAX_LENGTH);
31
+ }
32
+ }
33
+ const validateMin = (option, value, validation) => {
34
+ if (option !== undefined && option > -1) {
35
+ validations.push(validation);
36
+ if (value < option) {
37
+ errors.push(validation);
38
+ }
39
+ }
40
+ };
41
+ const validateMax = (option, value, validation) => {
42
+ if (option !== undefined && option > -1) {
43
+ validations.push(validation);
44
+ if (value > option) {
45
+ errors.push(validation);
46
+ }
47
+ }
48
+ };
49
+ // 공백 개수
50
+ validateMin(options.spaceMinCount, spaceCount, Validator.VALIDATION.SPACE_MIN_COUNT);
51
+ validateMax(options.spaceMaxCount, spaceCount, Validator.VALIDATION.SPACE_MAX_COUNT);
52
+ // 숫자 개수
53
+ validateMin(options.numberMinCount, numberCount, Validator.VALIDATION.NUMBER_MIN_COUNT);
54
+ validateMax(options.numberMaxCount, numberCount, Validator.VALIDATION.NUMBER_MAX_COUNT);
55
+ // 알파벳 개수
56
+ validateMin(options.alphabetMinCount, alphabetCount, Validator.VALIDATION.ALPHABET_MIN_COUNT);
57
+ validateMax(options.alphabetMaxCount, alphabetCount, Validator.VALIDATION.ALPHABET_MAX_COUNT);
58
+ // 알파벳(소문자) 개수
59
+ validateMin(options.alphabetLowerCaseMinCount, alphabetLowerCaseCount, Validator.VALIDATION.ALPHABET_LOWER_CASE_MIN_COUNT);
60
+ validateMax(options.alphabetLowerCaseMaxCount, alphabetLowerCaseCount, Validator.VALIDATION.ALPHABET_LOWER_CASE_MAX_COUNT);
61
+ // 알파벳(대문자) 개수
62
+ validateMin(options.alphabetUpperCaseMinCount, alphabetUpperCaseCount, Validator.VALIDATION.ALPHABET_UPPER_CASE_MIN_COUNT);
63
+ validateMax(options.alphabetUpperCaseMaxCount, alphabetUpperCaseCount, Validator.VALIDATION.ALPHABET_UPPER_CASE_MAX_COUNT);
64
+ // 특수문자 개수
65
+ validateMin(options.specialCharacterMinCount, specialCount, Validator.VALIDATION.SPECIAL_CHARACTER_MIN_COUNT);
66
+ validateMax(options.specialCharacterMaxCount, specialCount, Validator.VALIDATION.SPECIAL_CHARACTER_MAX_COUNT);
67
+ // 숫자로 시작
68
+ if (options.startsWithNumber) {
69
+ validations.push(Validator.VALIDATION.STARTS_WITH_NUMBER);
70
+ if (!startsWithNumber) {
71
+ errors.push(Validator.VALIDATION.STARTS_WITH_NUMBER);
72
+ }
73
+ }
74
+ // 영문으로 시작
75
+ if (options.startsWithAlphabet) {
76
+ validations.push(Validator.VALIDATION.STARTS_WITH_ALPHABET);
77
+ if (!startsWithAlphabet) {
78
+ errors.push(Validator.VALIDATION.STARTS_WITH_ALPHABET);
79
+ }
80
+ }
81
+ // 특수문자로 시작
82
+ if (options.startsWithSpecialCharacter) {
83
+ validations.push(Validator.VALIDATION.STARTS_WITH_SPECIAL_CHARACTER);
84
+ if (!startsWithSpecialCharacter) {
85
+ errors.push(Validator.VALIDATION.STARTS_WITH_SPECIAL_CHARACTER);
86
+ }
87
+ }
88
+ return {
89
+ result: errors.length === 0,
90
+ validations,
91
+ passes: validations.filter(e => !errors.includes(e)),
92
+ errors,
93
+ };
94
+ }
95
+ }
96
+ exports.Validator = Validator;
97
+ (function (Validator) {
98
+ let VALIDATION;
99
+ (function (VALIDATION) {
100
+ VALIDATION["MIN_LENGTH"] = "MIN_LENGTH";
101
+ VALIDATION["MAX_LENGTH"] = "MAX_LENGTH";
102
+ VALIDATION["SPACE_MIN_COUNT"] = "SPACE_MIN_COUNT";
103
+ VALIDATION["SPACE_MAX_COUNT"] = "SPACE_MAX_COUNT";
104
+ VALIDATION["NUMBER_MIN_COUNT"] = "NUMBER_MIN_COUNT";
105
+ VALIDATION["NUMBER_MAX_COUNT"] = "NUMBER_MAX_COUNT";
106
+ VALIDATION["ALPHABET_MIN_COUNT"] = "ALPHABET_MIN_COUNT";
107
+ VALIDATION["ALPHABET_MAX_COUNT"] = "ALPHABET_MAX_COUNT";
108
+ VALIDATION["ALPHABET_LOWER_CASE_MIN_COUNT"] = "ALPHABET_LOWER_CASE_MIN_COUNT";
109
+ VALIDATION["ALPHABET_LOWER_CASE_MAX_COUNT"] = "ALPHABET_LOWER_CASE_MAX_COUNT";
110
+ VALIDATION["ALPHABET_UPPER_CASE_MIN_COUNT"] = "ALPHABET_UPPER_CASE_MIN_COUNT";
111
+ VALIDATION["ALPHABET_UPPER_CASE_MAX_COUNT"] = "ALPHABET_UPPER_CASE_MAX_COUNT";
112
+ VALIDATION["SPECIAL_CHARACTER_MIN_COUNT"] = "SPECIAL_CHARACTER_MIN_COUNT";
113
+ VALIDATION["SPECIAL_CHARACTER_MAX_COUNT"] = "SPECIAL_CHARACTER_MAX_COUNT";
114
+ VALIDATION["STARTS_WITH_ALPHABET"] = "STARTS_WITH_ALPHABET";
115
+ VALIDATION["STARTS_WITH_NUMBER"] = "STARTS_WITH_NUMBER";
116
+ VALIDATION["STARTS_WITH_SPECIAL_CHARACTER"] = "STARTS_WITH_SPECIAL_CHARACTER";
117
+ })(VALIDATION = Validator.VALIDATION || (Validator.VALIDATION = {}));
118
+ })(Validator || (exports.Validator = Validator = {}));
@@ -0,0 +1 @@
1
+ export declare const between: (value: number, from: number, to: number) => boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.between = void 0;
4
+ const between = (value, from, to) => {
5
+ return value >= from && value <= to;
6
+ };
7
+ exports.between = between;
@@ -0,0 +1 @@
1
+ export declare function castArray<T>(value: T | T[]): T[];
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.castArray = castArray;
4
+ function castArray(value) {
5
+ return Array.isArray(value) ? value : [value];
6
+ }
@@ -0,0 +1 @@
1
+ export declare function circularDistance(value: number, target: number, min: number, max: number): number;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.circularDistance = circularDistance;
4
+ function circularDistance(value, target, min, max) {
5
+ const range = max - min;
6
+ const from = value - min;
7
+ const to = target - min;
8
+ if (to >= from) {
9
+ return to - from;
10
+ }
11
+ else {
12
+ return range - from + to;
13
+ }
14
+ }
@@ -0,0 +1 @@
1
+ export declare function fallbackIfEqual<V, C, F>(value: V, condition: C, fallback: F): V | F;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fallbackIfEqual = fallbackIfEqual;
4
+ function fallbackIfEqual(value, condition, fallback) {
5
+ if (typeof value === typeof condition && value === condition) {
6
+ return fallback;
7
+ }
8
+ return value;
9
+ }
@@ -0,0 +1 @@
1
+ export declare function fallbackIfNull<V, F>(value: V, fallback: F): V | F;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fallbackIfNull = fallbackIfNull;
4
+ const fallbackIfEqual_js_1 = require("./fallbackIfEqual.js");
5
+ function fallbackIfNull(value, fallback) {
6
+ return (0, fallbackIfEqual_js_1.fallbackIfEqual)(value, null, fallback);
7
+ }
@@ -0,0 +1 @@
1
+ export declare function fallbackIfUndefined<V, F>(value: V, fallback: F): V | F;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fallbackIfUndefined = fallbackIfUndefined;
4
+ const fallbackIfEqual_js_1 = require("./fallbackIfEqual.js");
5
+ function fallbackIfUndefined(value, fallback) {
6
+ return (0, fallbackIfEqual_js_1.fallbackIfEqual)(value, undefined, fallback);
7
+ }
@@ -0,0 +1 @@
1
+ export declare function firstNonNullish<T>(...args: T[]): NonNullable<T> | undefined;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.firstNonNullish = firstNonNullish;
4
+ function firstNonNullish(...args) {
5
+ if (args == null || !Array.isArray(args) || args.length === 0) {
6
+ return undefined;
7
+ }
8
+ if (args[0] != null) {
9
+ // Not Nullish
10
+ return args[0];
11
+ }
12
+ return firstNonNullish(...args.slice(1));
13
+ }
@@ -0,0 +1,14 @@
1
+ export interface FlattenOptions {
2
+ delimiter?: string;
3
+ maxDepth?: number;
4
+ safe?: boolean;
5
+ transformKey?: (key: string) => string;
6
+ }
7
+ export interface UnflattenOptions {
8
+ delimiter?: string;
9
+ object?: boolean;
10
+ overwrite?: boolean;
11
+ transformKey?: (key: string) => string;
12
+ }
13
+ export declare function flatten<T extends object>(target: T, opts?: FlattenOptions): Record<string, any>;
14
+ export declare function unflatten<T extends object>(target: T, opts?: UnflattenOptions): any;