@bemoje/cli 0.0.4 → 0.0.6

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 (698) hide show
  1. package/.eslintrc.json +5 -0
  2. package/.swcrc +32 -0
  3. package/dist/cjs/_example/bFindIn.js +189 -0
  4. package/dist/cjs/_example/bFindIn.js.map +1 -0
  5. package/dist/cjs/arg/ArgumentBuilder.js +45 -0
  6. package/dist/cjs/arg/ArgumentBuilder.js.map +1 -0
  7. package/dist/cjs/arg/ArgumentParserSelector.js +15 -0
  8. package/dist/cjs/arg/ArgumentParserSelector.js.map +1 -0
  9. package/dist/cjs/arg/ArgumentReader.js +38 -0
  10. package/dist/cjs/arg/ArgumentReader.js.map +1 -0
  11. package/dist/cjs/arg/ArgumentValidatorSelector.js +16 -0
  12. package/dist/cjs/arg/ArgumentValidatorSelector.js.map +1 -0
  13. package/dist/cjs/cmd/CommandBuilder.js +1080 -0
  14. package/dist/cjs/cmd/CommandBuilder.js.map +1 -0
  15. package/dist/cjs/cmd/CommandBuilderMetaData.js +44 -0
  16. package/dist/cjs/cmd/CommandBuilderMetaData.js.map +1 -0
  17. package/dist/cjs/cmd/CommandFeatureSelector.js +112 -0
  18. package/dist/cjs/cmd/CommandFeatureSelector.js.map +1 -0
  19. package/dist/cjs/cmd/DefaultHelpConfig.js +141 -0
  20. package/dist/cjs/cmd/DefaultHelpConfig.js.map +1 -0
  21. package/dist/cjs/cmd/asdas.js +27 -0
  22. package/dist/cjs/cmd/asdas.js.map +1 -0
  23. package/dist/cjs/core/OutputManager.js +99 -0
  24. package/dist/cjs/core/OutputManager.js.map +1 -0
  25. package/dist/cjs/core/ParserSelector.js +36 -0
  26. package/dist/cjs/core/ParserSelector.js.map +1 -0
  27. package/dist/cjs/core/ValidatorSelector.js +36 -0
  28. package/dist/cjs/core/ValidatorSelector.js.map +1 -0
  29. package/dist/cjs/core/splitCombinedArgvShorts.js +15 -0
  30. package/dist/cjs/core/splitCombinedArgvShorts.js.map +1 -0
  31. package/dist/cjs/db/AbstractJsonFileSection.js +190 -0
  32. package/dist/cjs/db/AbstractJsonFileSection.js.map +1 -0
  33. package/dist/cjs/db/AppDataSection.js +48 -0
  34. package/dist/cjs/db/AppDataSection.js.map +1 -0
  35. package/dist/cjs/db/ConfigSection.js +71 -0
  36. package/dist/cjs/db/ConfigSection.js.map +1 -0
  37. package/dist/cjs/db/JsonFile.js +55 -0
  38. package/dist/cjs/db/JsonFile.js.map +1 -0
  39. package/dist/cjs/db/PresetsSection.js +92 -0
  40. package/dist/cjs/db/PresetsSection.js.map +1 -0
  41. package/dist/cjs/index.js +119 -0
  42. package/dist/cjs/index.js.map +1 -0
  43. package/dist/cjs/opt/OptionArgumentParserSelector.js +16 -0
  44. package/dist/cjs/opt/OptionArgumentParserSelector.js.map +1 -0
  45. package/dist/cjs/opt/OptionArgumentValidatorSelector.js +19 -0
  46. package/dist/cjs/opt/OptionArgumentValidatorSelector.js.map +1 -0
  47. package/dist/cjs/opt/OptionBuilder.js +88 -0
  48. package/dist/cjs/opt/OptionBuilder.js.map +1 -0
  49. package/dist/cjs/opt/OptionHelpers.js +57 -0
  50. package/dist/cjs/opt/OptionHelpers.js.map +1 -0
  51. package/dist/cjs/opt/OptionReader.js +66 -0
  52. package/dist/cjs/opt/OptionReader.js.map +1 -0
  53. package/dist/cjs/types/IConfig.js +3 -0
  54. package/dist/cjs/types/IConfig.js.map +1 -0
  55. package/dist/cjs/types/IPreset.js +3 -0
  56. package/dist/cjs/types/IPreset.js.map +1 -0
  57. package/dist/cjs/util/array/arrLast.js +21 -0
  58. package/dist/cjs/util/array/arrLast.js.map +1 -0
  59. package/dist/cjs/util/array/arrSome.js +26 -0
  60. package/dist/cjs/util/array/arrSome.js.map +1 -0
  61. package/dist/cjs/util/array/types/ArrayPredicate.js +3 -0
  62. package/dist/cjs/util/array/types/ArrayPredicate.js.map +1 -0
  63. package/dist/cjs/util/db/JsonDB.js +145 -0
  64. package/dist/cjs/util/db/JsonDB.js.map +1 -0
  65. package/dist/cjs/util/errors/ErrorParser.js +164 -0
  66. package/dist/cjs/util/errors/ErrorParser.js.map +1 -0
  67. package/dist/cjs/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js +3 -0
  68. package/dist/cjs/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js.map +1 -0
  69. package/dist/cjs/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js +32 -0
  70. package/dist/cjs/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js.map +1 -0
  71. package/dist/cjs/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js +25 -0
  72. package/dist/cjs/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js.map +1 -0
  73. package/dist/cjs/util/fs/readFile/readFileSafeSync.js +28 -0
  74. package/dist/cjs/util/fs/readFile/readFileSafeSync.js.map +1 -0
  75. package/dist/cjs/util/fs/readFile/readFileSync.js +20 -0
  76. package/dist/cjs/util/fs/readFile/readFileSync.js.map +1 -0
  77. package/dist/cjs/util/fs/readJsonFile/readJsonFileSafeSync.js +24 -0
  78. package/dist/cjs/util/fs/readJsonFile/readJsonFileSafeSync.js.map +1 -0
  79. package/dist/cjs/util/fs/removeFile/removeFile.js +6 -0
  80. package/dist/cjs/util/fs/removeFile/removeFile.js.map +1 -0
  81. package/dist/cjs/util/fs/tempFile/tempFileSync.js +28 -0
  82. package/dist/cjs/util/fs/tempFile/tempFileSync.js.map +1 -0
  83. package/dist/cjs/util/fs/types/IReadJsonFileOptions.js +3 -0
  84. package/dist/cjs/util/fs/types/IReadJsonFileOptions.js.map +1 -0
  85. package/dist/cjs/util/fs/writeFile/writeFileSafeSync.js +6 -0
  86. package/dist/cjs/util/fs/writeFile/writeFileSafeSync.js.map +1 -0
  87. package/dist/cjs/util/fs/writeFile/writeFileSync.js +6 -0
  88. package/dist/cjs/util/fs/writeFile/writeFileSync.js.map +1 -0
  89. package/dist/cjs/util/fs/writeJsonFile/writeJsonFileSafe.js +6 -0
  90. package/dist/cjs/util/fs/writeJsonFile/writeJsonFileSafe.js.map +1 -0
  91. package/dist/cjs/util/function/MethodDisabler.js +94 -0
  92. package/dist/cjs/util/function/MethodDisabler.js.map +1 -0
  93. package/dist/cjs/util/function/funSetName.js +21 -0
  94. package/dist/cjs/util/function/funSetName.js.map +1 -0
  95. package/dist/cjs/util/node/execInherit.js +19 -0
  96. package/dist/cjs/util/node/execInherit.js.map +1 -0
  97. package/dist/cjs/util/node/formatTableForTerminal.js +21 -0
  98. package/dist/cjs/util/node/formatTableForTerminal.js.map +1 -0
  99. package/dist/cjs/util/object/arrAssign.js +6 -0
  100. package/dist/cjs/util/object/arrAssign.js.map +1 -0
  101. package/dist/cjs/util/object/createArrayMerger.js +20 -0
  102. package/dist/cjs/util/object/createArrayMerger.js.map +1 -0
  103. package/dist/cjs/util/object/createObjectMerger.js +20 -0
  104. package/dist/cjs/util/object/createObjectMerger.js.map +1 -0
  105. package/dist/cjs/util/object/objAssign.js +6 -0
  106. package/dist/cjs/util/object/objAssign.js.map +1 -0
  107. package/dist/cjs/util/object/objUpdatePropertyDescriptors.js +28 -0
  108. package/dist/cjs/util/object/objUpdatePropertyDescriptors.js.map +1 -0
  109. package/dist/cjs/util/object/realizeLazyProperty.js +14 -0
  110. package/dist/cjs/util/object/realizeLazyProperty.js.map +1 -0
  111. package/dist/cjs/util/object/setNonEnumerable.js +25 -0
  112. package/dist/cjs/util/object/setNonEnumerable.js.map +1 -0
  113. package/dist/cjs/util/os/defaultOpenInEditorCommand.js +18 -0
  114. package/dist/cjs/util/os/defaultOpenInEditorCommand.js.map +1 -0
  115. package/dist/cjs/util/os/isOSX.js +13 -0
  116. package/dist/cjs/util/os/isOSX.js.map +1 -0
  117. package/dist/cjs/util/os/isVsCodeInstalled.js +19 -0
  118. package/dist/cjs/util/os/isVsCodeInstalled.js.map +1 -0
  119. package/dist/cjs/util/os/isWindows.js +16 -0
  120. package/dist/cjs/util/os/isWindows.js.map +1 -0
  121. package/dist/cjs/util/path/getTempDataPath.js +20 -0
  122. package/dist/cjs/util/path/getTempDataPath.js.map +1 -0
  123. package/dist/cjs/util/regex/regexEscapeString.js +18 -0
  124. package/dist/cjs/util/regex/regexEscapeString.js.map +1 -0
  125. package/dist/cjs/util/string/strEnsureStartsWith.js +19 -0
  126. package/dist/cjs/util/string/strEnsureStartsWith.js.map +1 -0
  127. package/dist/cjs/util/string/strFirstCharToUpperCase.js +16 -0
  128. package/dist/cjs/util/string/strFirstCharToUpperCase.js.map +1 -0
  129. package/dist/cjs/util/string/strIsLowerCase.js +18 -0
  130. package/dist/cjs/util/string/strIsLowerCase.js.map +1 -0
  131. package/dist/cjs/util/string/strIsUpperCase.js +18 -0
  132. package/dist/cjs/util/string/strIsUpperCase.js.map +1 -0
  133. package/dist/cjs/util/string/strSplitCamelCase.js +55 -0
  134. package/dist/cjs/util/string/strSplitCamelCase.js.map +1 -0
  135. package/dist/cjs/util/string-parsers/createBooleanParser.js +21 -0
  136. package/dist/cjs/util/string-parsers/createBooleanParser.js.map +1 -0
  137. package/dist/cjs/util/string-parsers/createTypedListParser.js +22 -0
  138. package/dist/cjs/util/string-parsers/createTypedListParser.js.map +1 -0
  139. package/dist/cjs/util/string-parsers/parseBoolean.js +15 -0
  140. package/dist/cjs/util/string-parsers/parseBoolean.js.map +1 -0
  141. package/dist/cjs/util/string-parsers/parseInteger.js +17 -0
  142. package/dist/cjs/util/string-parsers/parseInteger.js.map +1 -0
  143. package/dist/cjs/util/string-parsers/parseNumber.js +13 -0
  144. package/dist/cjs/util/string-parsers/parseNumber.js.map +1 -0
  145. package/dist/cjs/util/string-parsers/parseString.js +8 -0
  146. package/dist/cjs/util/string-parsers/parseString.js.map +1 -0
  147. package/dist/cjs/util/types/Any.js +3 -0
  148. package/dist/cjs/util/types/Any.js.map +1 -0
  149. package/dist/cjs/util/types/DeepArray.js +3 -0
  150. package/dist/cjs/util/types/DeepArray.js.map +1 -0
  151. package/dist/cjs/util/types/DeepObject.js +3 -0
  152. package/dist/cjs/util/types/DeepObject.js.map +1 -0
  153. package/dist/cjs/util/types/JsonArray.js +3 -0
  154. package/dist/cjs/util/types/JsonArray.js.map +1 -0
  155. package/dist/cjs/util/types/JsonDefinedPrimitive.js +6 -0
  156. package/dist/cjs/util/types/JsonDefinedPrimitive.js.map +1 -0
  157. package/dist/cjs/util/types/JsonObject.js +3 -0
  158. package/dist/cjs/util/types/JsonObject.js.map +1 -0
  159. package/dist/cjs/util/types/JsonRawPrimitive.js +3 -0
  160. package/dist/cjs/util/types/JsonRawPrimitive.js.map +1 -0
  161. package/dist/cjs/util/types/JsonValue.js +3 -0
  162. package/dist/cjs/util/types/JsonValue.js.map +1 -0
  163. package/dist/cjs/util/types/ObjectKey.js +3 -0
  164. package/dist/cjs/util/types/ObjectKey.js.map +1 -0
  165. package/dist/cjs/util/types/TConstructor.js +3 -0
  166. package/dist/cjs/util/types/TConstructor.js.map +1 -0
  167. package/dist/cjs/util/types/TFunction.js +3 -0
  168. package/dist/cjs/util/types/TFunction.js.map +1 -0
  169. package/dist/cjs/util/types/TFunctionNoNew.js +3 -0
  170. package/dist/cjs/util/types/TFunctionNoNew.js.map +1 -0
  171. package/dist/cjs/util/types/TPlainObject.js +3 -0
  172. package/dist/cjs/util/types/TPlainObject.js.map +1 -0
  173. package/dist/cjs/util/types/TPrimitive.js +3 -0
  174. package/dist/cjs/util/types/TPrimitive.js.map +1 -0
  175. package/dist/cjs/util/types/TStringParser.js +3 -0
  176. package/dist/cjs/util/types/TStringParser.js.map +1 -0
  177. package/dist/cjs/util/types/TValidator.js +3 -0
  178. package/dist/cjs/util/types/TValidator.js.map +1 -0
  179. package/dist/cjs/util/validation/createTypedArrayValidator.js +26 -0
  180. package/dist/cjs/util/validation/createTypedArrayValidator.js.map +1 -0
  181. package/dist/cjs/util/validation/ensureThat.js +12 -0
  182. package/dist/cjs/util/validation/ensureThat.js.map +1 -0
  183. package/dist/cjs/util/validation/isArray.js +5 -0
  184. package/dist/cjs/util/validation/isArray.js.map +1 -0
  185. package/dist/cjs/util/validation/isBoolean.js +8 -0
  186. package/dist/cjs/util/validation/isBoolean.js.map +1 -0
  187. package/dist/cjs/util/validation/isFunction.js +17 -0
  188. package/dist/cjs/util/validation/isFunction.js.map +1 -0
  189. package/dist/cjs/util/validation/isNamedFunction.js +11 -0
  190. package/dist/cjs/util/validation/isNamedFunction.js.map +1 -0
  191. package/dist/cjs/util/validation/isNamedFunctionArray.js +9 -0
  192. package/dist/cjs/util/validation/isNamedFunctionArray.js.map +1 -0
  193. package/dist/cjs/util/validation/isObject.js +22 -0
  194. package/dist/cjs/util/validation/isObject.js.map +1 -0
  195. package/dist/cjs/util/validation/isPlainObject.js +19 -0
  196. package/dist/cjs/util/validation/isPlainObject.js.map +1 -0
  197. package/dist/cjs/util/validation/isPrimitive.js +18 -0
  198. package/dist/cjs/util/validation/isPrimitive.js.map +1 -0
  199. package/dist/cjs/util/validation/isString.js +8 -0
  200. package/dist/cjs/util/validation/isString.js.map +1 -0
  201. package/dist/cjs/util/validation/isStringArray.js +12 -0
  202. package/dist/cjs/util/validation/isStringArray.js.map +1 -0
  203. package/dist/cjs/util/validation/isStringWithNoSpacesOrDashes.js +9 -0
  204. package/dist/cjs/util/validation/isStringWithNoSpacesOrDashes.js.map +1 -0
  205. package/dist/cjs/util/validation/numbers/isInteger.js +17 -0
  206. package/dist/cjs/util/validation/numbers/isInteger.js.map +1 -0
  207. package/dist/cjs/util/validation/numbers/isValidNumber.js +22 -0
  208. package/dist/cjs/util/validation/numbers/isValidNumber.js.map +1 -0
  209. package/dist/esm/_example/bFindIn.js +187 -0
  210. package/dist/esm/_example/bFindIn.js.map +1 -0
  211. package/dist/esm/arg/ArgumentBuilder.js +41 -0
  212. package/dist/esm/arg/ArgumentBuilder.js.map +1 -0
  213. package/dist/esm/arg/ArgumentParserSelector.js +11 -0
  214. package/dist/esm/arg/ArgumentParserSelector.js.map +1 -0
  215. package/dist/esm/arg/ArgumentReader.js +34 -0
  216. package/dist/esm/arg/ArgumentReader.js.map +1 -0
  217. package/dist/esm/arg/ArgumentValidatorSelector.js +12 -0
  218. package/dist/esm/arg/ArgumentValidatorSelector.js.map +1 -0
  219. package/dist/esm/cmd/CommandBuilder.js +1073 -0
  220. package/dist/esm/cmd/CommandBuilder.js.map +1 -0
  221. package/dist/esm/cmd/CommandBuilderMetaData.js +40 -0
  222. package/dist/esm/cmd/CommandBuilderMetaData.js.map +1 -0
  223. package/dist/esm/cmd/CommandFeatureSelector.js +108 -0
  224. package/dist/esm/cmd/CommandFeatureSelector.js.map +1 -0
  225. package/dist/esm/cmd/DefaultHelpConfig.js +135 -0
  226. package/dist/esm/cmd/DefaultHelpConfig.js.map +1 -0
  227. package/dist/esm/cmd/asdas.js +25 -0
  228. package/dist/esm/cmd/asdas.js.map +1 -0
  229. package/dist/esm/core/OutputManager.js +92 -0
  230. package/dist/esm/core/OutputManager.js.map +1 -0
  231. package/dist/esm/core/ParserSelector.js +32 -0
  232. package/dist/esm/core/ParserSelector.js.map +1 -0
  233. package/dist/esm/core/ValidatorSelector.js +32 -0
  234. package/dist/esm/core/ValidatorSelector.js.map +1 -0
  235. package/dist/esm/core/splitCombinedArgvShorts.js +11 -0
  236. package/dist/esm/core/splitCombinedArgvShorts.js.map +1 -0
  237. package/dist/esm/db/AbstractJsonFileSection.js +186 -0
  238. package/dist/esm/db/AbstractJsonFileSection.js.map +1 -0
  239. package/dist/esm/db/AppDataSection.js +44 -0
  240. package/dist/esm/db/AppDataSection.js.map +1 -0
  241. package/dist/esm/db/ConfigSection.js +67 -0
  242. package/dist/esm/db/ConfigSection.js.map +1 -0
  243. package/dist/esm/db/JsonFile.js +51 -0
  244. package/dist/esm/db/JsonFile.js.map +1 -0
  245. package/dist/esm/db/PresetsSection.js +88 -0
  246. package/dist/esm/db/PresetsSection.js.map +1 -0
  247. package/dist/esm/index.js +103 -0
  248. package/dist/esm/index.js.map +1 -0
  249. package/dist/esm/opt/OptionArgumentParserSelector.js +12 -0
  250. package/dist/esm/opt/OptionArgumentParserSelector.js.map +1 -0
  251. package/dist/esm/opt/OptionArgumentValidatorSelector.js +15 -0
  252. package/dist/esm/opt/OptionArgumentValidatorSelector.js.map +1 -0
  253. package/dist/esm/opt/OptionBuilder.js +84 -0
  254. package/dist/esm/opt/OptionBuilder.js.map +1 -0
  255. package/dist/esm/opt/OptionHelpers.js +54 -0
  256. package/dist/esm/opt/OptionHelpers.js.map +1 -0
  257. package/dist/esm/opt/OptionReader.js +62 -0
  258. package/dist/esm/opt/OptionReader.js.map +1 -0
  259. package/dist/esm/types/IConfig.js +2 -0
  260. package/dist/esm/types/IConfig.js.map +1 -0
  261. package/dist/esm/types/IPreset.js +2 -0
  262. package/dist/esm/types/IPreset.js.map +1 -0
  263. package/dist/esm/util/array/arrLast.js +17 -0
  264. package/dist/esm/util/array/arrLast.js.map +1 -0
  265. package/dist/esm/util/array/arrSome.js +22 -0
  266. package/dist/esm/util/array/arrSome.js.map +1 -0
  267. package/dist/esm/util/array/types/ArrayPredicate.js +2 -0
  268. package/dist/esm/util/array/types/ArrayPredicate.js.map +1 -0
  269. package/dist/esm/util/db/JsonDB.js +141 -0
  270. package/dist/esm/util/db/JsonDB.js.map +1 -0
  271. package/dist/esm/util/errors/ErrorParser.js +154 -0
  272. package/dist/esm/util/errors/ErrorParser.js.map +1 -0
  273. package/dist/esm/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js +2 -0
  274. package/dist/esm/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js.map +1 -0
  275. package/dist/esm/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js +28 -0
  276. package/dist/esm/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js.map +1 -0
  277. package/dist/esm/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js +21 -0
  278. package/dist/esm/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js.map +1 -0
  279. package/dist/esm/util/fs/readFile/readFileSafeSync.js +21 -0
  280. package/dist/esm/util/fs/readFile/readFileSafeSync.js.map +1 -0
  281. package/dist/esm/util/fs/readFile/readFileSync.js +13 -0
  282. package/dist/esm/util/fs/readFile/readFileSync.js.map +1 -0
  283. package/dist/esm/util/fs/readJsonFile/readJsonFileSafeSync.js +17 -0
  284. package/dist/esm/util/fs/readJsonFile/readJsonFileSafeSync.js.map +1 -0
  285. package/dist/esm/util/fs/removeFile/removeFile.js +2 -0
  286. package/dist/esm/util/fs/removeFile/removeFile.js.map +1 -0
  287. package/dist/esm/util/fs/tempFile/tempFileSync.js +21 -0
  288. package/dist/esm/util/fs/tempFile/tempFileSync.js.map +1 -0
  289. package/dist/esm/util/fs/types/IReadJsonFileOptions.js +2 -0
  290. package/dist/esm/util/fs/types/IReadJsonFileOptions.js.map +1 -0
  291. package/dist/esm/util/fs/writeFile/writeFileSafeSync.js +2 -0
  292. package/dist/esm/util/fs/writeFile/writeFileSafeSync.js.map +1 -0
  293. package/dist/esm/util/fs/writeFile/writeFileSync.js +2 -0
  294. package/dist/esm/util/fs/writeFile/writeFileSync.js.map +1 -0
  295. package/dist/esm/util/fs/writeJsonFile/writeJsonFileSafe.js +2 -0
  296. package/dist/esm/util/fs/writeJsonFile/writeJsonFileSafe.js.map +1 -0
  297. package/dist/esm/util/function/MethodDisabler.js +90 -0
  298. package/dist/esm/util/function/MethodDisabler.js.map +1 -0
  299. package/dist/esm/util/function/funSetName.js +17 -0
  300. package/dist/esm/util/function/funSetName.js.map +1 -0
  301. package/dist/esm/util/node/execInherit.js +15 -0
  302. package/dist/esm/util/node/execInherit.js.map +1 -0
  303. package/dist/esm/util/node/formatTableForTerminal.js +14 -0
  304. package/dist/esm/util/node/formatTableForTerminal.js.map +1 -0
  305. package/dist/esm/util/object/arrAssign.js +3 -0
  306. package/dist/esm/util/object/arrAssign.js.map +1 -0
  307. package/dist/esm/util/object/createArrayMerger.js +16 -0
  308. package/dist/esm/util/object/createArrayMerger.js.map +1 -0
  309. package/dist/esm/util/object/createObjectMerger.js +16 -0
  310. package/dist/esm/util/object/createObjectMerger.js.map +1 -0
  311. package/dist/esm/util/object/objAssign.js +3 -0
  312. package/dist/esm/util/object/objAssign.js.map +1 -0
  313. package/dist/esm/util/object/objUpdatePropertyDescriptors.js +24 -0
  314. package/dist/esm/util/object/objUpdatePropertyDescriptors.js.map +1 -0
  315. package/dist/esm/util/object/realizeLazyProperty.js +10 -0
  316. package/dist/esm/util/object/realizeLazyProperty.js.map +1 -0
  317. package/dist/esm/util/object/setNonEnumerable.js +21 -0
  318. package/dist/esm/util/object/setNonEnumerable.js.map +1 -0
  319. package/dist/esm/util/os/defaultOpenInEditorCommand.js +14 -0
  320. package/dist/esm/util/os/defaultOpenInEditorCommand.js.map +1 -0
  321. package/dist/esm/util/os/isOSX.js +9 -0
  322. package/dist/esm/util/os/isOSX.js.map +1 -0
  323. package/dist/esm/util/os/isVsCodeInstalled.js +15 -0
  324. package/dist/esm/util/os/isVsCodeInstalled.js.map +1 -0
  325. package/dist/esm/util/os/isWindows.js +12 -0
  326. package/dist/esm/util/os/isWindows.js.map +1 -0
  327. package/dist/esm/util/path/getTempDataPath.js +13 -0
  328. package/dist/esm/util/path/getTempDataPath.js.map +1 -0
  329. package/dist/esm/util/regex/regexEscapeString.js +14 -0
  330. package/dist/esm/util/regex/regexEscapeString.js.map +1 -0
  331. package/dist/esm/util/string/strEnsureStartsWith.js +15 -0
  332. package/dist/esm/util/string/strEnsureStartsWith.js.map +1 -0
  333. package/dist/esm/util/string/strFirstCharToUpperCase.js +12 -0
  334. package/dist/esm/util/string/strFirstCharToUpperCase.js.map +1 -0
  335. package/dist/esm/util/string/strIsLowerCase.js +14 -0
  336. package/dist/esm/util/string/strIsLowerCase.js.map +1 -0
  337. package/dist/esm/util/string/strIsUpperCase.js +14 -0
  338. package/dist/esm/util/string/strIsUpperCase.js.map +1 -0
  339. package/dist/esm/util/string/strSplitCamelCase.js +51 -0
  340. package/dist/esm/util/string/strSplitCamelCase.js.map +1 -0
  341. package/dist/esm/util/string-parsers/createBooleanParser.js +17 -0
  342. package/dist/esm/util/string-parsers/createBooleanParser.js.map +1 -0
  343. package/dist/esm/util/string-parsers/createTypedListParser.js +18 -0
  344. package/dist/esm/util/string-parsers/createTypedListParser.js.map +1 -0
  345. package/dist/esm/util/string-parsers/parseBoolean.js +12 -0
  346. package/dist/esm/util/string-parsers/parseBoolean.js.map +1 -0
  347. package/dist/esm/util/string-parsers/parseInteger.js +13 -0
  348. package/dist/esm/util/string-parsers/parseInteger.js.map +1 -0
  349. package/dist/esm/util/string-parsers/parseNumber.js +9 -0
  350. package/dist/esm/util/string-parsers/parseNumber.js.map +1 -0
  351. package/dist/esm/util/string-parsers/parseString.js +4 -0
  352. package/dist/esm/util/string-parsers/parseString.js.map +1 -0
  353. package/dist/esm/util/types/Any.js +2 -0
  354. package/dist/esm/util/types/Any.js.map +1 -0
  355. package/dist/esm/util/types/DeepArray.js +2 -0
  356. package/dist/esm/util/types/DeepArray.js.map +1 -0
  357. package/dist/esm/util/types/DeepObject.js +2 -0
  358. package/dist/esm/util/types/DeepObject.js.map +1 -0
  359. package/dist/esm/util/types/JsonArray.js +2 -0
  360. package/dist/esm/util/types/JsonArray.js.map +1 -0
  361. package/dist/esm/util/types/JsonDefinedPrimitive.js +5 -0
  362. package/dist/esm/util/types/JsonDefinedPrimitive.js.map +1 -0
  363. package/dist/esm/util/types/JsonObject.js +2 -0
  364. package/dist/esm/util/types/JsonObject.js.map +1 -0
  365. package/dist/esm/util/types/JsonRawPrimitive.js +2 -0
  366. package/dist/esm/util/types/JsonRawPrimitive.js.map +1 -0
  367. package/dist/esm/util/types/JsonValue.js +2 -0
  368. package/dist/esm/util/types/JsonValue.js.map +1 -0
  369. package/dist/esm/util/types/ObjectKey.js +2 -0
  370. package/dist/esm/util/types/ObjectKey.js.map +1 -0
  371. package/dist/esm/util/types/TConstructor.js +2 -0
  372. package/dist/esm/util/types/TConstructor.js.map +1 -0
  373. package/dist/esm/util/types/TFunction.js +2 -0
  374. package/dist/esm/util/types/TFunction.js.map +1 -0
  375. package/dist/esm/util/types/TFunctionNoNew.js +2 -0
  376. package/dist/esm/util/types/TFunctionNoNew.js.map +1 -0
  377. package/dist/esm/util/types/TPlainObject.js +2 -0
  378. package/dist/esm/util/types/TPlainObject.js.map +1 -0
  379. package/dist/esm/util/types/TPrimitive.js +2 -0
  380. package/dist/esm/util/types/TPrimitive.js.map +1 -0
  381. package/dist/esm/util/types/TStringParser.js +2 -0
  382. package/dist/esm/util/types/TStringParser.js.map +1 -0
  383. package/dist/esm/util/types/TValidator.js +2 -0
  384. package/dist/esm/util/types/TValidator.js.map +1 -0
  385. package/dist/esm/util/validation/createTypedArrayValidator.js +22 -0
  386. package/dist/esm/util/validation/createTypedArrayValidator.js.map +1 -0
  387. package/dist/esm/util/validation/ensureThat.js +8 -0
  388. package/dist/esm/util/validation/ensureThat.js.map +1 -0
  389. package/dist/esm/util/validation/isArray.js +2 -0
  390. package/dist/esm/util/validation/isArray.js.map +1 -0
  391. package/dist/esm/util/validation/isBoolean.js +4 -0
  392. package/dist/esm/util/validation/isBoolean.js.map +1 -0
  393. package/dist/esm/util/validation/isFunction.js +13 -0
  394. package/dist/esm/util/validation/isFunction.js.map +1 -0
  395. package/dist/esm/util/validation/isNamedFunction.js +7 -0
  396. package/dist/esm/util/validation/isNamedFunction.js.map +1 -0
  397. package/dist/esm/util/validation/isNamedFunctionArray.js +5 -0
  398. package/dist/esm/util/validation/isNamedFunctionArray.js.map +1 -0
  399. package/dist/esm/util/validation/isObject.js +18 -0
  400. package/dist/esm/util/validation/isObject.js.map +1 -0
  401. package/dist/esm/util/validation/isPlainObject.js +15 -0
  402. package/dist/esm/util/validation/isPlainObject.js.map +1 -0
  403. package/dist/esm/util/validation/isPrimitive.js +14 -0
  404. package/dist/esm/util/validation/isPrimitive.js.map +1 -0
  405. package/dist/esm/util/validation/isString.js +4 -0
  406. package/dist/esm/util/validation/isString.js.map +1 -0
  407. package/dist/esm/util/validation/isStringArray.js +8 -0
  408. package/dist/esm/util/validation/isStringArray.js.map +1 -0
  409. package/dist/esm/util/validation/isStringWithNoSpacesOrDashes.js +5 -0
  410. package/dist/esm/util/validation/isStringWithNoSpacesOrDashes.js.map +1 -0
  411. package/dist/esm/util/validation/numbers/isInteger.js +14 -0
  412. package/dist/esm/util/validation/numbers/isInteger.js.map +1 -0
  413. package/dist/esm/util/validation/numbers/isValidNumber.js +18 -0
  414. package/dist/esm/util/validation/numbers/isValidNumber.js.map +1 -0
  415. package/dist/types/_example/bFindIn.d.ts +1 -0
  416. package/{src → dist/types}/arg/ArgumentBuilder.d.ts +1 -1
  417. package/{src → dist/types}/arg/ArgumentParserSelector.d.ts +2 -2
  418. package/{src → dist/types}/arg/ArgumentReader.d.ts +3 -3
  419. package/{src → dist/types}/arg/ArgumentValidatorSelector.d.ts +2 -2
  420. package/{src → dist/types}/cmd/CommandBuilder.d.ts +32 -28
  421. package/{src → dist/types}/cmd/CommandBuilderMetaData.d.ts +8 -7
  422. package/{src → dist/types}/cmd/CommandFeatureSelector.d.ts +1 -1
  423. package/dist/types/cmd/DefaultHelpConfig.d.ts +28 -0
  424. package/dist/types/cmd/asdas.d.ts +6 -0
  425. package/{src → dist/types}/core/OutputManager.d.ts +1 -1
  426. package/{src → dist/types}/core/ParserSelector.d.ts +3 -3
  427. package/{src → dist/types}/core/ValidatorSelector.d.ts +2 -2
  428. package/{src → dist/types}/db/AbstractJsonFileSection.d.ts +3 -3
  429. package/{src → dist/types}/db/AppDataSection.d.ts +1 -1
  430. package/{src → dist/types}/db/ConfigSection.d.ts +4 -4
  431. package/{src → dist/types}/db/PresetsSection.d.ts +2 -2
  432. package/{src → dist/types}/index.d.ts +2 -2
  433. package/{src → dist/types}/opt/OptionArgumentParserSelector.d.ts +1 -1
  434. package/{src → dist/types}/opt/OptionArgumentValidatorSelector.d.ts +2 -2
  435. package/{src → dist/types}/opt/OptionBuilder.d.ts +2 -1
  436. package/{src → dist/types}/opt/OptionHelpers.d.ts +2 -2
  437. package/{src → dist/types}/opt/OptionReader.d.ts +7 -7
  438. package/{src → dist/types}/types/IConfig.d.ts +3 -3
  439. package/{src → dist/types}/types/IPreset.d.ts +4 -3
  440. package/{src → dist/types}/util/db/JsonDB.d.ts +2 -2
  441. package/{src → dist/types}/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.d.ts +1 -1
  442. package/{src → dist/types}/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.d.ts +1 -1
  443. package/{src → dist/types}/util/fs/readJsonFile/readJsonFileSafeSync.d.ts +1 -1
  444. package/{src → dist/types}/util/fs/tempFile/tempFileSync.d.ts +1 -1
  445. package/{src → dist/types}/util/function/MethodDisabler.d.ts +3 -3
  446. package/{src → dist/types}/util/object/createObjectMerger.d.ts +1 -1
  447. package/{src → dist/types}/util/object/objUpdatePropertyDescriptors.d.ts +1 -1
  448. package/{src → dist/types}/util/object/setNonEnumerable.d.ts +1 -1
  449. package/{src → dist/types}/util/string-parsers/createTypedListParser.d.ts +1 -1
  450. package/{src → dist/types}/util/types/DeepArray.d.ts +2 -2
  451. package/{src → dist/types}/util/types/DeepObject.d.ts +2 -2
  452. package/{src → dist/types}/util/types/JsonArray.d.ts +2 -2
  453. package/{src → dist/types}/util/types/JsonObject.d.ts +2 -2
  454. package/{src → dist/types}/util/types/JsonRawPrimitive.d.ts +1 -1
  455. package/{src → dist/types}/util/types/JsonValue.d.ts +3 -3
  456. package/{src → dist/types}/util/types/TConstructor.d.ts +1 -1
  457. package/dist/types/util/types/TFunction.d.ts +4 -0
  458. package/{src → dist/types}/util/types/TFunctionNoNew.d.ts +1 -1
  459. package/{src → dist/types}/util/types/TPlainObject.d.ts +1 -1
  460. package/dist/types/util/types/TValidator.d.ts +2 -0
  461. package/{src → dist/types}/util/validation/ensureThat.d.ts +2 -2
  462. package/{src → dist/types}/util/validation/isFunction.d.ts +1 -1
  463. package/{src → dist/types}/util/validation/isNamedFunction.d.ts +1 -1
  464. package/{src → dist/types}/util/validation/isPlainObject.d.ts +2 -2
  465. package/{src → dist/types}/util/validation/isPrimitive.d.ts +1 -1
  466. package/jest.config.ts +11 -0
  467. package/notes/tsc.md +1 -0
  468. package/package.json +13 -6
  469. package/project.json +44 -0
  470. package/scripts/currentBemojeUtils.txt +41 -0
  471. package/scripts/rollupUtils.ts +184 -0
  472. package/src/_example/CommandBuilder.example.ts +92 -0
  473. package/src/_example/CommandBuilder.example2.ts +30 -0
  474. package/src/_example/bFindIn.ts +200 -0
  475. package/src/arg/ArgumentBuilder.test.ts +102 -0
  476. package/src/arg/ArgumentBuilder.ts +47 -0
  477. package/src/arg/ArgumentParserSelector.test.ts +53 -0
  478. package/src/arg/ArgumentParserSelector.ts +14 -0
  479. package/src/arg/ArgumentReader.test.ts +60 -0
  480. package/src/arg/ArgumentReader.ts +33 -0
  481. package/src/arg/ArgumentValidatorSelector.test.ts +80 -0
  482. package/src/arg/ArgumentValidatorSelector.ts +14 -0
  483. package/src/cmd/CommandBuilder.test.ts +611 -0
  484. package/src/cmd/CommandBuilder.ts +1164 -0
  485. package/src/cmd/CommandBuilderMetaData.test.ts +54 -0
  486. package/src/cmd/CommandBuilderMetaData.ts +45 -0
  487. package/src/cmd/CommandFeatureSelector.test.ts +185 -0
  488. package/src/cmd/CommandFeatureSelector.ts +113 -0
  489. package/src/cmd/DefaultHelpConfig.test.ts +22 -0
  490. package/src/cmd/DefaultHelpConfig.ts +141 -0
  491. package/src/cmd/asdas.ts +40 -0
  492. package/src/core/OutputManager.test.ts +129 -0
  493. package/src/core/OutputManager.ts +103 -0
  494. package/src/core/ParserSelector.test.ts +7 -0
  495. package/src/core/ParserSelector.ts +38 -0
  496. package/src/core/ValidatorSelector.test.ts +7 -0
  497. package/src/core/ValidatorSelector.ts +38 -0
  498. package/src/core/splitCombinedArgvShorts.test.ts +9 -0
  499. package/src/core/splitCombinedArgvShorts.ts +10 -0
  500. package/src/db/AbstractJsonFileSection.test.ts +274 -0
  501. package/src/db/AbstractJsonFileSection.ts +218 -0
  502. package/src/db/AppDataSection.test.ts +69 -0
  503. package/src/db/AppDataSection.ts +46 -0
  504. package/src/db/ConfigSection.test.ts +95 -0
  505. package/src/db/ConfigSection.ts +74 -0
  506. package/src/db/JsonFile.test.ts +56 -0
  507. package/src/db/JsonFile.ts +52 -0
  508. package/src/db/PresetsSection.test.ts +130 -0
  509. package/src/db/PresetsSection.ts +92 -0
  510. package/src/index.ts +102 -0
  511. package/src/opt/OptionArgumentParserSelector.test.ts +55 -0
  512. package/src/opt/OptionArgumentParserSelector.ts +14 -0
  513. package/src/opt/OptionArgumentValidatorSelector.test.ts +89 -0
  514. package/src/opt/OptionArgumentValidatorSelector.ts +16 -0
  515. package/src/opt/OptionBuilder.test.ts +229 -0
  516. package/src/opt/OptionBuilder.ts +85 -0
  517. package/src/opt/OptionHelpers.test.ts +229 -0
  518. package/src/opt/OptionHelpers.ts +57 -0
  519. package/src/opt/OptionReader.test.ts +106 -0
  520. package/src/opt/OptionReader.ts +61 -0
  521. package/src/types/IConfig.ts +25 -0
  522. package/src/types/IPreset.ts +16 -0
  523. package/src/util/array/arrLast.test.ts +25 -0
  524. package/src/util/array/arrLast.ts +15 -0
  525. package/src/util/array/arrSome.test.ts +78 -0
  526. package/src/util/array/arrSome.ts +23 -0
  527. package/src/util/array/types/ArrayPredicate.ts +10 -0
  528. package/src/util/db/JsonDB.test.ts +214 -0
  529. package/src/util/db/JsonDB.ts +138 -0
  530. package/src/util/errors/ErrorParser.ts +165 -0
  531. package/src/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.ts +15 -0
  532. package/src/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.ts +30 -0
  533. package/src/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.ts +25 -0
  534. package/src/util/fs/readFile/readFileSafeSync.ts +20 -0
  535. package/src/util/fs/readFile/readFileSync.ts +13 -0
  536. package/src/util/fs/readJsonFile/readJsonFileSafeSync.ts +17 -0
  537. package/src/util/fs/removeFile/removeFile.ts +1 -0
  538. package/src/util/fs/tempFile/tempFileSync.ts +21 -0
  539. package/src/util/fs/types/IReadJsonFileOptions.ts +1 -0
  540. package/src/util/fs/writeFile/writeFileSafeSync.ts +1 -0
  541. package/src/util/fs/writeFile/writeFileSync.ts +1 -0
  542. package/src/util/fs/writeJsonFile/writeJsonFileSafe.ts +1 -0
  543. package/src/util/function/MethodDisabler.test.ts +112 -0
  544. package/src/util/function/MethodDisabler.ts +94 -0
  545. package/src/util/function/funSetName.test.ts +12 -0
  546. package/src/util/function/funSetName.ts +16 -0
  547. package/src/util/node/execInherit.ts +14 -0
  548. package/src/util/node/formatTableForTerminal.ts +12 -0
  549. package/src/util/object/arrAssign.ts +3 -0
  550. package/src/util/object/createArrayMerger.test.ts +11 -0
  551. package/src/util/object/createArrayMerger.ts +15 -0
  552. package/src/util/object/createObjectMerger.test.ts +11 -0
  553. package/src/util/object/createObjectMerger.ts +17 -0
  554. package/src/util/object/objAssign.ts +3 -0
  555. package/src/util/object/objUpdatePropertyDescriptors.test.ts +40 -0
  556. package/src/util/object/objUpdatePropertyDescriptors.ts +29 -0
  557. package/src/util/object/realizeLazyProperty.ts +9 -0
  558. package/src/util/object/setNonEnumerable.test.ts +63 -0
  559. package/src/util/object/setNonEnumerable.ts +22 -0
  560. package/src/util/os/defaultOpenInEditorCommand.ts +14 -0
  561. package/src/util/os/isOSX.ts +9 -0
  562. package/src/util/os/isVsCodeInstalled.test.ts +7 -0
  563. package/src/util/os/isVsCodeInstalled.ts +14 -0
  564. package/src/util/os/isWindows.ts +12 -0
  565. package/src/util/path/getTempDataPath.test.ts +9 -0
  566. package/src/util/path/getTempDataPath.ts +14 -0
  567. package/src/util/regex/regexEscapeString.test.ts +35 -0
  568. package/src/util/regex/regexEscapeString.ts +13 -0
  569. package/src/util/string/strEnsureStartsWith.test.ts +13 -0
  570. package/src/util/string/strEnsureStartsWith.ts +14 -0
  571. package/src/util/string/strFirstCharToUpperCase.test.ts +33 -0
  572. package/src/util/string/strFirstCharToUpperCase.ts +11 -0
  573. package/src/util/string/strIsLowerCase.test.ts +42 -0
  574. package/src/util/string/strIsLowerCase.ts +13 -0
  575. package/src/util/string/strIsUpperCase.test.ts +48 -0
  576. package/src/util/string/strIsUpperCase.ts +13 -0
  577. package/src/util/string/strSplitCamelCase.test.ts +54 -0
  578. package/src/util/string/strSplitCamelCase.ts +51 -0
  579. package/src/util/string-parsers/createBooleanParser.test.ts +58 -0
  580. package/src/util/string-parsers/createBooleanParser.ts +21 -0
  581. package/src/util/string-parsers/createTypedListParser.test.ts +19 -0
  582. package/src/util/string-parsers/createTypedListParser.ts +19 -0
  583. package/src/util/string-parsers/parseBoolean.test.ts +30 -0
  584. package/src/util/string-parsers/parseBoolean.ts +12 -0
  585. package/src/util/string-parsers/parseInteger.test.ts +52 -0
  586. package/src/util/string-parsers/parseInteger.ts +9 -0
  587. package/src/util/string-parsers/parseNumber.test.ts +53 -0
  588. package/src/util/string-parsers/parseNumber.ts +6 -0
  589. package/src/util/string-parsers/parseString.test.ts +7 -0
  590. package/src/util/string-parsers/parseString.ts +3 -0
  591. package/src/util/types/Any.ts +2 -0
  592. package/src/util/types/DeepArray.ts +12 -0
  593. package/src/util/types/DeepObject.ts +16 -0
  594. package/src/util/types/JsonArray.ts +8 -0
  595. package/src/util/types/JsonDefinedPrimitive.ts +5 -0
  596. package/src/util/types/JsonObject.ts +8 -0
  597. package/src/util/types/JsonRawPrimitive.ts +7 -0
  598. package/src/util/types/JsonValue.ts +14 -0
  599. package/src/util/types/ObjectKey.ts +1 -0
  600. package/src/util/types/TConstructor.ts +6 -0
  601. package/src/util/types/TFunction.ts +5 -0
  602. package/src/util/types/TFunctionNoNew.ts +3 -0
  603. package/src/util/types/TPlainObject.ts +4 -0
  604. package/src/util/types/TPrimitive.ts +1 -0
  605. package/src/util/types/TStringParser.ts +1 -0
  606. package/src/util/types/TValidator.ts +3 -0
  607. package/src/util/validation/createTypedArrayValidator.test.ts +34 -0
  608. package/src/util/validation/createTypedArrayValidator.ts +25 -0
  609. package/src/util/validation/ensureThat.test.ts +37 -0
  610. package/src/util/validation/ensureThat.ts +14 -0
  611. package/src/util/validation/isArray.test.ts +7 -0
  612. package/src/util/validation/isArray.ts +1 -0
  613. package/src/util/validation/isBoolean.test.ts +31 -0
  614. package/src/util/validation/isBoolean.ts +3 -0
  615. package/src/util/validation/isFunction.test.ts +54 -0
  616. package/src/util/validation/isFunction.ts +14 -0
  617. package/src/util/validation/isNamedFunction.test.ts +28 -0
  618. package/src/util/validation/isNamedFunction.ts +8 -0
  619. package/src/util/validation/isNamedFunctionArray.test.ts +14 -0
  620. package/src/util/validation/isNamedFunctionArray.ts +5 -0
  621. package/src/util/validation/isObject.test.ts +57 -0
  622. package/src/util/validation/isObject.ts +17 -0
  623. package/src/util/validation/isPlainObject.test.ts +21 -0
  624. package/src/util/validation/isPlainObject.ts +14 -0
  625. package/src/util/validation/isPrimitive.ts +15 -0
  626. package/src/util/validation/isString.test.ts +23 -0
  627. package/src/util/validation/isString.ts +3 -0
  628. package/src/util/validation/isStringArray.test.ts +24 -0
  629. package/src/util/validation/isStringArray.ts +8 -0
  630. package/src/util/validation/isStringWithNoSpacesOrDashes.test.ts +28 -0
  631. package/src/util/validation/isStringWithNoSpacesOrDashes.ts +5 -0
  632. package/src/util/validation/numbers/isInteger.test.ts +25 -0
  633. package/src/util/validation/numbers/isInteger.ts +13 -0
  634. package/src/util/validation/numbers/isValidNumber.test.ts +20 -0
  635. package/src/util/validation/numbers/isValidNumber.ts +17 -0
  636. package/tsconfig.json +32 -0
  637. package/tsconfig.lib.json +18 -0
  638. package/tsconfig.spec.json +10 -0
  639. package/index.cjs.d.ts +0 -1
  640. package/index.cjs.js +0 -3231
  641. package/index.esm.js +0 -3119
  642. package/src/cmd/CLI.d.ts +0 -2
  643. package/src/cmd/DefaultHelpConfig.d.ts +0 -2
  644. package/src/proto/overrideCommanderPrototype.d.ts +0 -8
  645. package/src/util/types/TFunction.d.ts +0 -4
  646. package/src/util/types/TValidator.d.ts +0 -1
  647. /package/{src → dist/types}/core/splitCombinedArgvShorts.d.ts +0 -0
  648. /package/{src → dist/types}/db/JsonFile.d.ts +0 -0
  649. /package/{src → dist/types}/util/array/arrLast.d.ts +0 -0
  650. /package/{src → dist/types}/util/array/arrSome.d.ts +0 -0
  651. /package/{src → dist/types}/util/array/types/ArrayPredicate.d.ts +0 -0
  652. /package/{src → dist/types}/util/errors/ErrorParser.d.ts +0 -0
  653. /package/{src → dist/types}/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.d.ts +0 -0
  654. /package/{src → dist/types}/util/fs/readFile/readFileSafeSync.d.ts +0 -0
  655. /package/{src → dist/types}/util/fs/readFile/readFileSync.d.ts +0 -0
  656. /package/{src → dist/types}/util/fs/removeFile/removeFile.d.ts +0 -0
  657. /package/{src → dist/types}/util/fs/types/IReadJsonFileOptions.d.ts +0 -0
  658. /package/{src → dist/types}/util/fs/writeFile/writeFileSafeSync.d.ts +0 -0
  659. /package/{src → dist/types}/util/fs/writeFile/writeFileSync.d.ts +0 -0
  660. /package/{src → dist/types}/util/fs/writeJsonFile/writeJsonFileSafe.d.ts +0 -0
  661. /package/{src → dist/types}/util/function/funSetName.d.ts +0 -0
  662. /package/{src → dist/types}/util/node/execInherit.d.ts +0 -0
  663. /package/{src → dist/types}/util/node/formatTableForTerminal.d.ts +0 -0
  664. /package/{src → dist/types}/util/object/arrAssign.d.ts +0 -0
  665. /package/{src → dist/types}/util/object/createArrayMerger.d.ts +0 -0
  666. /package/{src → dist/types}/util/object/objAssign.d.ts +0 -0
  667. /package/{src → dist/types}/util/object/realizeLazyProperty.d.ts +0 -0
  668. /package/{src → dist/types}/util/os/defaultOpenInEditorCommand.d.ts +0 -0
  669. /package/{src → dist/types}/util/os/isOSX.d.ts +0 -0
  670. /package/{src → dist/types}/util/os/isVsCodeInstalled.d.ts +0 -0
  671. /package/{src → dist/types}/util/os/isWindows.d.ts +0 -0
  672. /package/{src → dist/types}/util/path/getTempDataPath.d.ts +0 -0
  673. /package/{src → dist/types}/util/regex/regexEscapeString.d.ts +0 -0
  674. /package/{src → dist/types}/util/string/strEnsureStartsWith.d.ts +0 -0
  675. /package/{src → dist/types}/util/string/strFirstCharToUpperCase.d.ts +0 -0
  676. /package/{src → dist/types}/util/string/strIsLowerCase.d.ts +0 -0
  677. /package/{src → dist/types}/util/string/strIsUpperCase.d.ts +0 -0
  678. /package/{src → dist/types}/util/string/strSplitCamelCase.d.ts +0 -0
  679. /package/{src → dist/types}/util/string-parsers/createBooleanParser.d.ts +0 -0
  680. /package/{src → dist/types}/util/string-parsers/parseBoolean.d.ts +0 -0
  681. /package/{src → dist/types}/util/string-parsers/parseInteger.d.ts +0 -0
  682. /package/{src → dist/types}/util/string-parsers/parseNumber.d.ts +0 -0
  683. /package/{src → dist/types}/util/string-parsers/parseString.d.ts +0 -0
  684. /package/{src → dist/types}/util/types/Any.d.ts +0 -0
  685. /package/{src → dist/types}/util/types/JsonDefinedPrimitive.d.ts +0 -0
  686. /package/{src → dist/types}/util/types/ObjectKey.d.ts +0 -0
  687. /package/{src → dist/types}/util/types/TPrimitive.d.ts +0 -0
  688. /package/{src → dist/types}/util/types/TStringParser.d.ts +0 -0
  689. /package/{src → dist/types}/util/validation/createTypedArrayValidator.d.ts +0 -0
  690. /package/{src → dist/types}/util/validation/isArray.d.ts +0 -0
  691. /package/{src → dist/types}/util/validation/isBoolean.d.ts +0 -0
  692. /package/{src → dist/types}/util/validation/isNamedFunctionArray.d.ts +0 -0
  693. /package/{src → dist/types}/util/validation/isObject.d.ts +0 -0
  694. /package/{src → dist/types}/util/validation/isString.d.ts +0 -0
  695. /package/{src → dist/types}/util/validation/isStringArray.d.ts +0 -0
  696. /package/{src → dist/types}/util/validation/isStringWithNoSpacesOrDashes.d.ts +0 -0
  697. /package/{src → dist/types}/util/validation/numbers/isInteger.d.ts +0 -0
  698. /package/{src → dist/types}/util/validation/numbers/isValidNumber.d.ts +0 -0
@@ -0,0 +1,40 @@
1
+ import { objUpdatePropertyDescriptors } from './objUpdatePropertyDescriptors'
2
+
3
+ describe(objUpdatePropertyDescriptors.name, () => {
4
+ it('should update property descriptors of specified properties on the object', () => {
5
+ const object = {
6
+ name: 'John',
7
+ age: 30,
8
+ }
9
+ objUpdatePropertyDescriptors(object, ['name'], (descriptor, property) => ({
10
+ ...descriptor,
11
+ enumerable: false,
12
+ }))
13
+ expect(Object.getOwnPropertyDescriptor(object, 'name')).toEqual({
14
+ value: 'John',
15
+ writable: true,
16
+ enumerable: false,
17
+ configurable: true,
18
+ })
19
+ })
20
+
21
+ it('should throw an error if a specified property does not exist on the object', () => {
22
+ const object = {
23
+ name: 'John',
24
+ age: 30,
25
+ }
26
+ expect(() => {
27
+ objUpdatePropertyDescriptors(object, ['address'], (descriptor, property) => descriptor)
28
+ }).toThrowError("Property, 'address' does not exist on object.")
29
+ })
30
+
31
+ it('should throw an error if any of the specified properties do not exist on the object', () => {
32
+ const object = {
33
+ name: 'John',
34
+ age: 30,
35
+ }
36
+ expect(() => {
37
+ objUpdatePropertyDescriptors(object, ['name', 'address'], (descriptor, property) => descriptor)
38
+ }).toThrowError("Property, 'address' does not exist on object.")
39
+ })
40
+ })
@@ -0,0 +1,29 @@
1
+ import type { ObjectKey } from '../types/ObjectKey'
2
+
3
+ /**
4
+ * Updates the property descriptors of the specified properties on the given object.
5
+ * @param object - The object whose property descriptors are to be updated.
6
+ * @param properties - An array of property names for which the descriptors are to be updated.
7
+ * @param update - A function that takes a property descriptor and a property name, and returns a new property descriptor.
8
+ * @throws Will throw an error if any of the specified properties do not exist on the object.
9
+ * @example ```ts
10
+ * const obj = { a: 1, b: 2 };
11
+ * objUpdatePropertyDescriptors(obj, ['a', 'b'], (descriptor, property) => {
12
+ * descriptor.writable = true;
13
+ * return obj;
14
+ * });
15
+ * ```
16
+ */
17
+ export function objUpdatePropertyDescriptors<V>(
18
+ object: Record<ObjectKey, V>,
19
+ properties: string[],
20
+ update: <T extends PropertyDescriptor>(descriptor: T, property: string) => T
21
+ ): void {
22
+ for (const p of properties) {
23
+ if (!Reflect.has(object, p)) {
24
+ throw new Error(`Property, '${p}' does not exist on object.`)
25
+ }
26
+ const descriptor = update(Object.getOwnPropertyDescriptor(object, p) as PropertyDescriptor, p)
27
+ Object.defineProperty(object, p, descriptor)
28
+ }
29
+ }
@@ -0,0 +1,9 @@
1
+ export function realizeLazyProperty<T>(obj: unknown, key: string, value: T) {
2
+ Object.defineProperty(obj, key, {
3
+ enumerable: true,
4
+ writable: false,
5
+ configurable: false,
6
+ value,
7
+ })
8
+ return value
9
+ }
@@ -0,0 +1,63 @@
1
+ import { setNonEnumerable } from './setNonEnumerable'
2
+
3
+ describe(setNonEnumerable.name, () => {
4
+ it('should set the enumerable property to true.', () => {
5
+ const o = { a: 1 }
6
+ expect(Object.keys(o).includes('a')).toBe(true)
7
+ setNonEnumerable(o, 'a')
8
+ expect(Object.keys(o).includes('a')).toBe(false)
9
+ })
10
+
11
+ describe('when a property does not exist on the object', () => {
12
+ const object = {
13
+ prop1: 'value1',
14
+ }
15
+
16
+ it('should throw an error when one property does not exist', () => {
17
+ expect(() => setNonEnumerable(object, 'prop2')).toThrow("Property, 'prop2' does not exist on object.")
18
+ })
19
+
20
+ it('should throw an error when multiple properties do not exist', () => {
21
+ expect(() => setNonEnumerable(object, 'prop2', 'prop3')).toThrow("Property, 'prop2' does not exist on object.")
22
+ })
23
+ })
24
+
25
+ describe('when a property does not have a descriptor', () => {
26
+ Object.defineProperty(Object.prototype, 'inheritedProp', {
27
+ value: 'value2',
28
+ writable: true,
29
+ configurable: true,
30
+ enumerable: true,
31
+ })
32
+ const object = {
33
+ prop1: 'value1',
34
+ }
35
+
36
+ it('should throw an error when a property does not have a descriptor', () => {
37
+ expect(() => setNonEnumerable(object, 'inheritedProp')).toThrow()
38
+ })
39
+
40
+ it('should throw an error when multiple properties do not have a descriptor', () => {
41
+ expect(() => setNonEnumerable(object, 'inheritedProp', 'prop2')).toThrow()
42
+ })
43
+ })
44
+
45
+ describe('when all properties exist and have descriptors', () => {
46
+ const object = {
47
+ prop1: 'value1',
48
+ prop2: 'value2',
49
+ }
50
+
51
+ it('should make a single property non-enumerable', () => {
52
+ setNonEnumerable(object, 'prop1')
53
+ expect(Object.getOwnPropertyDescriptor(object, 'prop1')?.enumerable).toBe(false)
54
+ expect(Object.getOwnPropertyDescriptor(object, 'prop2')?.enumerable).toBe(true)
55
+ })
56
+
57
+ it('should make multiple properties non-enumerable', () => {
58
+ setNonEnumerable(object, 'prop1', 'prop2')
59
+ expect(Object.getOwnPropertyDescriptor(object, 'prop1')?.enumerable).toBe(false)
60
+ expect(Object.getOwnPropertyDescriptor(object, 'prop2')?.enumerable).toBe(false)
61
+ })
62
+ })
63
+ })
@@ -0,0 +1,22 @@
1
+ import type { ObjectKey } from '../types/ObjectKey'
2
+ import { objUpdatePropertyDescriptors } from './objUpdatePropertyDescriptors'
3
+
4
+ /**
5
+ * Sets the specified properties of an object as non-enumerable.
6
+ * @remarks This function modifies the original object by setting the specified properties as non-enumerable.
7
+ * If the object or any of the property names are not valid, it throws an error.
8
+ * @param object The object whose properties are to be set as non-enumerable.
9
+ * @param properties The names of the properties to be set as non-enumerable.
10
+ * @throws Will throw an error if any of the specified properties do not exist on the object.
11
+ * @example ```ts
12
+ * setNonEnumerable({ a: 1, b: 2, c: 3 }, 'a', 'b');
13
+ * Object.keys({ a: 1, b: 2, c: 3 });;
14
+ * //=> ['c']
15
+ * ```
16
+ */
17
+ export function setNonEnumerable(object: Record<ObjectKey, any>, ...properties: string[]): void {
18
+ objUpdatePropertyDescriptors(object, properties, (descriptor) => {
19
+ descriptor.enumerable = false
20
+ return descriptor
21
+ })
22
+ }
@@ -0,0 +1,14 @@
1
+ import { isOSX } from './isOSX'
2
+ import { isVsCodeInstalled } from './isVsCodeInstalled'
3
+ import { isWindows } from './isWindows'
4
+
5
+ /**
6
+ * Get the default command to open a file in in a text editor.
7
+ * If VSCode is installed, this is used. Otherwise, the default text editor of the OS is used.
8
+ */
9
+ export function defaultOpenInEditorCommand() {
10
+ if (!COMMAND) COMMAND = isVsCodeInstalled() ? 'code -w' : isWindows() ? 'notepad' : isOSX() ? 'open vi' : 'xdg-open'
11
+ return COMMAND
12
+ }
13
+
14
+ let COMMAND = ''
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Checks if the current platform is OSX.
3
+ * It checks the 'process' object and the 'platform' property to determine if the platform is 'darwin'.
4
+ * @returns A boolean indicating whether the current platform is OSX.
5
+ */
6
+
7
+ export function isOSX(): boolean {
8
+ return process.platform === 'darwin'
9
+ }
@@ -0,0 +1,7 @@
1
+ import { isVsCodeInstalled } from './isVsCodeInstalled'
2
+
3
+ describe(isVsCodeInstalled.name, () => {
4
+ it('should return a boolean for whether VSCode is installed.', () => {
5
+ expect(typeof isVsCodeInstalled()).toBe('boolean')
6
+ })
7
+ })
@@ -0,0 +1,14 @@
1
+ import { execSync } from 'child_process'
2
+
3
+ /**
4
+ * Returns whether Visual Studio Code is installed on the system.
5
+ * @example isVsCodeInstalled() //=> true
6
+ */
7
+ export function isVsCodeInstalled(): boolean {
8
+ try {
9
+ const stdout = execSync('code --help').toString()
10
+ return stdout.startsWith('Visual Studio Code') && stdout.includes('-w --wait')
11
+ } catch (e) {
12
+ return false
13
+ }
14
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Checks if the current platform is Windows.
3
+ * @remarks
4
+ * It checks the 'process' object and the 'platform' property to determine if the platform is 'win32'.
5
+ * It also checks the 'OSTYPE' environment variable to see if it matches 'msys' or 'cygwin'.
6
+ * @returns A boolean indicating whether the current platform is Windows.
7
+ */
8
+ export function isWindows(): boolean {
9
+ return isWin
10
+ }
11
+
12
+ const isWin = process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env['OSTYPE'] || ''))
@@ -0,0 +1,9 @@
1
+ import { getTempDataPath } from './getTempDataPath'
2
+
3
+ describe(getTempDataPath.name, () => {
4
+ it('returns the path to the os temp dir', () => {
5
+ expect(typeof getTempDataPath()).toBe('string')
6
+ expect(getTempDataPath('myapp').endsWith('myapp')).toBe(true)
7
+ expect(getTempDataPath('myapp', 'dir').endsWith('dir')).toBe(true)
8
+ })
9
+ })
@@ -0,0 +1,14 @@
1
+ import fs from 'fs-extra'
2
+ import os from 'os'
3
+ import path from 'path'
4
+
5
+ /**
6
+ * Returns a path to the os tmpdir location.
7
+ *
8
+ * @param paths - The paths to join to the os tmpdir location.
9
+ */
10
+ export function getTempDataPath(...paths: string[]): string {
11
+ return path.join(tempdir, ...paths)
12
+ }
13
+
14
+ const tempdir = fs.realpathSync(os.tmpdir())
@@ -0,0 +1,35 @@
1
+ import { regexEscapeString } from './regexEscapeString'
2
+
3
+ describe('regexEscapeString', () => {
4
+ it('escapes correctly', () => {
5
+ expect(regexEscapeString('[click](google.com)')).toBe('\\[click\\]\\(google\\.com\\)')
6
+ })
7
+
8
+ it('works when creating RegExp object', () => {
9
+ expect(() => {
10
+ new RegExp(regexEscapeString('[.^$()]*(wow)+'), 'g')
11
+ }).not.toThrowError()
12
+ })
13
+
14
+ it('should escape special characters', () => {
15
+ const str = '.*+?^${}()|[\\]'
16
+ const expected = '\\.\\*\\+\\?\\^\\$\\{\\}\\(\\)\\|\\[\\\\\\]'
17
+ expect(regexEscapeString(str)).toBe(expected)
18
+ })
19
+
20
+ it('should return the same string if there are no special characters', () => {
21
+ const str = 'abc123'
22
+ expect(regexEscapeString(str)).toBe(str)
23
+ })
24
+
25
+ it('should handle empty strings', () => {
26
+ const str = ''
27
+ expect(regexEscapeString(str)).toBe(str)
28
+ })
29
+
30
+ it('should escape special characters in a string with alphanumeric characters', () => {
31
+ const str = 'abc.*+?^${}()|[\\]123'
32
+ const expected = 'abc\\.\\*\\+\\?\\^\\$\\{\\}\\(\\)\\|\\[\\\\\\]123'
33
+ expect(regexEscapeString(str)).toBe(expected)
34
+ })
35
+ })
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Escapes special characters in a string to be used in a regular expression.
3
+ * @param str The input string to escape.
4
+ * @returns The escaped string.
5
+ * @example ```ts
6
+ * const input = 'Hello, world!';
7
+ * regexEscapeString(input);;
8
+ * //=> 'Hello, world!'
9
+ * ```
10
+ */
11
+ export function regexEscapeString(str: string): string {
12
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // $& means the whole matched string
13
+ }
@@ -0,0 +1,13 @@
1
+ import { strEnsureStartsWith } from './strEnsureStartsWith'
2
+
3
+ describe('strEnsureStartsWith', () => {
4
+ it('should return the original string if it already starts with the specified substring', () => {
5
+ const result = strEnsureStartsWith('.json', '.')
6
+ expect(result).toBe('.json')
7
+ })
8
+
9
+ it('should prepend the specified substring to the start of the string if it does not already start with it', () => {
10
+ const result = strEnsureStartsWith('json', '.')
11
+ expect(result).toBe('.json')
12
+ })
13
+ })
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Ensures that a string starts with a specified substring. If the string already starts with the specified substring, it is returned as is. Otherwise, the substring is appended to the end of the string.
3
+ * @param string The string to be processed.
4
+ * @param startsWith The substring that the string should end with.
5
+ * @example ```ts
6
+ * strEnsureStartsWith('json', '.');
7
+ * //=> '.json'
8
+ * strEnsureStartsWith('.json', '.');
9
+ * //=> '.json'
10
+ * ```
11
+ */
12
+ export function strEnsureStartsWith(string: string, startsWith: string): string {
13
+ return string.startsWith(startsWith) ? string : startsWith + string
14
+ }
@@ -0,0 +1,33 @@
1
+ import { strFirstCharToUpperCase } from './strFirstCharToUpperCase'
2
+
3
+ describe('strFirstCharToUpperCase', () => {
4
+ it('should convert the first character of a string to uppercase', () => {
5
+ const result = strFirstCharToUpperCase('hello')
6
+ expect(result).toBe('Hello')
7
+ })
8
+
9
+ it('should return the same string if the first character is already uppercase', () => {
10
+ const result = strFirstCharToUpperCase('Hello')
11
+ expect(result).toBe('Hello')
12
+ })
13
+
14
+ it('should return the same string if it starts with a non-alphabetical character', () => {
15
+ const result = strFirstCharToUpperCase('1hello')
16
+ expect(result).toBe('1hello')
17
+ })
18
+
19
+ it('should return an empty string if the input is an empty string', () => {
20
+ const result = strFirstCharToUpperCase('')
21
+ expect(result).toBe('')
22
+ })
23
+
24
+ it('should handle strings with only one character', () => {
25
+ const result = strFirstCharToUpperCase('h')
26
+ expect(result).toBe('H')
27
+ })
28
+
29
+ it('should handle strings with only one uppercase character', () => {
30
+ const result = strFirstCharToUpperCase('H')
31
+ expect(result).toBe('H')
32
+ })
33
+ })
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Converts the first character of a string to uppercase.
3
+ * @param string The string to be converted.
4
+ * @example ```ts
5
+ * strFirstCharToUpperCase('hello');
6
+ * //=> 'Hello'
7
+ * ```
8
+ */
9
+ export function strFirstCharToUpperCase(string: string): string {
10
+ return string.charAt(0).toUpperCase() + string.substring(1)
11
+ }
@@ -0,0 +1,42 @@
1
+ import { strIsLowerCase } from './strIsLowerCase'
2
+
3
+ describe('strIsLowerCase', () => {
4
+ it('example', () => {
5
+ expect(strIsLowerCase('input')).toBe(true)
6
+ expect(strIsLowerCase('Input')).toBe(false)
7
+ expect(strIsLowerCase('')).toBe(true)
8
+ expect(strIsLowerCase('.')).toBe(true)
9
+ })
10
+
11
+ it('should return true for a lowercase string', () => {
12
+ expect(strIsLowerCase('hello')).toBe(true)
13
+ })
14
+
15
+ it('should return false for an uppercase string', () => {
16
+ expect(strIsLowerCase('HELLO')).toBe(false)
17
+ })
18
+
19
+ it('should return false for a mixed case string', () => {
20
+ expect(strIsLowerCase('Hello')).toBe(false)
21
+ })
22
+
23
+ it('should return true for an empty string', () => {
24
+ expect(strIsLowerCase('')).toBe(true)
25
+ })
26
+
27
+ it('should return true for a string with spaces', () => {
28
+ expect(strIsLowerCase('hello world')).toBe(true)
29
+ })
30
+
31
+ it('should return false for a string with spaces and uppercase letters', () => {
32
+ expect(strIsLowerCase('Hello World')).toBe(false)
33
+ })
34
+
35
+ it('should return true for a string with special characters', () => {
36
+ expect(strIsLowerCase('hello@world.com')).toBe(true)
37
+ })
38
+
39
+ it('should return false for a string with special characters and uppercase letters', () => {
40
+ expect(strIsLowerCase('Hello@World.com')).toBe(false)
41
+ })
42
+ })
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Checks if the given string is in lower case.
3
+ * @param input The string to be checked.
4
+ * @example ```ts
5
+ * strIsLowerCase('hello');
6
+ * //=> true
7
+ * strIsLowerCase('Hello');
8
+ * //=> false
9
+ * ```
10
+ */
11
+ export function strIsLowerCase(input: string): boolean {
12
+ return input === input.toLowerCase()
13
+ }
@@ -0,0 +1,48 @@
1
+ import { strIsUpperCase } from './strIsUpperCase'
2
+
3
+ describe('strIsUpperCase', () => {
4
+ it('example', () => {
5
+ expect(strIsUpperCase('INPUT')).toBe(true)
6
+ expect(strIsUpperCase('Input')).toBe(false)
7
+ })
8
+
9
+ it('should return true for a string in upper case', () => {
10
+ expect(strIsUpperCase('HELLO')).toBe(true)
11
+ })
12
+
13
+ it('should return false for a string in lower case', () => {
14
+ expect(strIsUpperCase('hello')).toBe(false)
15
+ })
16
+
17
+ it('should return false for a string in mixed case', () => {
18
+ expect(strIsUpperCase('Hello')).toBe(false)
19
+ })
20
+
21
+ it('should return true for a string with upper case special characters', () => {
22
+ expect(strIsUpperCase('HELLO WORLD!')).toBe(true)
23
+ })
24
+
25
+ it('should return false for a string with lower case special characters', () => {
26
+ expect(strIsUpperCase('hello world!')).toBe(false)
27
+ })
28
+
29
+ it('should return true for an empty string', () => {
30
+ expect(strIsUpperCase('')).toBe(true)
31
+ })
32
+
33
+ it('should return true for a string with only spaces', () => {
34
+ expect(strIsUpperCase(' ')).toBe(true)
35
+ })
36
+
37
+ it('should return true for a string with numbers', () => {
38
+ expect(strIsUpperCase('123')).toBe(true)
39
+ })
40
+
41
+ it('should return true for a string with upper case numbers and special characters', () => {
42
+ expect(strIsUpperCase('HELLO123!')).toBe(true)
43
+ })
44
+
45
+ it('should return false for a string with lower case numbers and special characters', () => {
46
+ expect(strIsUpperCase('hello123!')).toBe(false)
47
+ })
48
+ })
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Checks if the given string is in upper case.
3
+ * @param input The string to be checked.
4
+ * @example ```ts
5
+ * strIsUpperCase('HELLO');;
6
+ * //=> true
7
+ * strIsUpperCase('HEllo');;
8
+ * //=> false
9
+ * ```
10
+ */
11
+ export function strIsUpperCase(input: string): boolean {
12
+ return input === input.toUpperCase()
13
+ }
@@ -0,0 +1,54 @@
1
+ import { strSplitCamelCase } from './strSplitCamelCase'
2
+
3
+ describe('strSplitCamelCase', () => {
4
+ it('example', () => {
5
+ expect(strSplitCamelCase('someCamelCase')).toStrictEqual(['some', 'Camel', 'Case'])
6
+ })
7
+
8
+ it('handles numbers', () => {
9
+ expect(strSplitCamelCase('camelCase18')).toStrictEqual(['camel', 'Case18'])
10
+ expect(strSplitCamelCase('camel18Case')).toStrictEqual(['camel18', 'Case'])
11
+ expect(strSplitCamelCase('camel18case')).toStrictEqual(['camel18case'])
12
+ })
13
+
14
+ it('should handle empty strings', () => {
15
+ expect(strSplitCamelCase('')).toEqual([])
16
+ })
17
+
18
+ it('should handle strings with only one character', () => {
19
+ expect(strSplitCamelCase('a')).toEqual(['a'])
20
+ expect(strSplitCamelCase('A')).toEqual(['A'])
21
+ })
22
+
23
+ it('should not split words with only two characters', () => {
24
+ expect(strSplitCamelCase('ab')).toEqual(['ab'])
25
+ expect(strSplitCamelCase('aB')).toEqual(['aB'])
26
+ expect(strSplitCamelCase('bA')).toEqual(['bA'])
27
+ })
28
+
29
+ it('handles short strings', () => {
30
+ expect(strSplitCamelCase('aWo')).toStrictEqual(['a', 'Wo'])
31
+ expect(strSplitCamelCase('aaWo')).toStrictEqual(['aa', 'Wo'])
32
+ expect(strSplitCamelCase('aaaW')).toStrictEqual(['aaa', 'W'])
33
+ })
34
+
35
+ it('should split camel case words correctly', () => {
36
+ expect(strSplitCamelCase('camelCaseWord')).toEqual(['camel', 'Case', 'Word'])
37
+ expect(strSplitCamelCase('anotherCamelCaseWord')).toEqual(['another', 'Camel', 'Case', 'Word'])
38
+ })
39
+
40
+ it('should return the word as it was if no splits needed', () => {
41
+ expect(strSplitCamelCase('word')).toEqual(['word'])
42
+ expect(strSplitCamelCase('anotherword')).toEqual(['anotherword'])
43
+ })
44
+
45
+ it('should handle strings with numeric characters', () => {
46
+ expect(strSplitCamelCase('camelCase1Word')).toEqual(['camel', 'Case1', 'Word'])
47
+ expect(strSplitCamelCase('anotherCamelCase2Word')).toEqual(['another', 'Camel', 'Case2', 'Word'])
48
+ })
49
+
50
+ it('should handle strings with special characters', () => {
51
+ expect(strSplitCamelCase('camelCase$Word')).toEqual(['camel', 'Case$', 'Word'])
52
+ expect(strSplitCamelCase('anotherCamelCase#Word')).toEqual(['another', 'Camel', 'Case#', 'Word'])
53
+ })
54
+ })
@@ -0,0 +1,51 @@
1
+ import { strIsLowerCase } from './strIsLowerCase'
2
+ import { strIsUpperCase } from './strIsUpperCase'
3
+
4
+ /**
5
+ * Returns an array of words in the string
6
+ * @param word The camel case word to split.
7
+ * @throws Throws an error if the input is not a string.
8
+ * @param input input string
9
+ * @example ```ts
10
+ * strSplitCamelCase('someCamel10Case')
11
+ * //=> ['some', 'Camel10', 'Case']
12
+ * ```
13
+ */
14
+ export function strSplitCamelCase(word: string): string[] {
15
+ if (!word) return []
16
+ if (word.length <= 2) return [word]
17
+ const result: string[] = []
18
+ const lastCharIndex = word.length - 1
19
+ let lastSplitIndex = 0
20
+ let foundCamelCase = false
21
+ for (let i = 1; i < word.length; i++) {
22
+ if (isWordSplitIndex(word, i)) {
23
+ const sub = word.substring(lastSplitIndex, i)
24
+ if (sub) {
25
+ result.push(sub)
26
+ lastSplitIndex = i
27
+ foundCamelCase = true
28
+ }
29
+ }
30
+ if (foundCamelCase && i === lastCharIndex) {
31
+ const sub = word.substring(lastSplitIndex)
32
+ if (sub) result.push(sub)
33
+ }
34
+ }
35
+ if (!foundCamelCase) result.push(word)
36
+ return result
37
+ }
38
+
39
+ const regInteger = /\d+/g
40
+ const regSpecial = /[^\w]+/g
41
+
42
+ function isWordSplitIndex(word: string, index: number) {
43
+ return (
44
+ strIsLowerCase(word[index - 1]) &&
45
+ strIsUpperCase(word[index]) &&
46
+ !regInteger.test(word[index - 1]) &&
47
+ !regInteger.test(word[index]) &&
48
+ !regSpecial.test(word[index - 1]) &&
49
+ !regSpecial.test(word[index])
50
+ )
51
+ }