dce-reactkit 4.3.4 → 5.0.0

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 (343) hide show
  1. package/dist/cjs/index.js +338 -2316
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/LogReviewer.d.ts +1 -1
  4. package/dist/cjs/types/helpers/logClientEvent.d.ts +1 -1
  5. package/dist/cjs/types/html/genErrorPage.d.ts +1 -1
  6. package/dist/cjs/types/index.d.ts +2 -64
  7. package/dist/cjs/types/types/IntelliTableColumn.d.ts +1 -1
  8. package/dist/esm/index.js +78 -2223
  9. package/dist/esm/index.js.map +1 -1
  10. package/dist/esm/types/components/LogReviewer.d.ts +1 -1
  11. package/dist/esm/types/helpers/logClientEvent.d.ts +1 -1
  12. package/dist/esm/types/html/genErrorPage.d.ts +1 -1
  13. package/dist/esm/types/index.d.ts +2 -64
  14. package/dist/esm/types/types/IntelliTableColumn.d.ts +1 -1
  15. package/dist/index.d.ts +3 -835
  16. package/package.json +4 -3
  17. package/src/components/AppWrapper.tsx +12 -10
  18. package/src/components/AutoscrollToBottomContainer.tsx +5 -3
  19. package/src/components/CopiableBox.tsx +5 -1
  20. package/src/components/DBEntryManagerPanel/helpers/generateEndpointPath.ts +2 -2
  21. package/src/components/ErrorBox.tsx +6 -2
  22. package/src/components/IntelliTable.tsx +7 -5
  23. package/src/components/LogReviewer.tsx +23 -21
  24. package/src/components/Modal/index.tsx +5 -3
  25. package/src/components/MultiSwitch.tsx +5 -1
  26. package/src/components/Shimmer.tsx +4 -2
  27. package/src/components/SimpleDateChooser.tsx +11 -13
  28. package/src/components/SimpleTimeChooser.tsx +4 -2
  29. package/src/helpers/canReviewLogs.test.ts +5 -3
  30. package/src/helpers/canReviewLogs.ts +5 -3
  31. package/src/helpers/initClient.tsx +8 -8
  32. package/src/helpers/isMobileOrTablet.tsx +2 -1
  33. package/src/helpers/isSelectAdmin.ts +4 -2
  34. package/src/helpers/logClientEvent.tsx +7 -5
  35. package/src/helpers/stubServerEndpoint.tsx +1 -1
  36. package/src/helpers/visitServerEndpoint.tsx +10 -7
  37. package/src/html/genErrorPage.ts +6 -4
  38. package/src/index.ts +105 -98
  39. package/src/types/IntelliTableColumn.ts +4 -1
  40. package/dist/cjs/types/constants/DAY_IN_MS.d.ts +0 -6
  41. package/dist/cjs/types/constants/HOUR_IN_MS.d.ts +0 -6
  42. package/dist/cjs/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
  43. package/dist/cjs/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
  44. package/dist/cjs/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
  45. package/dist/cjs/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
  46. package/dist/cjs/types/constants/MINUTE_IN_MS.d.ts +0 -6
  47. package/dist/cjs/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
  48. package/dist/cjs/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
  49. package/dist/cjs/types/errors/ErrorWithCode.d.ts +0 -9
  50. package/dist/cjs/types/helpers/abbreviate.d.ts +0 -10
  51. package/dist/cjs/types/helpers/abbreviate.test.d.ts +0 -5
  52. package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
  53. package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
  54. package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
  55. package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
  56. package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
  57. package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
  58. package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
  59. package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
  60. package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
  61. package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
  62. package/dist/cjs/types/helpers/avg.d.ts +0 -8
  63. package/dist/cjs/types/helpers/avg.test.d.ts +0 -5
  64. package/dist/cjs/types/helpers/capitalize.d.ts +0 -7
  65. package/dist/cjs/types/helpers/ceilToNumDecimals.d.ts +0 -9
  66. package/dist/cjs/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
  67. package/dist/cjs/types/helpers/cloneDeep.d.ts +0 -8
  68. package/dist/cjs/types/helpers/compareArraysByProp.d.ts +0 -13
  69. package/dist/cjs/types/helpers/compareArraysByProp.test.d.ts +0 -5
  70. package/dist/cjs/types/helpers/extractProp.d.ts +0 -12
  71. package/dist/cjs/types/helpers/extractProp.test.d.ts +0 -5
  72. package/dist/cjs/types/helpers/floorToNumDecimals.d.ts +0 -9
  73. package/dist/cjs/types/helpers/floorToNumDecimals.test.d.ts +0 -5
  74. package/dist/cjs/types/helpers/forceNumIntoBounds.d.ts +0 -10
  75. package/dist/cjs/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
  76. package/dist/cjs/types/helpers/genCSV.d.ts +0 -18
  77. package/dist/cjs/types/helpers/genCSV.test.d.ts +0 -5
  78. package/dist/cjs/types/helpers/genCommaList.d.ts +0 -12
  79. package/dist/cjs/types/helpers/genCommaList.test.d.ts +0 -1
  80. package/dist/cjs/types/helpers/getHumanReadableDate.d.ts +0 -8
  81. package/dist/cjs/types/helpers/getHumanReadableDate.test.d.ts +0 -5
  82. package/dist/cjs/types/helpers/getLocalTimeInfo.d.ts +0 -19
  83. package/dist/cjs/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
  84. package/dist/cjs/types/helpers/getMonthName.d.ts +0 -14
  85. package/dist/cjs/types/helpers/getMonthName.test.d.ts +0 -5
  86. package/dist/cjs/types/helpers/getOrdinal.d.ts +0 -8
  87. package/dist/cjs/types/helpers/getOrdinal.test.d.ts +0 -5
  88. package/dist/cjs/types/helpers/getPartOfDay.d.ts +0 -7
  89. package/dist/cjs/types/helpers/getPartOfDay.test.d.ts +0 -5
  90. package/dist/cjs/types/helpers/getTimeInfoInET.d.ts +0 -21
  91. package/dist/cjs/types/helpers/getTimeInfoInET.test.d.ts +0 -5
  92. package/dist/cjs/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
  93. package/dist/cjs/types/helpers/getWordCount.d.ts +0 -10
  94. package/dist/cjs/types/helpers/idify.d.ts +0 -9
  95. package/dist/cjs/types/helpers/onlyKeepLetters.d.ts +0 -8
  96. package/dist/cjs/types/helpers/padDecimalZeros.d.ts +0 -10
  97. package/dist/cjs/types/helpers/padZerosLeft.d.ts +0 -9
  98. package/dist/cjs/types/helpers/parallelLimit.d.ts +0 -12
  99. package/dist/cjs/types/helpers/prefixWithAOrAn.d.ts +0 -10
  100. package/dist/cjs/types/helpers/roundToNumDecimals.d.ts +0 -9
  101. package/dist/cjs/types/helpers/shuffleArray.d.ts +0 -8
  102. package/dist/cjs/types/helpers/startMinWait.d.ts +0 -9
  103. package/dist/cjs/types/helpers/stringsToHumanReadableList.d.ts +0 -10
  104. package/dist/cjs/types/helpers/sum.d.ts +0 -8
  105. package/dist/cjs/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
  106. package/dist/cjs/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
  107. package/dist/cjs/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
  108. package/dist/cjs/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
  109. package/dist/cjs/types/helpers/validators/validURL.d.ts +0 -8
  110. package/dist/cjs/types/helpers/validators/validateEmail.d.ts +0 -11
  111. package/dist/cjs/types/helpers/validators/validateEmail.test.d.ts +0 -1
  112. package/dist/cjs/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
  113. package/dist/cjs/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
  114. package/dist/cjs/types/helpers/validators/validateString.d.ts +0 -22
  115. package/dist/cjs/types/helpers/validators/validateString.test.d.ts +0 -1
  116. package/dist/cjs/types/helpers/waitMs.d.ts +0 -7
  117. package/dist/cjs/types/types/DayOfWeek.d.ts +0 -14
  118. package/dist/cjs/types/types/Log/LogMainInfo.d.ts +0 -39
  119. package/dist/cjs/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
  120. package/dist/cjs/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
  121. package/dist/cjs/types/types/Log/index.d.ts +0 -10
  122. package/dist/cjs/types/types/LogAction.d.ts +0 -29
  123. package/dist/cjs/types/types/LogBuiltInMetadata.d.ts +0 -16
  124. package/dist/cjs/types/types/LogFunction.d.ts +0 -24
  125. package/dist/cjs/types/types/LogLevel.d.ts +0 -10
  126. package/dist/cjs/types/types/LogMetadataContextMap.d.ts +0 -11
  127. package/dist/cjs/types/types/LogMetadataTagMap.d.ts +0 -8
  128. package/dist/cjs/types/types/LogMetadataTargetMap.d.ts +0 -8
  129. package/dist/cjs/types/types/LogMetadataType.d.ts +0 -13
  130. package/dist/cjs/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
  131. package/dist/cjs/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
  132. package/dist/cjs/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
  133. package/dist/cjs/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
  134. package/dist/cjs/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
  135. package/dist/cjs/types/types/LogReviewerFilterState/index.d.ts +0 -17
  136. package/dist/cjs/types/types/LogSource.d.ts +0 -9
  137. package/dist/cjs/types/types/LogType.d.ts +0 -9
  138. package/dist/cjs/types/types/ParamType.d.ts +0 -17
  139. package/dist/cjs/types/types/ReactKitErrorCode.d.ts +0 -14
  140. package/dist/esm/types/constants/DAY_IN_MS.d.ts +0 -6
  141. package/dist/esm/types/constants/HOUR_IN_MS.d.ts +0 -6
  142. package/dist/esm/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
  143. package/dist/esm/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
  144. package/dist/esm/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
  145. package/dist/esm/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
  146. package/dist/esm/types/constants/MINUTE_IN_MS.d.ts +0 -6
  147. package/dist/esm/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
  148. package/dist/esm/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
  149. package/dist/esm/types/errors/ErrorWithCode.d.ts +0 -9
  150. package/dist/esm/types/helpers/abbreviate.d.ts +0 -10
  151. package/dist/esm/types/helpers/abbreviate.test.d.ts +0 -5
  152. package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
  153. package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
  154. package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
  155. package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
  156. package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
  157. package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
  158. package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
  159. package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
  160. package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
  161. package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
  162. package/dist/esm/types/helpers/avg.d.ts +0 -8
  163. package/dist/esm/types/helpers/avg.test.d.ts +0 -5
  164. package/dist/esm/types/helpers/capitalize.d.ts +0 -7
  165. package/dist/esm/types/helpers/ceilToNumDecimals.d.ts +0 -9
  166. package/dist/esm/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
  167. package/dist/esm/types/helpers/cloneDeep.d.ts +0 -8
  168. package/dist/esm/types/helpers/compareArraysByProp.d.ts +0 -13
  169. package/dist/esm/types/helpers/compareArraysByProp.test.d.ts +0 -5
  170. package/dist/esm/types/helpers/extractProp.d.ts +0 -12
  171. package/dist/esm/types/helpers/extractProp.test.d.ts +0 -5
  172. package/dist/esm/types/helpers/floorToNumDecimals.d.ts +0 -9
  173. package/dist/esm/types/helpers/floorToNumDecimals.test.d.ts +0 -5
  174. package/dist/esm/types/helpers/forceNumIntoBounds.d.ts +0 -10
  175. package/dist/esm/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
  176. package/dist/esm/types/helpers/genCSV.d.ts +0 -18
  177. package/dist/esm/types/helpers/genCSV.test.d.ts +0 -5
  178. package/dist/esm/types/helpers/genCommaList.d.ts +0 -12
  179. package/dist/esm/types/helpers/genCommaList.test.d.ts +0 -1
  180. package/dist/esm/types/helpers/getHumanReadableDate.d.ts +0 -8
  181. package/dist/esm/types/helpers/getHumanReadableDate.test.d.ts +0 -5
  182. package/dist/esm/types/helpers/getLocalTimeInfo.d.ts +0 -19
  183. package/dist/esm/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
  184. package/dist/esm/types/helpers/getMonthName.d.ts +0 -14
  185. package/dist/esm/types/helpers/getMonthName.test.d.ts +0 -5
  186. package/dist/esm/types/helpers/getOrdinal.d.ts +0 -8
  187. package/dist/esm/types/helpers/getOrdinal.test.d.ts +0 -5
  188. package/dist/esm/types/helpers/getPartOfDay.d.ts +0 -7
  189. package/dist/esm/types/helpers/getPartOfDay.test.d.ts +0 -5
  190. package/dist/esm/types/helpers/getTimeInfoInET.d.ts +0 -21
  191. package/dist/esm/types/helpers/getTimeInfoInET.test.d.ts +0 -5
  192. package/dist/esm/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
  193. package/dist/esm/types/helpers/getWordCount.d.ts +0 -10
  194. package/dist/esm/types/helpers/idify.d.ts +0 -9
  195. package/dist/esm/types/helpers/onlyKeepLetters.d.ts +0 -8
  196. package/dist/esm/types/helpers/padDecimalZeros.d.ts +0 -10
  197. package/dist/esm/types/helpers/padZerosLeft.d.ts +0 -9
  198. package/dist/esm/types/helpers/parallelLimit.d.ts +0 -12
  199. package/dist/esm/types/helpers/prefixWithAOrAn.d.ts +0 -10
  200. package/dist/esm/types/helpers/roundToNumDecimals.d.ts +0 -9
  201. package/dist/esm/types/helpers/shuffleArray.d.ts +0 -8
  202. package/dist/esm/types/helpers/startMinWait.d.ts +0 -9
  203. package/dist/esm/types/helpers/stringsToHumanReadableList.d.ts +0 -10
  204. package/dist/esm/types/helpers/sum.d.ts +0 -8
  205. package/dist/esm/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
  206. package/dist/esm/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
  207. package/dist/esm/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
  208. package/dist/esm/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
  209. package/dist/esm/types/helpers/validators/validURL.d.ts +0 -8
  210. package/dist/esm/types/helpers/validators/validateEmail.d.ts +0 -11
  211. package/dist/esm/types/helpers/validators/validateEmail.test.d.ts +0 -1
  212. package/dist/esm/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
  213. package/dist/esm/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
  214. package/dist/esm/types/helpers/validators/validateString.d.ts +0 -22
  215. package/dist/esm/types/helpers/validators/validateString.test.d.ts +0 -1
  216. package/dist/esm/types/helpers/waitMs.d.ts +0 -7
  217. package/dist/esm/types/types/DayOfWeek.d.ts +0 -14
  218. package/dist/esm/types/types/Log/LogMainInfo.d.ts +0 -39
  219. package/dist/esm/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
  220. package/dist/esm/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
  221. package/dist/esm/types/types/Log/index.d.ts +0 -10
  222. package/dist/esm/types/types/LogAction.d.ts +0 -29
  223. package/dist/esm/types/types/LogBuiltInMetadata.d.ts +0 -16
  224. package/dist/esm/types/types/LogFunction.d.ts +0 -24
  225. package/dist/esm/types/types/LogLevel.d.ts +0 -10
  226. package/dist/esm/types/types/LogMetadataContextMap.d.ts +0 -11
  227. package/dist/esm/types/types/LogMetadataTagMap.d.ts +0 -8
  228. package/dist/esm/types/types/LogMetadataTargetMap.d.ts +0 -8
  229. package/dist/esm/types/types/LogMetadataType.d.ts +0 -13
  230. package/dist/esm/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
  231. package/dist/esm/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
  232. package/dist/esm/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
  233. package/dist/esm/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
  234. package/dist/esm/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
  235. package/dist/esm/types/types/LogReviewerFilterState/index.d.ts +0 -17
  236. package/dist/esm/types/types/LogSource.d.ts +0 -9
  237. package/dist/esm/types/types/LogType.d.ts +0 -9
  238. package/dist/esm/types/types/ParamType.d.ts +0 -17
  239. package/dist/esm/types/types/ReactKitErrorCode.d.ts +0 -14
  240. package/src/constants/DAY_IN_MS.ts +0 -7
  241. package/src/constants/HOUR_IN_MS.ts +0 -7
  242. package/src/constants/LOG_REVIEW_GET_LOGS_ROUTE.ts +0 -9
  243. package/src/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.ts +0 -9
  244. package/src/constants/LOG_REVIEW_STATUS_ROUTE.ts +0 -10
  245. package/src/constants/LOG_ROUTE_PATH.ts +0 -9
  246. package/src/constants/MINUTE_IN_MS.ts +0 -7
  247. package/src/constants/ROUTE_PATH_PREFIX.ts +0 -7
  248. package/src/constants/SELECT_ADMIN_CHECK_ROUTE.ts +0 -7
  249. package/src/errors/ErrorWithCode.tsx +0 -15
  250. package/src/helpers/abbreviate.test.ts +0 -26
  251. package/src/helpers/abbreviate.ts +0 -25
  252. package/src/helpers/asyncArrayFunctions/everyAsync.test.ts +0 -114
  253. package/src/helpers/asyncArrayFunctions/everyAsync.ts +0 -51
  254. package/src/helpers/asyncArrayFunctions/filterAsync.test.ts +0 -126
  255. package/src/helpers/asyncArrayFunctions/filterAsync.ts +0 -50
  256. package/src/helpers/asyncArrayFunctions/forEachAsync.test.ts +0 -136
  257. package/src/helpers/asyncArrayFunctions/forEachAsync.ts +0 -40
  258. package/src/helpers/asyncArrayFunctions/mapAsync.test.ts +0 -125
  259. package/src/helpers/asyncArrayFunctions/mapAsync.ts +0 -46
  260. package/src/helpers/asyncArrayFunctions/someAsync.test.ts +0 -92
  261. package/src/helpers/asyncArrayFunctions/someAsync.ts +0 -49
  262. package/src/helpers/avg.test.ts +0 -24
  263. package/src/helpers/avg.ts +0 -22
  264. package/src/helpers/capitalize.ts +0 -20
  265. package/src/helpers/ceilToNumDecimals.test.ts +0 -39
  266. package/src/helpers/ceilToNumDecimals.ts +0 -13
  267. package/src/helpers/cloneDeep.ts +0 -11
  268. package/src/helpers/compareArraysByProp.test.ts +0 -147
  269. package/src/helpers/compareArraysByProp.ts +0 -56
  270. package/src/helpers/extractProp.test.ts +0 -34
  271. package/src/helpers/extractProp.ts +0 -17
  272. package/src/helpers/floorToNumDecimals.test.ts +0 -39
  273. package/src/helpers/floorToNumDecimals.ts +0 -13
  274. package/src/helpers/forceNumIntoBounds.test.ts +0 -34
  275. package/src/helpers/forceNumIntoBounds.ts +0 -19
  276. package/src/helpers/genCSV.test.ts +0 -75
  277. package/src/helpers/genCSV.ts +0 -87
  278. package/src/helpers/genCommaList.test.ts +0 -57
  279. package/src/helpers/genCommaList.ts +0 -21
  280. package/src/helpers/getHumanReadableDate.test.ts +0 -29
  281. package/src/helpers/getHumanReadableDate.ts +0 -36
  282. package/src/helpers/getLocalTimeInfo.test.ts +0 -48
  283. package/src/helpers/getLocalTimeInfo.ts +0 -58
  284. package/src/helpers/getMonthName.test.ts +0 -79
  285. package/src/helpers/getMonthName.ts +0 -29
  286. package/src/helpers/getOrdinal.test.ts +0 -84
  287. package/src/helpers/getOrdinal.ts +0 -14
  288. package/src/helpers/getPartOfDay.test.ts +0 -56
  289. package/src/helpers/getPartOfDay.ts +0 -20
  290. package/src/helpers/getTimeInfoInET.test.ts +0 -72
  291. package/src/helpers/getTimeInfoInET.ts +0 -79
  292. package/src/helpers/getTimestampFromTimeInfoInET.ts +0 -179
  293. package/src/helpers/getWordCount.ts +0 -26
  294. package/src/helpers/idify.ts +0 -24
  295. package/src/helpers/onlyKeepLetters.ts +0 -11
  296. package/src/helpers/padDecimalZeros.tsx +0 -32
  297. package/src/helpers/padZerosLeft.tsx +0 -21
  298. package/src/helpers/parallelLimit.ts +0 -63
  299. package/src/helpers/prefixWithAOrAn.ts +0 -29
  300. package/src/helpers/roundToNumDecimals.tsx +0 -13
  301. package/src/helpers/shuffleArray.ts +0 -19
  302. package/src/helpers/startMinWait.ts +0 -33
  303. package/src/helpers/stringsToHumanReadableList.ts +0 -39
  304. package/src/helpers/sum.tsx +0 -16
  305. package/src/helpers/validators/ChicagoTitleCase.test.ts +0 -85
  306. package/src/helpers/validators/ChicagoTitleCase.ts +0 -32
  307. package/src/helpers/validators/findURL.test.ts +0 -83
  308. package/src/helpers/validators/findURL.ts +0 -43
  309. package/src/helpers/validators/shared/constants/ERROR_MESSAGES.ts +0 -18
  310. package/src/helpers/validators/shared/helpers/validateRegex.ts +0 -47
  311. package/src/helpers/validators/shared/types/ValidationResult.ts +0 -20
  312. package/src/helpers/validators/validURL.test.ts +0 -90
  313. package/src/helpers/validators/validURL.ts +0 -18
  314. package/src/helpers/validators/validateEmail.test.ts +0 -110
  315. package/src/helpers/validators/validateEmail.ts +0 -47
  316. package/src/helpers/validators/validatePhoneNumber.test.ts +0 -94
  317. package/src/helpers/validators/validatePhoneNumber.ts +0 -49
  318. package/src/helpers/validators/validateString.test.ts +0 -173
  319. package/src/helpers/validators/validateString.ts +0 -171
  320. package/src/helpers/waitMs.tsx +0 -12
  321. package/src/types/DayOfWeek.ts +0 -15
  322. package/src/types/Log/LogMainInfo.ts +0 -69
  323. package/src/types/Log/LogSourceSpecificInfo.ts +0 -25
  324. package/src/types/Log/LogTypeSpecificInfo.ts +0 -33
  325. package/src/types/Log/index.ts +0 -17
  326. package/src/types/LogAction.ts +0 -52
  327. package/src/types/LogBuiltInMetadata.ts +0 -19
  328. package/src/types/LogFunction.ts +0 -46
  329. package/src/types/LogLevel.ts +0 -11
  330. package/src/types/LogMetadataContextMap.ts +0 -15
  331. package/src/types/LogMetadataTagMap.ts +0 -9
  332. package/src/types/LogMetadataTargetMap.ts +0 -9
  333. package/src/types/LogMetadataType.ts +0 -16
  334. package/src/types/LogReviewerFilterState/ActionErrorFilterState.ts +0 -24
  335. package/src/types/LogReviewerFilterState/AdvancedFilterState.ts +0 -36
  336. package/src/types/LogReviewerFilterState/ContextFilterState.ts +0 -16
  337. package/src/types/LogReviewerFilterState/DateFilterState.ts +0 -26
  338. package/src/types/LogReviewerFilterState/TagFilterState.ts +0 -9
  339. package/src/types/LogReviewerFilterState/index.ts +0 -24
  340. package/src/types/LogSource.ts +0 -12
  341. package/src/types/LogType.ts +0 -12
  342. package/src/types/ParamType.ts +0 -18
  343. package/src/types/ReactKitErrorCode.tsx +0 -17
@@ -1,29 +0,0 @@
1
- // Constants
2
- const VOWELS = ['a', 'e', 'i', 'o', 'u'];
3
-
4
- /**
5
- * Prefix a word or name with "a" or "an" depending on whether it starts with a
6
- * vowel or not
7
- * @author Gabe Abrams
8
- * @param text the text to prefix
9
- * @param capitalize whether to capitalize the "A" or "An"
10
- * @returns the text prefixed with "a" or "an"
11
- */
12
- const prefixWithAOrAn = (text: string, capitalize = false): string => {
13
- // Get the first letter
14
- const firstLetter = text.charAt(0).toLowerCase();
15
-
16
- // Check if starts with vowel
17
- const startsWithVowel = VOWELS.includes(firstLetter);
18
-
19
- // Determine prefix
20
- let prefix = startsWithVowel ? 'an' : 'a';
21
- if (capitalize) {
22
- prefix = prefix.charAt(0).toUpperCase() + prefix.substring(1);
23
- }
24
-
25
- // Return the text prefixed with "a" or "an"
26
- return `${prefix} ${text}`;
27
- };
28
-
29
- export default prefixWithAOrAn;
@@ -1,13 +0,0 @@
1
- /**
2
- * Round a number to a certain number of decimals
3
- * @author Gabe Abrams
4
- * @param num the number to round
5
- * @param numDecimals the number of decimals to round to
6
- * @returns rounded number
7
- */
8
- const roundToNumDecimals = (num: number, numDecimals: number): number => {
9
- const rounder = 10 ** numDecimals;
10
- return (Math.round(num * rounder) / rounder);
11
- };
12
-
13
- export default roundToNumDecimals;
@@ -1,19 +0,0 @@
1
- /**
2
- * Shuffle a given array
3
- * @author Austen Money
4
- * @param arr the array to shuffle
5
- * @returns the shuffled array
6
- */
7
- const shuffleArray = <T>(arr: T[]): T[] => {
8
- const newArr = [...arr];
9
-
10
- // Shuffle using Durstenfeld algorithm
11
- for (let i = arr.length - 1; i > 0; i--) {
12
- const j = Math.floor(Math.random() * (i + 1));
13
- [newArr[i], newArr[j]] = [newArr[j], newArr[i]];
14
- }
15
-
16
- return newArr;
17
- };
18
-
19
- export default shuffleArray;
@@ -1,33 +0,0 @@
1
- // Import other helpers
2
- import waitMs from './waitMs';
3
-
4
- /**
5
- * Start a dynamic wait, call the function once the operation has completed and
6
- * the dynamic wait will continue waiting for the rest of the minimum time
7
- * @author Gabe Abrams
8
- * @param minWaitMs the minimum number of ms to wait
9
- * @returns async function to call to finish the wait
10
- */
11
- const startMinWait = (minWaitMs: number): () => Promise<void> => {
12
- const startTimestamp = Date.now();
13
-
14
- /**
15
- * Finish the remaining time to wait
16
- * @author Gabe Abrams
17
- */
18
- return async () => {
19
- const endTimestamp = Date.now();
20
-
21
- // Calculate remaining time to wait
22
- const elapsedTimeMs = (endTimestamp - startTimestamp);
23
- const remainingTimeToWaitMs = minWaitMs - elapsedTimeMs;
24
- if (remainingTimeToWaitMs <= 0) {
25
- return;
26
- }
27
-
28
- // Perform wait
29
- await waitMs(remainingTimeToWaitMs);
30
- };
31
- };
32
-
33
- export default startMinWait;
@@ -1,39 +0,0 @@
1
- /**
2
- * Create a human readable list from an array of strings.
3
- * For example, ['apple', 'orange'] becomes "apple and orange"
4
- * and ['apple', 'orange', 'mango'] becomes "apple, orange, and mango"
5
- * @author Gabe Abrams
6
- * @param items list of items in the list
7
- * @returns human-readable list
8
- */
9
- const stringsToHumanReadableList = (items: string[]): string => {
10
- // Handle 0-item case
11
- if (items.length === 0) {
12
- return '';
13
- }
14
-
15
- // Handle 1-item case
16
- if (items.length === 1) {
17
- return items[0];
18
- }
19
-
20
- // Handle 2-item case
21
- if (items.length === 2) {
22
- return `${items[0]} and ${items[1]}`;
23
- }
24
-
25
- // Handle 3+ item case
26
- let list = '';
27
- items.forEach((item, i) => {
28
- if (i === items.length - 1) {
29
- // Last item
30
- list += `, and ${item}`;
31
- }
32
-
33
- // Previous items
34
- list += `, ${item}`;
35
- });
36
- return list;
37
- };
38
-
39
- export default stringsToHumanReadableList;
@@ -1,16 +0,0 @@
1
- /**
2
- * Sum the numbers in an array
3
- * @author Gabe Abrams
4
- * @param nums the numbers to sum
5
- * @returns the sum of the numbers
6
- */
7
- const sum = (nums: number[]): number => {
8
- return nums.reduce(
9
- (a: number, b: number) => {
10
- return (a + b);
11
- },
12
- 0,
13
- );
14
- };
15
-
16
- export default sum;
@@ -1,85 +0,0 @@
1
- // Importing the testing function
2
- // import chicagoTitleCase from './chicagoTitleCase';
3
-
4
- // // Import constants
5
- // import { INVALID_STRING_ERRORS, INVALID_REGEX_ERROR } from './shared/constants/ERROR_MESSAGES';
6
-
7
- // /*------------------------------------------------------------------------*/
8
- // /* ---------------------------- Valid Tests --------------------------- */
9
- // /*------------------------------------------------------------------------*/
10
-
11
- // const validTests: { input: string, expected: string }[] = [
12
- // {
13
- // input: 'this is the american language',
14
- // expected: 'This the American language',
15
- // },
16
- // {
17
- // input: 'to kill a mockingbird',
18
- // expected: 'To Kill a Mockingbird',
19
- // },
20
- // {
21
- // input: 'the lord of the rings',
22
- // expected: 'The Lord of the Rings',
23
- // },
24
- // {
25
- // input: 'pride and prejudice',
26
- // expected: 'Pride and Prejudice',
27
- // },
28
- // {
29
- // input: 'the road not taken',
30
- // expected: 'The Road Not Taken',
31
- // },
32
- // ];
33
-
34
- // test(
35
- // 'Converts strings to Chicago title case correctly.',
36
- // async () => {
37
- // validTests.forEach(({ input, expected }) => {
38
- // expect(chicagoTitleCase(input)).toBe(expected);
39
- // });
40
- // },
41
- // );
42
-
43
- // /*------------------------------------------------------------------------*/
44
- // /* ---------------------------- Edge Cases ---------------------------- */
45
- // /*------------------------------------------------------------------------*/
46
-
47
- // const edgeCases: { input: string, expected: string }[] = [
48
- // {
49
- // input: 'x',
50
- // expected: 'X',
51
- // },
52
- // {
53
- // input: ' ',
54
- // expected: ' ',
55
- // },
56
- // {
57
- // input: '',
58
- // expected: '',
59
- // },
60
- // {
61
- // input: 'the',
62
- // expected: 'The',
63
- // },
64
- // {
65
- // input: 'THE ROAD NOT TAKEN',
66
- // expected: 'The Road Not Taken',
67
- // },
68
- // {
69
- // input: 'tO kiLL A mOckingBirD',
70
- // expected: 'To Kill a Mockingbird',
71
- // },
72
- // {
73
- // input: 'pRiDe And pReduJiCe',
74
- // expected: 'Pride and Prejudice',
75
- // },
76
- // ];
77
-
78
- // test(
79
- // 'Handles the edge cases for the function that converts a string to Chicago Title Case.',
80
- // async () => {
81
- // edgeCases.forEach(({ input, expected }) => {
82
- // expect(chicagoTitleCase(input)).toBe(expected);
83
- // });
84
- // },
85
- // );
@@ -1,32 +0,0 @@
1
- /**
2
- * This function converts a string to title case based on Chicago Title Case
3
- * Style rules.
4
- * @author Leisha Bhandari
5
- * @param input: The input string that needs to be converted to Chicago title
6
- * case.
7
- * @returns Input string converted to title case
8
- */
9
-
10
-
11
- const chicagoTitleCase = (input: string): string => {
12
- // List of lowercase words according to Chicago Manual of Style
13
- const lowerCaseWords: string[] = [
14
- 'in', 'nor', 'of', 'on', 'or', 'as', 'at', 'but', 'by',
15
- 'for', 'if', 'so', 'the', 'a', 'an', 'and', 'to', 'up',
16
- 'yet'
17
- ];
18
-
19
- return input
20
- // Converts given input string to lowercase
21
- .toLowerCase()
22
- // Splits the given string into separate words
23
- .split(' ')
24
- .map((word, index, words) =>
25
- // Capitalize the first word, last word, and the words that aren't
26
- // in lowerCaseWords
27
- index === 0 || !lowerCaseWords.includes(word) || index === words.length - 1
28
- ? `${word.charAt(0).toUpperCase()}${word.slice(1)}` // Capitalize the first letter
29
- : word // Nothing happens to the word
30
- )
31
- .join(' '); // Joins the words back
32
- };
@@ -1,83 +0,0 @@
1
- // Import the function to be tested
2
- // import findURLs from './findURL';
3
-
4
- // // Import constants
5
- // import { INVALID_STRING_ERRORS, INVALID_REGEX_ERROR } from './shared/constants/ERROR_MESSAGES';
6
-
7
- // /*------------------------------------------------------------------------*/
8
- // /* ---------------------------- Valid Tests --------------------------- */
9
- // /*------------------------------------------------------------------------*/
10
-
11
- // const validTests: { block: string, expected: { start: number, end: number }[] }[] = [
12
- // {
13
- // block: 'Visit http://example.com for more information.',
14
- // expected: [{ start: 6, end: 23 }],
15
- // },
16
- // {
17
- // block: 'Multiple URLs: http://one.com and http://two.com.',
18
- // expected: [
19
- // { start: 15, end: 29 },
20
- // { start: 34, end: 48 },
21
- // ],
22
- // },
23
- // {
24
- // block: 'Localhost URLs: http://localhost and http://127.0.0.1.',
25
- // expected: [
26
- // { start: 16, end: 31 },
27
- // { start: 36, end: 52 },
28
- // ],
29
- // },
30
- // {
31
- // block: 'Embedded URL: text https://embedded-url.com?query=1&value=2.',
32
- // expected: [{ start: 13, end: 51 }],
33
- // },
34
- // {
35
- // block: 'Secure site: https://secure-site.com/path?query=string#fragment',
36
- // expected: [{ start: 13, end: 58 }],
37
- // },
38
- // ];
39
-
40
- // test(
41
- // 'Returns correct start and end indices for valid URLs within a string.',
42
- // async () => {
43
- // validTests.forEach(({ block, expected }) => {
44
- // expect(findURLs(block)).toStrictEqual(expected);
45
- // });
46
- // },
47
- // );
48
-
49
- // /*------------------------------------------------------------------------*/
50
- // /* ---------------------------- Invalid Tests --------------------------- */
51
- // /*------------------------------------------------------------------------*/
52
-
53
- // const invalidTests: { block: string, expected: { start: number, end: number }[] }[] = [
54
- // {
55
- // block: 'No URL.',
56
- // expected: [],
57
- // },
58
- // {
59
- // block: 'URL format is wrong: http:/example.com and htt://example.com.',
60
- // expected: [],
61
- // },
62
- // {
63
- // block: 'Any punctuation after the URL http://example.com, should not count.',
64
- // expected: [{ start: 20, end: 37 }],
65
- // },
66
- // {
67
- // block: 'Starting punctuation ,http://example.com should not count.',
68
- // expected: [{ start: 22, end: 39 }],
69
- // },
70
- // {
71
- // block: 'Spaces in the middle http://exa mple.com is invalid.',
72
- // expected: [],
73
- // },
74
- // ];
75
-
76
- // test(
77
- // 'Returns empty array for strings without valid URLs.',
78
- // async () => {
79
- // invalidTests.forEach(({ block, expected }) => {
80
- // expect(findURLs(block)).toStrictEqual(expected);
81
- // });
82
- // },
83
- // );
@@ -1,43 +0,0 @@
1
- // /**
2
- // * This function finds URLs within a given string and returns an array of
3
- // * their locations.
4
- // * @author Leisha Bhandari
5
- // * @param block: The block of text to search for URLs
6
- // * @returns Arrays where each of them contain the start and end index of the URL
7
- // */
8
- // function findURLs(block: string): { start: number, end: number }[] {
9
- // // Expression representing the skeleton of a URL to help match and find the
10
- // // URLs within the block of text (Also takes care of Unicode characters)
11
- // const urlSkeleton = /(https?:\/\/[^\s\u0000-\u001F.,]+[^\s\u0000-\u001F.,]?(?:\?[^\s\u0000-\u001F]+)?(?:#[^\s\u0000-\u001F]+)?)/g;
12
- // const found: { start: number, end: number }[] = [];
13
- // let match: RegExpExecArray | null;
14
-
15
- // // While loop to find the URLs in the given block of texts using the URL
16
- // // skeleton
17
- // while ((match === urlSkeleton.exec(block))
18
- // && match !== null) {
19
- // // To find the beginning index of the URL
20
- // let start = match.index;
21
- // // To find the last index of the URL
22
- // let end = match.index + match[0].length;
23
-
24
- // // If statements to check whether the URL is followed by some kind of
25
- // // punctuation mark
26
- // if (block.charAt(end) === '.' || /[,;:!?"]/.test(block.charAt(end))) {
27
- // end--;
28
- // }
29
-
30
- // // While statement to make sure that the URL does not start with a
31
- // // punctuation mark
32
- // while (start > 0 && /[.,:;!?]/.test(block.charAt(start - 1))) {
33
- // start--;
34
- // }
35
-
36
- // // The object with start and end index of the URL is found and pushed to
37
- // // the found array
38
- // found.push({ start, end });
39
- // }
40
-
41
- // // Returns the array of the found URLs location
42
- // return found;
43
- // }
@@ -1,18 +0,0 @@
1
- /*------------------------------------------------------------------------*/
2
- /* ------------------------------ Constants ----------------------------- */
3
- /*------------------------------------------------------------------------*/
4
-
5
- export const INVALID_REGEX_ERROR = 'input does not follow the requested format';
6
- export const INVALID_EMAIL_ERROR = 'Please provide a valid email address.';
7
- export const INVALID_PHONE_ERROR = 'Please provide a valid phone number.';
8
- export const INVALID_STRING_ERRORS = {
9
- MIN_LEN: (minLen: number) => {
10
- return `input must not be under ${minLen} character(s)`;
11
- },
12
- MAX_LEN: (maxLen: number) => {
13
- return `input must not be over ${maxLen} character(s)`;
14
- },
15
- LETTERS_ONLY: 'input must only contain letters',
16
- NUMBERS_ONLY: 'input must only contain numbers',
17
- MESSAGE_INTRO: 'The following error(s) occurred: ',
18
- };
@@ -1,47 +0,0 @@
1
- // Import types
2
- import ValidationResult from '../types/ValidationResult';
3
-
4
- // Import constants
5
- import { INVALID_REGEX_ERROR } from '../constants/ERROR_MESSAGES';
6
-
7
- /**
8
- * Determines whether a given input string is considered valid based on
9
- * the provided regex.
10
- * @author Austen Money
11
- * @param opts object containing all args
12
- * @param opts.input user-provided input to validate
13
- * @param opts.regex regular expression to check against input
14
- * @param [opts.regexDescription] description of what regexString is checking
15
- * for, used to customize error message
16
- * @returns the unchanged input if valid, or a customized error message if
17
- * invalid
18
- */
19
- const validateRegex = (
20
- opts: {
21
- input: string,
22
- regex: RegExp,
23
- regexDescription?: string,
24
- },
25
- ): ValidationResult<string> => {
26
- // customize error message in case of invalid input
27
- const errorMessage = `${INVALID_REGEX_ERROR}${
28
- opts.regexDescription
29
- ? ': '
30
- : ''
31
- }${opts.regexDescription}`;
32
-
33
- // return error message if test is invalid, or input string if valid
34
- return (
35
- opts.regex.test(opts.input)
36
- ? {
37
- isValid: true,
38
- cleanedValue: opts.input,
39
- }
40
- : {
41
- isValid: false,
42
- errorMessage,
43
- }
44
- );
45
- };
46
-
47
- export default validateRegex;
@@ -1,20 +0,0 @@
1
- /**
2
- * Result of a validation function.
3
- * @author Austen Money
4
- */
5
- type ValidationResult<CleanedValueType> = (
6
- | {
7
- // if true, the validation was successful
8
- isValid: true,
9
- // the cleaned version of the value
10
- cleanedValue: CleanedValueType,
11
- }
12
- | {
13
- // if false, the validation was not successful
14
- isValid: false,
15
- // describes why the validation failed
16
- errorMessage: string,
17
- }
18
- );
19
-
20
- export default ValidationResult;
@@ -1,90 +0,0 @@
1
-
2
- // Import the function to be tested
3
- // import isValid from './validURL';
4
-
5
- // // Import constants
6
- // import { INVALID_STRING_ERRORS, INVALID_REGEX_ERROR } from './shared/constants/ERROR_MESSAGES';
7
-
8
- // /*------------------------------------------------------------------------*/
9
- // /* ---------------------------- Valid Tests --------------------------- */
10
- // /*------------------------------------------------------------------------*/
11
-
12
- // const validUrls: string[] = [
13
- // 'http://example.com',
14
- // 'https://example.com',
15
- // 'http://www.example.com',
16
- // 'https://www.example.com',
17
- // 'https://example.com/path',
18
- // 'http://example.com/path',
19
- // 'https://example.com?query=string',
20
- // 'http://example.com?query=string',
21
- // 'https://example.com#fragment',
22
- // 'http://example.com#fragment',
23
- // 'http://localhost',
24
- // 'https://localhost:3000',
25
- // 'http://localhost:3000',
26
- // 'http://127.0.0.1',
27
- // 'http://127.0.0.1:3000',
28
- // 'ftp://example.com/path',
29
- // 'ftp://example.com',
30
- // 'https://127.0.0.1:3000',
31
- // 'file:///C:/path/to/file'
32
- // ];
33
-
34
- // test(
35
- // 'Returns true for a given valid URL.',
36
- // async () => {
37
- // validUrls.forEach((url) => {
38
- // expect(isValid(url)).toBe(true);
39
- // });
40
- // },
41
- // );
42
-
43
- // /*------------------------------------------------------------------------*/
44
- // /* ---------------------------- Invalid Tests --------------------------- */
45
- // /*------------------------------------------------------------------------*/
46
-
47
- // const invalidUrls: string[] = [
48
- // '',
49
- // ' ',
50
- // 'example',
51
- // 'http://',
52
- // 'http://.',
53
- // 'http://..',
54
- // 'http://##/',
55
- // 'http://../',
56
- // 'http://??/',
57
- // 'http://#',
58
- // 'http://##',
59
- // '//',
60
- // '//a',
61
- // '///a',
62
- // '///',
63
- // 'http:///a',
64
- // 'http://www.foo.bar./',
65
- // 'http://foo.bar/foo(bar)baz quux',
66
- // 'http://3628126748',
67
- // 'http://.www.foo.bar/',
68
- // 'http://.www.foo.bar./',
69
- // 'http://123.123.123',
70
- // 'http://1.1.1.1.1',
71
- // 'http://example.com:99999',
72
- // 'http://example.com:80:80',
73
- // 'http://example.com::80',
74
- // 'http://example.com:-80',
75
- // 'http://-example.com',
76
- // 'http://example.com-',
77
- // 'http://example.com_',
78
- // 'http://example..com',
79
- // 'http://example.com.',
80
- // 'http://.example.com'
81
- // ];
82
-
83
- // test(
84
- // 'Returns false for a given invalid URL.',
85
- // async () => {
86
- // invalidUrls.forEach((url) => {
87
- // expect(isValid(url)).toBe(false);
88
- // });
89
- // },
90
- // );
@@ -1,18 +0,0 @@
1
- /**
2
- * This function checks if a given input string is a valid URL.
3
- * @author Leisha Bhandari
4
- * @param URL: The input string that needs checked as a URL or not.
5
- * @returns A true boolean value if the input string is a valid URL, and a false
6
- * boolean value if the input string is a invalid URL
7
- */
8
- function isValid(url: string): boolean {
9
- // Uses the input URL to create a URL object
10
- try {
11
- new URL(url);
12
- // URL constructor does not throw an error, so input URL is valid
13
- return true;
14
- } catch (err) {
15
- // URL constructor throws an error, so input URL is invalid
16
- return false;
17
- }
18
- }