@onivoro/isomorphic-common 0.2.3 → 0.3.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 (266) hide show
  1. package/dist/cjs/jest.config.d.ts +14 -0
  2. package/dist/cjs/src/lib/constants/millis-per-day.constant.d.ts +1 -0
  3. package/dist/cjs/src/lib/constants/millis-per-hour.constant.d.ts +1 -0
  4. package/dist/cjs/src/lib/constants/millis-per-minute.constant.d.ts +1 -0
  5. package/dist/cjs/src/lib/functions/add-offset.function.d.ts +1 -0
  6. package/dist/cjs/src/lib/functions/camel-case.function.d.ts +20 -0
  7. package/dist/cjs/src/lib/functions/convert-object-to-literal.function.d.ts +1 -0
  8. package/dist/cjs/src/lib/functions/from-boolean-string.function.d.ts +1 -0
  9. package/dist/cjs/src/lib/functions/from-calendar-date.function.d.ts +1 -0
  10. package/dist/cjs/src/lib/functions/from-csv-string.function.d.ts +1 -0
  11. package/dist/cjs/src/lib/functions/get-tag.function.d.ts +1 -0
  12. package/dist/cjs/src/lib/functions/is-symbol.function.d.ts +1 -0
  13. package/dist/cjs/src/lib/functions/kebab-case.function.d.ts +1 -0
  14. package/dist/cjs/src/lib/functions/parse-bool.function.d.ts +1 -0
  15. package/dist/cjs/src/lib/functions/properties-to-array.function.d.ts +1 -0
  16. package/dist/cjs/src/lib/functions/sanitize-filename.function.d.ts +1 -0
  17. package/{src/lib/functions/snake-case.function.ts → dist/cjs/src/lib/functions/snake-case.function.d.ts} +1 -11
  18. package/dist/cjs/src/lib/functions/subtract-offset.function.d.ts +1 -0
  19. package/dist/cjs/src/lib/functions/subtract-offset.function.spec.d.ts +1 -0
  20. package/dist/cjs/src/lib/functions/to-boolean-string.function.d.ts +1 -0
  21. package/dist/cjs/src/lib/functions/to-calendar-date.function.d.ts +1 -0
  22. package/dist/cjs/src/lib/functions/to-csv-string.function.d.ts +1 -0
  23. package/dist/cjs/src/lib/functions/to-decimal-base.function.d.ts +1 -0
  24. package/dist/cjs/src/lib/functions/to-dollars-and-cents.function.d.ts +1 -0
  25. package/dist/cjs/src/lib/functions/to-dollars-and-cents.function.spec.d.ts +1 -0
  26. package/dist/cjs/src/lib/functions/to-string.function.d.ts +1 -0
  27. package/dist/cjs/src/lib/functions/to-unique-array.function.d.ts +1 -0
  28. package/dist/cjs/src/lib/functions/to-unique-array.function.spec.d.ts +1 -0
  29. package/dist/cjs/src/lib/functions/to-words.function.d.ts +1 -0
  30. package/dist/cjs/src/lib/functions/to-words.function.spec.d.ts +1 -0
  31. package/dist/cjs/src/lib/functions/try-parse-date.function.d.ts +1 -0
  32. package/dist/cjs/src/lib/functions/try-parse-date.function.spec.d.ts +1 -0
  33. package/dist/cjs/src/lib/functions/unicode-words.const.d.ts +8 -0
  34. package/dist/cjs/src/lib/functions/upper-first.function.d.ts +1 -0
  35. package/dist/cjs/src/lib/functions/upper-first.function.spec.d.ts +1 -0
  36. package/dist/cjs/src/lib/functions/words.function.d.ts +17 -0
  37. package/{src/lib/interfaces/axios-wrapped-nest-exception.interface.ts → dist/cjs/src/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts} +1 -1
  38. package/{src/lib/interfaces/entity-provider.interface.ts → dist/cjs/src/lib/interfaces/entity-provider.interface.d.ts} +1 -1
  39. package/dist/cjs/src/lib/interfaces/keys-of.type.d.ts +3 -0
  40. package/dist/esm/jest.config.d.ts +14 -0
  41. package/{src/index.ts → dist/esm/src/index.d.ts} +0 -2
  42. package/dist/esm/src/index.js +29 -0
  43. package/dist/esm/src/lib/constants/millis-per-day.constant.d.ts +1 -0
  44. package/dist/esm/src/lib/constants/millis-per-hour.constant.d.ts +1 -0
  45. package/dist/esm/src/lib/constants/millis-per-minute.constant.d.ts +1 -0
  46. package/dist/esm/src/lib/functions/add-offset.function.d.ts +1 -0
  47. package/dist/esm/src/lib/functions/add-offset.function.spec.d.ts +1 -0
  48. package/dist/esm/src/lib/functions/camel-case.function.d.ts +20 -0
  49. package/dist/esm/src/lib/functions/convert-object-to-literal.function.d.ts +1 -0
  50. package/dist/esm/src/lib/functions/convert-object-to-literal.function.spec.d.ts +1 -0
  51. package/dist/esm/src/lib/functions/from-boolean-string.function.d.ts +1 -0
  52. package/dist/esm/src/lib/functions/from-calendar-date.function.d.ts +1 -0
  53. package/dist/esm/src/lib/functions/from-calendar-date.function.spec.d.ts +1 -0
  54. package/dist/esm/src/lib/functions/from-csv-string.function.d.ts +1 -0
  55. package/dist/esm/src/lib/functions/get-tag.function.d.ts +1 -0
  56. package/dist/esm/src/lib/functions/is-symbol.function.d.ts +1 -0
  57. package/dist/esm/src/lib/functions/kebab-case.function.d.ts +1 -0
  58. package/dist/esm/src/lib/functions/parse-bool.function.d.ts +1 -0
  59. package/dist/esm/src/lib/functions/properties-to-array.function.d.ts +1 -0
  60. package/dist/esm/src/lib/functions/sanitize-filename.function.d.ts +1 -0
  61. package/dist/esm/src/lib/functions/snake-case.function.d.ts +24 -0
  62. package/dist/esm/src/lib/functions/subtract-offset.function.d.ts +1 -0
  63. package/dist/esm/src/lib/functions/subtract-offset.function.spec.d.ts +1 -0
  64. package/dist/esm/src/lib/functions/to-boolean-string.function.d.ts +1 -0
  65. package/dist/esm/src/lib/functions/to-calendar-date.function.d.ts +1 -0
  66. package/dist/esm/src/lib/functions/to-csv-string.function.d.ts +1 -0
  67. package/dist/esm/src/lib/functions/to-decimal-base.function.d.ts +1 -0
  68. package/dist/esm/src/lib/functions/to-dollars-and-cents.function.d.ts +1 -0
  69. package/dist/esm/src/lib/functions/to-dollars-and-cents.function.spec.d.ts +1 -0
  70. package/dist/esm/src/lib/functions/to-string.function.d.ts +1 -0
  71. package/dist/esm/src/lib/functions/to-unique-array.function.d.ts +1 -0
  72. package/dist/esm/src/lib/functions/to-unique-array.function.spec.d.ts +1 -0
  73. package/dist/esm/src/lib/functions/to-words.function.d.ts +1 -0
  74. package/dist/esm/src/lib/functions/to-words.function.spec.d.ts +1 -0
  75. package/dist/esm/src/lib/functions/try-parse-date.function.d.ts +1 -0
  76. package/dist/esm/src/lib/functions/try-parse-date.function.spec.d.ts +1 -0
  77. package/dist/esm/src/lib/functions/unicode-words.const.d.ts +8 -0
  78. package/dist/esm/src/lib/functions/upper-first.function.d.ts +1 -0
  79. package/dist/esm/src/lib/functions/upper-first.function.spec.d.ts +1 -0
  80. package/dist/esm/src/lib/functions/words.function.d.ts +17 -0
  81. package/dist/esm/src/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts +5 -0
  82. package/dist/esm/src/lib/interfaces/axios-wrapped-nest-exception.interface.js +1 -0
  83. package/dist/esm/src/lib/interfaces/entity-provider.interface.d.ts +9 -0
  84. package/dist/esm/src/lib/interfaces/entity-provider.interface.js +1 -0
  85. package/dist/esm/src/lib/interfaces/keys-of.type.d.ts +3 -0
  86. package/dist/esm/src/lib/interfaces/keys-of.type.js +1 -0
  87. package/dist/types/jest.config.d.ts +14 -0
  88. package/dist/types/src/index.d.ts +29 -0
  89. package/dist/types/src/lib/constants/millis-per-day.constant.d.ts +1 -0
  90. package/dist/types/src/lib/constants/millis-per-hour.constant.d.ts +1 -0
  91. package/dist/types/src/lib/constants/millis-per-minute.constant.d.ts +1 -0
  92. package/dist/types/src/lib/functions/add-offset.function.d.ts +1 -0
  93. package/dist/types/src/lib/functions/add-offset.function.spec.d.ts +1 -0
  94. package/dist/types/src/lib/functions/camel-case.function.d.ts +20 -0
  95. package/dist/types/src/lib/functions/convert-object-to-literal.function.d.ts +1 -0
  96. package/dist/types/src/lib/functions/convert-object-to-literal.function.spec.d.ts +1 -0
  97. package/dist/types/src/lib/functions/from-boolean-string.function.d.ts +1 -0
  98. package/dist/types/src/lib/functions/from-calendar-date.function.d.ts +1 -0
  99. package/dist/types/src/lib/functions/from-calendar-date.function.spec.d.ts +1 -0
  100. package/dist/types/src/lib/functions/from-csv-string.function.d.ts +1 -0
  101. package/dist/types/src/lib/functions/get-tag.function.d.ts +1 -0
  102. package/dist/types/src/lib/functions/is-symbol.function.d.ts +1 -0
  103. package/dist/types/src/lib/functions/kebab-case.function.d.ts +1 -0
  104. package/dist/types/src/lib/functions/parse-bool.function.d.ts +1 -0
  105. package/dist/types/src/lib/functions/properties-to-array.function.d.ts +1 -0
  106. package/dist/types/src/lib/functions/sanitize-filename.function.d.ts +1 -0
  107. package/dist/types/src/lib/functions/snake-case.function.d.ts +24 -0
  108. package/dist/types/src/lib/functions/subtract-offset.function.d.ts +1 -0
  109. package/dist/types/src/lib/functions/subtract-offset.function.spec.d.ts +1 -0
  110. package/dist/types/src/lib/functions/to-boolean-string.function.d.ts +1 -0
  111. package/dist/types/src/lib/functions/to-calendar-date.function.d.ts +1 -0
  112. package/dist/types/src/lib/functions/to-csv-string.function.d.ts +1 -0
  113. package/dist/types/src/lib/functions/to-decimal-base.function.d.ts +1 -0
  114. package/dist/types/src/lib/functions/to-dollars-and-cents.function.d.ts +1 -0
  115. package/dist/types/src/lib/functions/to-dollars-and-cents.function.spec.d.ts +1 -0
  116. package/dist/types/src/lib/functions/to-string.function.d.ts +1 -0
  117. package/dist/types/src/lib/functions/to-unique-array.function.d.ts +1 -0
  118. package/dist/types/src/lib/functions/to-unique-array.function.spec.d.ts +1 -0
  119. package/dist/types/src/lib/functions/to-words.function.d.ts +1 -0
  120. package/dist/types/src/lib/functions/to-words.function.spec.d.ts +1 -0
  121. package/dist/types/src/lib/functions/try-parse-date.function.d.ts +1 -0
  122. package/dist/types/src/lib/functions/try-parse-date.function.spec.d.ts +1 -0
  123. package/dist/types/src/lib/functions/unicode-words.const.d.ts +8 -0
  124. package/dist/types/src/lib/functions/upper-first.function.d.ts +1 -0
  125. package/dist/types/src/lib/functions/upper-first.function.spec.d.ts +1 -0
  126. package/dist/types/src/lib/functions/words.function.d.ts +17 -0
  127. package/dist/types/src/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts +5 -0
  128. package/dist/types/src/lib/interfaces/entity-provider.interface.d.ts +9 -0
  129. package/dist/types/src/lib/interfaces/keys-of.type.d.ts +3 -0
  130. package/package.json +18 -8
  131. package/dist +0 -20
  132. package/jest.config.ts +0 -17
  133. package/src/lib/constants/millis-per-day.constant.ts +0 -3
  134. package/src/lib/constants/millis-per-hour.constant.ts +0 -3
  135. package/src/lib/constants/millis-per-minute.constant.ts +0 -1
  136. package/src/lib/functions/__snapshots__/add-offset.function.spec.ts.snap +0 -5
  137. package/src/lib/functions/__snapshots__/convert-object-to-literal.function.spec.ts.snap +0 -3
  138. package/src/lib/functions/__snapshots__/from-calendar-date.function.spec.ts.snap +0 -3
  139. package/src/lib/functions/__snapshots__/subtract-offset.function.spec.ts.snap +0 -5
  140. package/src/lib/functions/__snapshots__/to-dollars-and-cents.function.spec.ts.snap +0 -3
  141. package/src/lib/functions/__snapshots__/to-words.function.spec.ts.snap +0 -3
  142. package/src/lib/functions/__snapshots__/try-parse-date.function.spec.ts.snap +0 -5
  143. package/src/lib/functions/__snapshots__/upper-first.function.spec.ts.snap +0 -13
  144. package/src/lib/functions/add-offset.function.spec.ts +0 -12
  145. package/src/lib/functions/add-offset.function.ts +0 -14
  146. package/src/lib/functions/camel-case.function.ts +0 -30
  147. package/src/lib/functions/convert-object-to-literal.function.spec.ts +0 -16
  148. package/src/lib/functions/convert-object-to-literal.function.ts +0 -10
  149. package/src/lib/functions/from-boolean-string.function.ts +0 -3
  150. package/src/lib/functions/from-calendar-date.function.spec.ts +0 -11
  151. package/src/lib/functions/from-calendar-date.function.ts +0 -5
  152. package/src/lib/functions/from-csv-string.function.ts +0 -3
  153. package/src/lib/functions/get-tag.function.ts +0 -10
  154. package/src/lib/functions/is-symbol.function.ts +0 -11
  155. package/src/lib/functions/kebab-case.function.ts +0 -5
  156. package/src/lib/functions/parse-bool.function.ts +0 -3
  157. package/src/lib/functions/properties-to-array.function.ts +0 -21
  158. package/src/lib/functions/sanitize-filename.function.ts +0 -9
  159. package/src/lib/functions/subtract-offset.function.spec.ts +0 -12
  160. package/src/lib/functions/subtract-offset.function.ts +0 -14
  161. package/src/lib/functions/to-boolean-string.function.ts +0 -3
  162. package/src/lib/functions/to-calendar-date.function.ts +0 -11
  163. package/src/lib/functions/to-csv-string.function.ts +0 -3
  164. package/src/lib/functions/to-decimal-base.function.ts +0 -23
  165. package/src/lib/functions/to-dollars-and-cents.function.spec.ts +0 -7
  166. package/src/lib/functions/to-dollars-and-cents.function.ts +0 -15
  167. package/src/lib/functions/to-string.function.ts +0 -25
  168. package/src/lib/functions/to-unique-array.function.spec.ts +0 -45
  169. package/src/lib/functions/to-unique-array.function.ts +0 -3
  170. package/src/lib/functions/to-words.function.spec.ts +0 -7
  171. package/src/lib/functions/to-words.function.ts +0 -105
  172. package/src/lib/functions/try-parse-date.function.spec.ts +0 -12
  173. package/src/lib/functions/try-parse-date.function.ts +0 -17
  174. package/src/lib/functions/unicode-words.const.ts +0 -70
  175. package/src/lib/functions/upper-first.function.spec.ts +0 -16
  176. package/src/lib/functions/upper-first.function.ts +0 -10
  177. package/src/lib/functions/words.function.ts +0 -38
  178. package/src/lib/interfaces/keys-of.type.ts +0 -1
  179. package/tsconfig.json +0 -16
  180. /package/{cjs → dist/cjs}/jest.config.js +0 -0
  181. /package/{esm/src/index.js → dist/cjs/src/index.d.ts} +0 -0
  182. /package/{cjs → dist/cjs}/src/index.js +0 -0
  183. /package/{cjs → dist/cjs}/src/lib/constants/millis-per-day.constant.js +0 -0
  184. /package/{cjs → dist/cjs}/src/lib/constants/millis-per-hour.constant.js +0 -0
  185. /package/{cjs → dist/cjs}/src/lib/constants/millis-per-minute.constant.js +0 -0
  186. /package/{cjs → dist/cjs}/src/lib/functions/add-offset.function.js +0 -0
  187. /package/{esm/src/lib/interfaces/axios-wrapped-nest-exception.interface.js → dist/cjs/src/lib/functions/add-offset.function.spec.d.ts} +0 -0
  188. /package/{cjs → dist/cjs}/src/lib/functions/add-offset.function.spec.js +0 -0
  189. /package/{cjs → dist/cjs}/src/lib/functions/camel-case.function.js +0 -0
  190. /package/{cjs → dist/cjs}/src/lib/functions/convert-object-to-literal.function.js +0 -0
  191. /package/{esm/src/lib/interfaces/entity-provider.interface.js → dist/cjs/src/lib/functions/convert-object-to-literal.function.spec.d.ts} +0 -0
  192. /package/{cjs → dist/cjs}/src/lib/functions/convert-object-to-literal.function.spec.js +0 -0
  193. /package/{cjs → dist/cjs}/src/lib/functions/from-boolean-string.function.js +0 -0
  194. /package/{cjs → dist/cjs}/src/lib/functions/from-calendar-date.function.js +0 -0
  195. /package/{esm/src/lib/interfaces/keys-of.type.js → dist/cjs/src/lib/functions/from-calendar-date.function.spec.d.ts} +0 -0
  196. /package/{cjs → dist/cjs}/src/lib/functions/from-calendar-date.function.spec.js +0 -0
  197. /package/{cjs → dist/cjs}/src/lib/functions/from-csv-string.function.js +0 -0
  198. /package/{cjs → dist/cjs}/src/lib/functions/get-tag.function.js +0 -0
  199. /package/{cjs → dist/cjs}/src/lib/functions/is-symbol.function.js +0 -0
  200. /package/{cjs → dist/cjs}/src/lib/functions/kebab-case.function.js +0 -0
  201. /package/{cjs → dist/cjs}/src/lib/functions/parse-bool.function.js +0 -0
  202. /package/{cjs → dist/cjs}/src/lib/functions/properties-to-array.function.js +0 -0
  203. /package/{cjs → dist/cjs}/src/lib/functions/sanitize-filename.function.js +0 -0
  204. /package/{cjs → dist/cjs}/src/lib/functions/snake-case.function.js +0 -0
  205. /package/{cjs → dist/cjs}/src/lib/functions/subtract-offset.function.js +0 -0
  206. /package/{cjs → dist/cjs}/src/lib/functions/subtract-offset.function.spec.js +0 -0
  207. /package/{cjs → dist/cjs}/src/lib/functions/to-boolean-string.function.js +0 -0
  208. /package/{cjs → dist/cjs}/src/lib/functions/to-calendar-date.function.js +0 -0
  209. /package/{cjs → dist/cjs}/src/lib/functions/to-csv-string.function.js +0 -0
  210. /package/{cjs → dist/cjs}/src/lib/functions/to-decimal-base.function.js +0 -0
  211. /package/{cjs → dist/cjs}/src/lib/functions/to-dollars-and-cents.function.js +0 -0
  212. /package/{cjs → dist/cjs}/src/lib/functions/to-dollars-and-cents.function.spec.js +0 -0
  213. /package/{cjs → dist/cjs}/src/lib/functions/to-string.function.js +0 -0
  214. /package/{cjs → dist/cjs}/src/lib/functions/to-unique-array.function.js +0 -0
  215. /package/{cjs → dist/cjs}/src/lib/functions/to-unique-array.function.spec.js +0 -0
  216. /package/{cjs → dist/cjs}/src/lib/functions/to-words.function.js +0 -0
  217. /package/{cjs → dist/cjs}/src/lib/functions/to-words.function.spec.js +0 -0
  218. /package/{cjs → dist/cjs}/src/lib/functions/try-parse-date.function.js +0 -0
  219. /package/{cjs → dist/cjs}/src/lib/functions/try-parse-date.function.spec.js +0 -0
  220. /package/{cjs → dist/cjs}/src/lib/functions/unicode-words.const.js +0 -0
  221. /package/{cjs → dist/cjs}/src/lib/functions/upper-first.function.js +0 -0
  222. /package/{cjs → dist/cjs}/src/lib/functions/upper-first.function.spec.js +0 -0
  223. /package/{cjs → dist/cjs}/src/lib/functions/words.function.js +0 -0
  224. /package/{cjs → dist/cjs}/src/lib/interfaces/axios-wrapped-nest-exception.interface.js +0 -0
  225. /package/{cjs → dist/cjs}/src/lib/interfaces/entity-provider.interface.js +0 -0
  226. /package/{cjs → dist/cjs}/src/lib/interfaces/keys-of.type.js +0 -0
  227. /package/{esm → dist/esm}/jest.config.js +0 -0
  228. /package/{esm → dist/esm}/package.json +0 -0
  229. /package/{esm → dist/esm}/src/lib/constants/millis-per-day.constant.js +0 -0
  230. /package/{esm → dist/esm}/src/lib/constants/millis-per-hour.constant.js +0 -0
  231. /package/{esm → dist/esm}/src/lib/constants/millis-per-minute.constant.js +0 -0
  232. /package/{esm → dist/esm}/src/lib/functions/add-offset.function.js +0 -0
  233. /package/{esm → dist/esm}/src/lib/functions/add-offset.function.spec.js +0 -0
  234. /package/{esm → dist/esm}/src/lib/functions/camel-case.function.js +0 -0
  235. /package/{esm → dist/esm}/src/lib/functions/convert-object-to-literal.function.js +0 -0
  236. /package/{esm → dist/esm}/src/lib/functions/convert-object-to-literal.function.spec.js +0 -0
  237. /package/{esm → dist/esm}/src/lib/functions/from-boolean-string.function.js +0 -0
  238. /package/{esm → dist/esm}/src/lib/functions/from-calendar-date.function.js +0 -0
  239. /package/{esm → dist/esm}/src/lib/functions/from-calendar-date.function.spec.js +0 -0
  240. /package/{esm → dist/esm}/src/lib/functions/from-csv-string.function.js +0 -0
  241. /package/{esm → dist/esm}/src/lib/functions/get-tag.function.js +0 -0
  242. /package/{esm → dist/esm}/src/lib/functions/is-symbol.function.js +0 -0
  243. /package/{esm → dist/esm}/src/lib/functions/kebab-case.function.js +0 -0
  244. /package/{esm → dist/esm}/src/lib/functions/parse-bool.function.js +0 -0
  245. /package/{esm → dist/esm}/src/lib/functions/properties-to-array.function.js +0 -0
  246. /package/{esm → dist/esm}/src/lib/functions/sanitize-filename.function.js +0 -0
  247. /package/{esm → dist/esm}/src/lib/functions/snake-case.function.js +0 -0
  248. /package/{esm → dist/esm}/src/lib/functions/subtract-offset.function.js +0 -0
  249. /package/{esm → dist/esm}/src/lib/functions/subtract-offset.function.spec.js +0 -0
  250. /package/{esm → dist/esm}/src/lib/functions/to-boolean-string.function.js +0 -0
  251. /package/{esm → dist/esm}/src/lib/functions/to-calendar-date.function.js +0 -0
  252. /package/{esm → dist/esm}/src/lib/functions/to-csv-string.function.js +0 -0
  253. /package/{esm → dist/esm}/src/lib/functions/to-decimal-base.function.js +0 -0
  254. /package/{esm → dist/esm}/src/lib/functions/to-dollars-and-cents.function.js +0 -0
  255. /package/{esm → dist/esm}/src/lib/functions/to-dollars-and-cents.function.spec.js +0 -0
  256. /package/{esm → dist/esm}/src/lib/functions/to-string.function.js +0 -0
  257. /package/{esm → dist/esm}/src/lib/functions/to-unique-array.function.js +0 -0
  258. /package/{esm → dist/esm}/src/lib/functions/to-unique-array.function.spec.js +0 -0
  259. /package/{esm → dist/esm}/src/lib/functions/to-words.function.js +0 -0
  260. /package/{esm → dist/esm}/src/lib/functions/to-words.function.spec.js +0 -0
  261. /package/{esm → dist/esm}/src/lib/functions/try-parse-date.function.js +0 -0
  262. /package/{esm → dist/esm}/src/lib/functions/try-parse-date.function.spec.js +0 -0
  263. /package/{esm → dist/esm}/src/lib/functions/unicode-words.const.js +0 -0
  264. /package/{esm → dist/esm}/src/lib/functions/upper-first.function.js +0 -0
  265. /package/{esm → dist/esm}/src/lib/functions/upper-first.function.spec.js +0 -0
  266. /package/{esm → dist/esm}/src/lib/functions/words.function.js +0 -0
@@ -0,0 +1 @@
1
+ export declare function isSymbol(value: any): boolean;
@@ -0,0 +1 @@
1
+ export declare function kebabCase(string: any): any;
@@ -0,0 +1 @@
1
+ export declare function parseBool(asc: string | boolean | null | undefined): boolean;
@@ -0,0 +1 @@
1
+ export declare function propertiesToArray(obj: any): any;
@@ -0,0 +1 @@
1
+ export declare function sanitizeFilename(filename: string): string;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Converts `string` to
3
+ * [snake case](https://en.wikipedia.org/wiki/Snake_case).
4
+ *
5
+ * @since 3.0.0
6
+ * @category String
7
+ * @param {string} [string=''] The string to convert.
8
+ * @returns {string} Returns the snake cased string.
9
+ * @see camelCase, lowerCase, kebabCase, startCase, upperCase, upperFirst
10
+ * @example
11
+ *
12
+ * snakeCase('Foo Bar')
13
+ * // => 'foo_bar'
14
+ *
15
+ * snakeCase('fooBar')
16
+ * // => 'foo_bar'
17
+ *
18
+ * snakeCase('--FOO-BAR--')
19
+ * // => 'foo_bar'
20
+ *
21
+ * snakeCase('foo2bar')
22
+ * // => 'foo_2_bar'
23
+ */
24
+ export declare function snakeCase(string: any): any;
@@ -0,0 +1 @@
1
+ export declare function subtractOffset(input: string | Date | undefined | null): Date | undefined;
@@ -0,0 +1 @@
1
+ export declare function toBooleanString(val?: boolean): "true" | "false";
@@ -0,0 +1 @@
1
+ export declare function toCalendarDate(input: string | Date | undefined | null): string | undefined;
@@ -0,0 +1 @@
1
+ export declare function toCsvString(val?: string[]): string;
@@ -0,0 +1 @@
1
+ export declare function toDecimalBase(n: string | number, base?: number): number;
@@ -0,0 +1 @@
1
+ export declare function toDollarsAndCents(number: any): string;
@@ -0,0 +1 @@
1
+ export declare function toString(value: any): string;
@@ -0,0 +1 @@
1
+ export declare function toUniqueArray<TElement>(elements: TElement[]): TElement[];
@@ -0,0 +1 @@
1
+ export declare function toWords(number: any): string;
@@ -0,0 +1 @@
1
+ export declare function tryParseDate(input: string | Date | undefined | null): Date | undefined;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Splits a Unicode `string` into an array of its words.
3
+ *
4
+ * @private
5
+ * @param {string} The string to inspect.
6
+ * @returns {Array} Returns the words of `string`.
7
+ */
8
+ export declare function unicodeWords(string: any): any;
@@ -0,0 +1 @@
1
+ export declare function upperFirst(string: any): any;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Splits `string` into an array of its words.
3
+ *
4
+ * @since 3.0.0
5
+ * @category String
6
+ * @param {string} [string=''] The string to inspect.
7
+ * @param {RegExp|string} [pattern] The pattern to match words.
8
+ * @returns {Array} Returns the words of `string`.
9
+ * @example
10
+ *
11
+ * words('fred, barney, & pebbles')
12
+ * // => ['fred', 'barney', 'pebbles']
13
+ *
14
+ * words('fred, barney, & pebbles', /[^, ]+/g)
15
+ * // => ['fred', 'barney', '&', 'pebbles']
16
+ */
17
+ export declare function words(string: string, pattern?: RegExp): any;
@@ -0,0 +1,5 @@
1
+ export interface IAxiosWrappedNestException {
2
+ statusCode: number;
3
+ error: string;
4
+ message: string;
5
+ }
@@ -0,0 +1,9 @@
1
+ export interface IEntityProvider<TEntity, TFindOneOptions, TFindManyOptions, TFindOptionsWhere, TQueryDeepPartialEntity> {
2
+ getOne: (options: TFindOneOptions) => Promise<TEntity>;
3
+ getMany: (options: TFindManyOptions) => Promise<TEntity[]>;
4
+ postOne: (body: Partial<TEntity>) => Promise<TEntity>;
5
+ postMany: (body: Partial<TEntity[]>) => Promise<TEntity[]>;
6
+ delete: (options: TFindOptionsWhere) => Promise<void>;
7
+ put: (options: TFindOptionsWhere, body: TQueryDeepPartialEntity) => Promise<void>;
8
+ patch: (options: TFindOptionsWhere, body: TQueryDeepPartialEntity) => Promise<void>;
9
+ }
@@ -0,0 +1,3 @@
1
+ export type TKeysOf<TKeySource, TValue> = {
2
+ [key in keyof TKeySource]: TValue;
3
+ };
package/package.json CHANGED
@@ -1,17 +1,27 @@
1
1
  {
2
2
  "name": "@onivoro/isomorphic-common",
3
- "version": "0.2.3",
4
- "module": "esm/src/index.js",
5
- "type": "module",
6
- "main": "cjs/index.js",
3
+ "version": "0.3.0",
4
+ "main": "dist/index.cjs.js",
5
+ "module": "dist/index.esm.js",
6
+ "files": [
7
+ "dist/*"
8
+ ],
7
9
  "scripts": {
8
10
  "esb": "npx esbuild src/index.ts --bundle --platform=node --target=node16.20.2 > dist/index.cjs.js",
9
- "ts": "npx tsc --module es2022 --outDir esm/ && echo '{\"type\": \"module\"}' > esm/package.json",
10
- "push": "npm run ts && cp package.json dist && npm publish --access public"
11
+ "ts": "npx tsc --module es2022 --outDir esm/ && echo '{\"type\": \"module\"}' > dist/esm/package.json",
12
+ "push": "npm publish --access public",
13
+ "compile": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json",
14
+ "build:clean": "rm -rf ./build",
15
+ "build": "npm run build:clean && npm run compile && npm run hack",
16
+ "hack": "echo '{\"type\": \"module\"}' > dist/esm/package.json"
11
17
  },
12
18
  "exports": {
13
- "require": "./cjs/index.js",
14
- "import": "./esm/src/index.js"
19
+ ".": {
20
+ "types": "./dist/types/src/index.d.ts",
21
+ "require": "./dist/cjs/src/index.js",
22
+ "import": "./dist/esm/src/index.js",
23
+ "default": "./dist/esm/lib.js"
24
+ }
15
25
  },
16
26
  "devDependencies": {
17
27
  "@types/jest": "^29.5.12",
package/dist DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "name": "@onivoro/isomorphic-common",
3
- "version": "0.2.3",
4
- "module": "esm/src/index.js",
5
- "type": "module",
6
- "main": "cjs/index.js",
7
- "scripts": {
8
- "esb": "npx esbuild src/index.ts --bundle --platform=node --target=node16.20.2 > dist/index.cjs.js",
9
- "ts": "npx tsc --module es2022 --outDir esm/ && echo '{\"type\": \"module\"}' > esm/package.json",
10
- "push": "npm run ts && cp package.json dist && npm publish --access public"
11
- },
12
- "exports": {
13
- "require": "./cjs/index.js",
14
- "import": "./esm/src/index.js"
15
- },
16
- "devDependencies": {
17
- "@types/jest": "^29.5.12",
18
- "typescript": "^5.3.3"
19
- }
20
- }
package/jest.config.ts DELETED
@@ -1,17 +0,0 @@
1
- /* eslint-disable */
2
- export default {
3
- displayName: 'isomorphic-common',
4
- preset: '../../jest.preset.js',
5
- globals: {},
6
- testEnvironment: 'node',
7
- transform: {
8
- '^.+\\.[tj]sx?$': [
9
- 'ts-jest',
10
- {
11
- tsconfig: '<rootDir>/tsconfig.spec.json',
12
- },
13
- ],
14
- },
15
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
16
- coverageDirectory: '../../coverage/libs/isomorphic-common',
17
- };
@@ -1,3 +0,0 @@
1
- import { MILLIS_PER_HOUR } from "./millis-per-hour.constant";
2
-
3
- export const MILLIS_PER_DAY = MILLIS_PER_HOUR * 24;
@@ -1,3 +0,0 @@
1
- import { MILLIS_PER_MINUTE } from "./millis-per-minute.constant";
2
-
3
- export const MILLIS_PER_HOUR = MILLIS_PER_MINUTE * 60;
@@ -1 +0,0 @@
1
- export const MILLIS_PER_MINUTE = 1000 * 60;
@@ -1,5 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`addOffset GIVEN input is partial or full ISO8601 "2023-12-23" 1`] = `2023-12-23T06:00:00.000Z`;
4
-
5
- exports[`addOffset GIVEN input is partial or full ISO8601 "2023-12-23T00:00:00.000" 1`] = `2023-12-23T12:00:00.000Z`;
@@ -1,3 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`/Users/lee/github.com/onivoro/onivoro/libs/isomorphic-common/src/lib/functions/convert-object-to-literal.function.spec.ts converts an object to a string 1`] = `"qty=337 AND price=100 AND product=flux-capacitor"`;
@@ -1,3 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`fromCalendarDate GIVEN input is partial or full ISO8601 "2023-12-23" 1`] = `2023-12-22T12:00:00.000Z`;
@@ -1,5 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`subtractOffset GIVEN input is partial or full ISO8601 "2023-12-23" 1`] = `2023-12-22T18:00:00.000Z`;
4
-
5
- exports[`subtractOffset GIVEN input is partial or full ISO8601 "2023-12-23T00:00:00.000" 1`] = `2023-12-23T00:00:00.000Z`;
@@ -1,3 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`toDollarsAndCents worx 1`] = `"three hundred thirty-seven dollars and thirty-three cents"`;
@@ -1,3 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`toWords worx 1`] = `"three hundred thirty-seven"`;
@@ -1,5 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`tryParseDate GIVEN input is partial or full ISO8601 "2023-12-23" 1`] = `2023-12-23T00:00:00.000Z`;
4
-
5
- exports[`tryParseDate GIVEN input is partial or full ISO8601 "2023-12-23T00:00:00.000" 1`] = `2023-12-23T06:00:00.000Z`;
@@ -1,13 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`upperFirst GIVEN "XCVB", does what u expect 1`] = `"Xcvb"`;
4
-
5
- exports[`upperFirst GIVEN "asdf", does what u expect 1`] = `"Asdf"`;
6
-
7
- exports[`upperFirst GIVEN falsey input 0, does what u expect 1`] = `0`;
8
-
9
- exports[`upperFirst GIVEN falsey input false, does what u expect 1`] = `false`;
10
-
11
- exports[`upperFirst GIVEN falsey input null, does what u expect 1`] = `null`;
12
-
13
- exports[`upperFirst GIVEN falsey input undefined, does what u expect 1`] = `undefined`;
@@ -1,12 +0,0 @@
1
- import { addOffset } from './add-offset.function';
2
-
3
- describe('addOffset', () => {
4
- describe('GIVEN input is partial or full ISO8601', () => {
5
- it.each([
6
- '2023-12-23',
7
- '2023-12-23T00:00:00.000',
8
- ])('%j', (input) => {
9
- expect(addOffset(input)).toMatchSnapshot();
10
- });
11
- });
12
- });
@@ -1,14 +0,0 @@
1
- import { MILLIS_PER_MINUTE } from '../constants/millis-per-minute.constant';
2
- import { tryParseDate } from './try-parse-date.function';
3
-
4
- export function addOffset(input: string | Date | undefined | null): Date | undefined {
5
- const parsed = tryParseDate(input);
6
-
7
- if(!parsed) {
8
- return;
9
- }
10
-
11
- const offset = (parsed).getTimezoneOffset();
12
-
13
- return new Date(parsed.valueOf() + offset * MILLIS_PER_MINUTE);
14
- }
@@ -1,30 +0,0 @@
1
- // https://github.com/lodash/lodash/blob/main/src/camelCase.ts
2
-
3
- import { toString } from './to-string.function';
4
- import { upperFirst } from './upper-first.function';
5
- import { words } from './words.function';
6
-
7
- /**
8
- * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
9
- *
10
- * @since 3.0.0
11
- * @category String
12
- * @param {string} [string=''] The string to convert.
13
- * @returns {string} Returns the camel cased string.
14
- * @see lowerCase, kebabCase, snakeCase, startCase, upperCase, upperFirst
15
- * @example
16
- *
17
- * camelCase('Foo Bar')
18
- * // => 'fooBar'
19
- *
20
- * camelCase('--foo-bar--')
21
- * // => 'fooBar'
22
- *
23
- * camelCase('__FOO_BAR__')
24
- * // => 'fooBar'
25
- */
26
- export const camelCase = (string: string): string =>
27
- words(toString(string).replace(/['\u2019]/g, '')).reduce((result: string, word: string, index: number) => {
28
- word = word.toLowerCase();
29
- return result + (index ? upperFirst(word) : word);
30
- }, '');
@@ -1,16 +0,0 @@
1
- import { convertObjectToLiteral } from './convert-object-to-literal.function';
2
-
3
- const qty = 337;
4
- const price = 100;
5
- const product = 'flux-capacitor';
6
-
7
- describe(__filename, () => {
8
- it.each([[(k, v) => `${k}=${v}`, ' AND ', { qty, price, product }]])(
9
- 'converts an object to a string',
10
- (literalFn, delimiter, obj) => {
11
- expect(
12
- convertObjectToLiteral(literalFn, delimiter, obj)
13
- ).toMatchSnapshot();
14
- }
15
- );
16
- });
@@ -1,10 +0,0 @@
1
- export function convertObjectToLiteral(
2
- literalFn: (k: string, v: any) => string,
3
- delimiter: string,
4
- keyValuePairs: Record<string, any>
5
- ) {
6
- return Object.entries(keyValuePairs)
7
- .filter(([, v]) => !!v || v === 0 || v === false)
8
- .map(([k, v]) => literalFn(k, v?.toString?.()))
9
- .join(delimiter);
10
- }
@@ -1,3 +0,0 @@
1
- export function fromBooleanString(value?: string) {
2
- return value === 'true';
3
- }
@@ -1,11 +0,0 @@
1
- import { fromCalendarDate } from './from-calendar-date.function';
2
-
3
- describe('fromCalendarDate', () => {
4
- describe('GIVEN input is partial or full ISO8601', () => {
5
- it.each([
6
- '2023-12-23',
7
- ])('%j', (input) => {
8
- expect(fromCalendarDate(input)).toMatchSnapshot();
9
- });
10
- });
11
- });
@@ -1,5 +0,0 @@
1
- import { addOffset } from "./add-offset.function";
2
-
3
- export function fromCalendarDate(input: string | Date | undefined | null): Date | null {
4
- return addOffset(input) || null;
5
- }
@@ -1,3 +0,0 @@
1
- export function fromCsvString(value?: string) {
2
- return value ? value.split(',').map((v) => v.trim()) : [];
3
- }
@@ -1,10 +0,0 @@
1
- // https://github.com/lodash/lodash/blob/main/src/.internal/getTag.ts
2
-
3
- const toString = Object.prototype.toString
4
-
5
- export function getTag(value: any): string {
6
- if (value == null) {
7
- return value === undefined ? '[object Undefined]' : '[object Null]'
8
- }
9
- return toString.call(value)
10
- }
@@ -1,11 +0,0 @@
1
- // https://github.com/lodash/lodash/blob/main/src/isSymbol.ts
2
-
3
- import { getTag } from './get-tag.function';
4
-
5
- export function isSymbol(value: any): boolean {
6
- const type = typeof value;
7
- return (
8
- type === 'symbol' ||
9
- (type === 'object' && value != null && getTag(value) === '[object Symbol]')
10
- );
11
- }
@@ -1,5 +0,0 @@
1
- import { snakeCase } from "./snake-case.function";
2
-
3
- export function kebabCase(string) {
4
- return snakeCase(string).replace(/_/g, '-');
5
- }
@@ -1,3 +0,0 @@
1
- export function parseBool(asc: string | boolean | null | undefined) {
2
- return asc ? asc === true || asc === 'true' : false;
3
- }
@@ -1,21 +0,0 @@
1
- // credit https://stackoverflow.com/questions/15690706/recursively-looping-through-an-object-to-build-a-property-list/53620876#53620876
2
-
3
- export function propertiesToArray(obj) {
4
- const isObject = val =>
5
- val && typeof val === 'object' && !Array.isArray(val);
6
-
7
- const addDelimiter = (a, b) =>
8
- a ? `${a}.${b}` : b;
9
-
10
- const paths = (obj = {}, head = '') => {
11
- return Object.entries(obj)
12
- .reduce((product, [key, value]) => {
13
- let fullPath = addDelimiter(head, key)
14
- return isObject(value) ?
15
- product.concat(paths(value, fullPath))
16
- : product.concat(fullPath)
17
- }, []);
18
- }
19
-
20
- return paths(obj);
21
- }
@@ -1,9 +0,0 @@
1
- /* eslint-disable no-control-regex */
2
-
3
- const _ = '_';
4
- const asciiReplacementRegX = /\/|\?|:|\\|{|\^|'|\}|%|`|]|>|\[|~|<|#|\||"|!|\*/g;
5
- const unicodeReplacementRegX = /[^\u0000-\u007F]/g;
6
-
7
- export function sanitizeFilename(filename: string) {
8
- return filename.replace(unicodeReplacementRegX, _).replace(asciiReplacementRegX, _).replace(/_+/g, _).trim();
9
- }
@@ -1,12 +0,0 @@
1
- import { subtractOffset } from './subtract-offset.function';
2
-
3
- describe('subtractOffset', () => {
4
- describe('GIVEN input is partial or full ISO8601', () => {
5
- it.each([
6
- '2023-12-23',
7
- '2023-12-23T00:00:00.000',
8
- ])('%j', (input) => {
9
- expect(subtractOffset(input)).toMatchSnapshot();
10
- });
11
- });
12
- });
@@ -1,14 +0,0 @@
1
- import { MILLIS_PER_MINUTE } from '../constants/millis-per-minute.constant';
2
- import { tryParseDate } from './try-parse-date.function';
3
-
4
- export function subtractOffset(input: string | Date | undefined | null): Date | undefined {
5
- const parsed = tryParseDate(input);
6
-
7
- if(!parsed) {
8
- return;
9
- }
10
-
11
- const offset = (parsed).getTimezoneOffset();
12
-
13
- return new Date(parsed.valueOf() - offset * MILLIS_PER_MINUTE);
14
- }
@@ -1,3 +0,0 @@
1
- export function toBooleanString(val?: boolean) {
2
- return (!!(val || false)).toString() as 'true' | 'false';
3
- }
@@ -1,11 +0,0 @@
1
- import { subtractOffset } from "./subtract-offset.function";
2
-
3
- export function toCalendarDate(input: string | Date | undefined | null): string | undefined {
4
- const parsed = subtractOffset(input);
5
-
6
- if (!parsed) {
7
- return;
8
- }
9
-
10
- return parsed?.toISOString().split('T')[0];
11
- }
@@ -1,3 +0,0 @@
1
- export function toCsvString(val?: string[]) {
2
- return (val || []).join(',');
3
- }
@@ -1,23 +0,0 @@
1
- export function toDecimalBase(n: string | number, base = 16) {
2
- const digits = n.toString().split('');
3
-
4
- let answer = 0;
5
-
6
- digits.reverse().forEach(function (d, i) {
7
- let actualNumber = Number(d);
8
-
9
- if (!actualNumber && actualNumber !== 0) {
10
- const codeAt = d.charCodeAt(0);
11
-
12
- if (codeAt >= 97) {
13
- actualNumber = codeAt - 87;
14
- } else {
15
- actualNumber = codeAt - 55;
16
- }
17
- }
18
-
19
- answer = answer + actualNumber * Math.pow(base, i);
20
- });
21
-
22
- return answer;
23
- }
@@ -1,7 +0,0 @@
1
- import { toDollarsAndCents } from './to-dollars-and-cents.function';
2
-
3
- describe('toDollarsAndCents', () => {
4
- it('worx', () => {
5
- expect(toDollarsAndCents(337.33)).toMatchSnapshot();
6
- });
7
- });
@@ -1,15 +0,0 @@
1
- import { toWords } from "./to-words.function";
2
-
3
- export function toDollarsAndCents(number: any): string {
4
- const num = Number(number);
5
- const decimal = (Math.round((num % 1) * 100)) / 100;
6
- const int = num - decimal;
7
-
8
- const dollars = `${toWords(int)} dollars`;
9
-
10
- if (!decimal) {
11
- return dollars;
12
- }
13
-
14
- return `${dollars} and ${toWords(decimal * 100)} cents`;
15
- }
@@ -1,25 +0,0 @@
1
- // https://github.com/lodash/lodash/blob/main/src/toString.ts
2
-
3
- import { isSymbol } from './is-symbol.function';
4
-
5
- /** Used as references for various `Number` constants. */
6
- const INFINITY = 1 / 0;
7
-
8
- export function toString(value: any): string {
9
- if (value == null) {
10
- return '';
11
- }
12
- // Exit early for strings to avoid a performance hit in some environments.
13
- if (typeof value === 'string') {
14
- return value;
15
- }
16
- if (Array.isArray(value)) {
17
- // Recursively convert values (susceptible to call stack limits).
18
- return `${value.map((other) => (other == null ? other : toString(other)))}`;
19
- }
20
- if (isSymbol(value)) {
21
- return value.toString();
22
- }
23
- const result = `${value}`;
24
- return result === '0' && 1 / value === -INFINITY ? '-0' : result;
25
- }