@bemoje/cli 0.0.8 → 0.0.10
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.
- package/cjs/arg/ArgumentBuilder.js +2 -2
- package/cjs/arg/ArgumentBuilder.js.map +1 -1
- package/cjs/arg/ArgumentValidatorSelector.js +2 -2
- package/cjs/arg/ArgumentValidatorSelector.js.map +1 -1
- package/cjs/cmd/CommandBuilder.js +77 -34
- package/cjs/cmd/CommandBuilder.js.map +1 -1
- package/cjs/cmd/CommandBuilderMetaData.js +2 -2
- package/cjs/cmd/CommandBuilderMetaData.js.map +1 -1
- package/cjs/core/OutputManager.js +4 -4
- package/cjs/core/OutputManager.js.map +1 -1
- package/cjs/core/ParserSelector.js +11 -11
- package/cjs/core/ParserSelector.js.map +1 -1
- package/cjs/core/ValidatorSelector.js +11 -11
- package/cjs/core/ValidatorSelector.js.map +1 -1
- package/cjs/db/AbstractJsonFileSection.js +2 -3
- package/cjs/db/AbstractJsonFileSection.js.map +1 -1
- package/cjs/db/ConfigSection.js +3 -4
- package/cjs/db/ConfigSection.js.map +1 -1
- package/cjs/db/JsonFile.js +5 -6
- package/cjs/db/JsonFile.js.map +1 -1
- package/cjs/db/PresetsSection.js +2 -2
- package/cjs/db/PresetsSection.js.map +1 -1
- package/cjs/index.js +0 -78
- package/cjs/index.js.map +1 -1
- package/cjs/opt/OptionBuilder.js +2 -2
- package/cjs/opt/OptionBuilder.js.map +1 -1
- package/cjs/opt/OptionHelpers.js +5 -5
- package/cjs/opt/OptionHelpers.js.map +1 -1
- package/esm/arg/ArgumentBuilder.js +1 -1
- package/esm/arg/ArgumentBuilder.js.map +1 -1
- package/esm/arg/ArgumentValidatorSelector.js +1 -1
- package/esm/arg/ArgumentValidatorSelector.js.map +1 -1
- package/esm/cmd/CommandBuilder.js +59 -16
- package/esm/cmd/CommandBuilder.js.map +1 -1
- package/esm/cmd/CommandBuilderMetaData.js +1 -1
- package/esm/cmd/CommandBuilderMetaData.js.map +1 -1
- package/esm/core/OutputManager.js +1 -1
- package/esm/core/OutputManager.js.map +1 -1
- package/esm/core/ParserSelector.js +4 -4
- package/esm/core/ParserSelector.js.map +1 -1
- package/esm/core/ValidatorSelector.js +4 -4
- package/esm/core/ValidatorSelector.js.map +1 -1
- package/esm/db/AbstractJsonFileSection.js +1 -2
- package/esm/db/AbstractJsonFileSection.js.map +1 -1
- package/esm/db/ConfigSection.js +1 -2
- package/esm/db/ConfigSection.js.map +1 -1
- package/esm/db/JsonFile.js +1 -2
- package/esm/db/JsonFile.js.map +1 -1
- package/esm/db/PresetsSection.js +1 -1
- package/esm/db/PresetsSection.js.map +1 -1
- package/esm/index.js +0 -78
- package/esm/index.js.map +1 -1
- package/esm/opt/OptionBuilder.js +1 -1
- package/esm/opt/OptionBuilder.js.map +1 -1
- package/esm/opt/OptionHelpers.js +2 -2
- package/esm/opt/OptionHelpers.js.map +1 -1
- package/package.json +1 -1
- package/types/arg/ArgumentParserSelector.d.ts +2 -2
- package/types/arg/ArgumentValidatorSelector.d.ts +1 -1
- package/types/cmd/CommandBuilder.d.ts +40 -6
- package/types/cmd/CommandBuilderMetaData.d.ts +3 -3
- package/types/core/OutputManager.d.ts +2 -2
- package/types/core/ParserSelector.d.ts +2 -2
- package/types/core/ValidatorSelector.d.ts +2 -2
- package/types/db/AbstractJsonFileSection.d.ts +2 -3
- package/types/db/AppDataSection.d.ts +1 -1
- package/types/db/ConfigSection.d.ts +1 -3
- package/types/db/JsonFile.d.ts +1 -1
- package/types/index.d.ts +0 -78
- package/types/opt/OptionArgumentParserSelector.d.ts +1 -1
- package/types/opt/OptionArgumentValidatorSelector.d.ts +1 -1
- package/types/types/IConfig.d.ts +3 -3
- package/types/types/IPreset.d.ts +1 -1
- package/cjs/_example/bFindIn.js +0 -189
- package/cjs/_example/bFindIn.js.map +0 -1
- package/cjs/cmd/asdas.js +0 -27
- package/cjs/cmd/asdas.js.map +0 -1
- package/cjs/util/array/arrLast.js +0 -21
- package/cjs/util/array/arrLast.js.map +0 -1
- package/cjs/util/array/arrSome.js +0 -26
- package/cjs/util/array/arrSome.js.map +0 -1
- package/cjs/util/array/types/ArrayPredicate.js +0 -3
- package/cjs/util/array/types/ArrayPredicate.js.map +0 -1
- package/cjs/util/db/JsonDB.js +0 -145
- package/cjs/util/db/JsonDB.js.map +0 -1
- package/cjs/util/errors/ErrorParser.js +0 -164
- package/cjs/util/errors/ErrorParser.js.map +0 -1
- package/cjs/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js +0 -3
- package/cjs/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js.map +0 -1
- package/cjs/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js +0 -32
- package/cjs/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js.map +0 -1
- package/cjs/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js +0 -25
- package/cjs/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js.map +0 -1
- package/cjs/util/fs/readFile/readFileSafeSync.js +0 -28
- package/cjs/util/fs/readFile/readFileSafeSync.js.map +0 -1
- package/cjs/util/fs/readFile/readFileSync.js +0 -20
- package/cjs/util/fs/readFile/readFileSync.js.map +0 -1
- package/cjs/util/fs/readJsonFile/readJsonFileSafeSync.js +0 -24
- package/cjs/util/fs/readJsonFile/readJsonFileSafeSync.js.map +0 -1
- package/cjs/util/fs/removeFile/removeFile.js +0 -6
- package/cjs/util/fs/removeFile/removeFile.js.map +0 -1
- package/cjs/util/fs/tempFile/tempFileSync.js +0 -28
- package/cjs/util/fs/tempFile/tempFileSync.js.map +0 -1
- package/cjs/util/fs/types/IReadJsonFileOptions.js +0 -3
- package/cjs/util/fs/types/IReadJsonFileOptions.js.map +0 -1
- package/cjs/util/fs/writeFile/writeFileSafeSync.js +0 -6
- package/cjs/util/fs/writeFile/writeFileSafeSync.js.map +0 -1
- package/cjs/util/fs/writeFile/writeFileSync.js +0 -6
- package/cjs/util/fs/writeFile/writeFileSync.js.map +0 -1
- package/cjs/util/fs/writeJsonFile/writeJsonFileSafe.js +0 -6
- package/cjs/util/fs/writeJsonFile/writeJsonFileSafe.js.map +0 -1
- package/cjs/util/function/MethodDisabler.js +0 -94
- package/cjs/util/function/MethodDisabler.js.map +0 -1
- package/cjs/util/function/funSetName.js +0 -21
- package/cjs/util/function/funSetName.js.map +0 -1
- package/cjs/util/node/execInherit.js +0 -19
- package/cjs/util/node/execInherit.js.map +0 -1
- package/cjs/util/node/formatTableForTerminal.js +0 -21
- package/cjs/util/node/formatTableForTerminal.js.map +0 -1
- package/cjs/util/object/arrAssign.js +0 -6
- package/cjs/util/object/arrAssign.js.map +0 -1
- package/cjs/util/object/createArrayMerger.js +0 -20
- package/cjs/util/object/createArrayMerger.js.map +0 -1
- package/cjs/util/object/createObjectMerger.js +0 -20
- package/cjs/util/object/createObjectMerger.js.map +0 -1
- package/cjs/util/object/objAssign.js +0 -6
- package/cjs/util/object/objAssign.js.map +0 -1
- package/cjs/util/object/objUpdatePropertyDescriptors.js +0 -28
- package/cjs/util/object/objUpdatePropertyDescriptors.js.map +0 -1
- package/cjs/util/object/realizeLazyProperty.js +0 -14
- package/cjs/util/object/realizeLazyProperty.js.map +0 -1
- package/cjs/util/object/setNonEnumerable.js +0 -25
- package/cjs/util/object/setNonEnumerable.js.map +0 -1
- package/cjs/util/os/defaultOpenInEditorCommand.js +0 -18
- package/cjs/util/os/defaultOpenInEditorCommand.js.map +0 -1
- package/cjs/util/os/isOSX.js +0 -13
- package/cjs/util/os/isOSX.js.map +0 -1
- package/cjs/util/os/isVsCodeInstalled.js +0 -19
- package/cjs/util/os/isVsCodeInstalled.js.map +0 -1
- package/cjs/util/os/isWindows.js +0 -16
- package/cjs/util/os/isWindows.js.map +0 -1
- package/cjs/util/path/getTempDataPath.js +0 -20
- package/cjs/util/path/getTempDataPath.js.map +0 -1
- package/cjs/util/regex/regexEscapeString.js +0 -18
- package/cjs/util/regex/regexEscapeString.js.map +0 -1
- package/cjs/util/string/strEnsureStartsWith.js +0 -19
- package/cjs/util/string/strEnsureStartsWith.js.map +0 -1
- package/cjs/util/string/strFirstCharToUpperCase.js +0 -16
- package/cjs/util/string/strFirstCharToUpperCase.js.map +0 -1
- package/cjs/util/string/strIsLowerCase.js +0 -18
- package/cjs/util/string/strIsLowerCase.js.map +0 -1
- package/cjs/util/string/strIsUpperCase.js +0 -18
- package/cjs/util/string/strIsUpperCase.js.map +0 -1
- package/cjs/util/string/strSplitCamelCase.js +0 -55
- package/cjs/util/string/strSplitCamelCase.js.map +0 -1
- package/cjs/util/string-parsers/createBooleanParser.js +0 -21
- package/cjs/util/string-parsers/createBooleanParser.js.map +0 -1
- package/cjs/util/string-parsers/createTypedListParser.js +0 -22
- package/cjs/util/string-parsers/createTypedListParser.js.map +0 -1
- package/cjs/util/string-parsers/parseBoolean.js +0 -15
- package/cjs/util/string-parsers/parseBoolean.js.map +0 -1
- package/cjs/util/string-parsers/parseInteger.js +0 -17
- package/cjs/util/string-parsers/parseInteger.js.map +0 -1
- package/cjs/util/string-parsers/parseNumber.js +0 -13
- package/cjs/util/string-parsers/parseNumber.js.map +0 -1
- package/cjs/util/string-parsers/parseString.js +0 -8
- package/cjs/util/string-parsers/parseString.js.map +0 -1
- package/cjs/util/types/Any.js +0 -3
- package/cjs/util/types/Any.js.map +0 -1
- package/cjs/util/types/DeepArray.js +0 -3
- package/cjs/util/types/DeepArray.js.map +0 -1
- package/cjs/util/types/DeepObject.js +0 -3
- package/cjs/util/types/DeepObject.js.map +0 -1
- package/cjs/util/types/JsonArray.js +0 -3
- package/cjs/util/types/JsonArray.js.map +0 -1
- package/cjs/util/types/JsonDefinedPrimitive.js +0 -6
- package/cjs/util/types/JsonDefinedPrimitive.js.map +0 -1
- package/cjs/util/types/JsonObject.js +0 -3
- package/cjs/util/types/JsonObject.js.map +0 -1
- package/cjs/util/types/JsonRawPrimitive.js +0 -3
- package/cjs/util/types/JsonRawPrimitive.js.map +0 -1
- package/cjs/util/types/JsonValue.js +0 -3
- package/cjs/util/types/JsonValue.js.map +0 -1
- package/cjs/util/types/ObjectKey.js +0 -3
- package/cjs/util/types/ObjectKey.js.map +0 -1
- package/cjs/util/types/TConstructor.js +0 -3
- package/cjs/util/types/TConstructor.js.map +0 -1
- package/cjs/util/types/TFunction.js +0 -3
- package/cjs/util/types/TFunction.js.map +0 -1
- package/cjs/util/types/TFunctionNoNew.js +0 -3
- package/cjs/util/types/TFunctionNoNew.js.map +0 -1
- package/cjs/util/types/TPlainObject.js +0 -3
- package/cjs/util/types/TPlainObject.js.map +0 -1
- package/cjs/util/types/TPrimitive.js +0 -3
- package/cjs/util/types/TPrimitive.js.map +0 -1
- package/cjs/util/types/TStringParser.js +0 -3
- package/cjs/util/types/TStringParser.js.map +0 -1
- package/cjs/util/types/TValidator.js +0 -3
- package/cjs/util/types/TValidator.js.map +0 -1
- package/cjs/util/validation/createTypedArrayValidator.js +0 -26
- package/cjs/util/validation/createTypedArrayValidator.js.map +0 -1
- package/cjs/util/validation/ensureThat.js +0 -12
- package/cjs/util/validation/ensureThat.js.map +0 -1
- package/cjs/util/validation/isArray.js +0 -5
- package/cjs/util/validation/isArray.js.map +0 -1
- package/cjs/util/validation/isBoolean.js +0 -8
- package/cjs/util/validation/isBoolean.js.map +0 -1
- package/cjs/util/validation/isFunction.js +0 -17
- package/cjs/util/validation/isFunction.js.map +0 -1
- package/cjs/util/validation/isNamedFunction.js +0 -11
- package/cjs/util/validation/isNamedFunction.js.map +0 -1
- package/cjs/util/validation/isNamedFunctionArray.js +0 -9
- package/cjs/util/validation/isNamedFunctionArray.js.map +0 -1
- package/cjs/util/validation/isObject.js +0 -22
- package/cjs/util/validation/isObject.js.map +0 -1
- package/cjs/util/validation/isPlainObject.js +0 -19
- package/cjs/util/validation/isPlainObject.js.map +0 -1
- package/cjs/util/validation/isPrimitive.js +0 -18
- package/cjs/util/validation/isPrimitive.js.map +0 -1
- package/cjs/util/validation/isString.js +0 -8
- package/cjs/util/validation/isString.js.map +0 -1
- package/cjs/util/validation/isStringArray.js +0 -12
- package/cjs/util/validation/isStringArray.js.map +0 -1
- package/cjs/util/validation/isStringWithNoSpacesOrDashes.js +0 -9
- package/cjs/util/validation/isStringWithNoSpacesOrDashes.js.map +0 -1
- package/cjs/util/validation/numbers/isInteger.js +0 -17
- package/cjs/util/validation/numbers/isInteger.js.map +0 -1
- package/cjs/util/validation/numbers/isValidNumber.js +0 -22
- package/cjs/util/validation/numbers/isValidNumber.js.map +0 -1
- package/esm/_example/bFindIn.js +0 -187
- package/esm/_example/bFindIn.js.map +0 -1
- package/esm/cmd/asdas.js +0 -25
- package/esm/cmd/asdas.js.map +0 -1
- package/esm/util/array/arrLast.js +0 -17
- package/esm/util/array/arrLast.js.map +0 -1
- package/esm/util/array/arrSome.js +0 -22
- package/esm/util/array/arrSome.js.map +0 -1
- package/esm/util/array/types/ArrayPredicate.js +0 -2
- package/esm/util/array/types/ArrayPredicate.js.map +0 -1
- package/esm/util/db/JsonDB.js +0 -141
- package/esm/util/db/JsonDB.js.map +0 -1
- package/esm/util/errors/ErrorParser.js +0 -154
- package/esm/util/errors/ErrorParser.js.map +0 -1
- package/esm/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js +0 -2
- package/esm/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.js.map +0 -1
- package/esm/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js +0 -28
- package/esm/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.js.map +0 -1
- package/esm/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js +0 -21
- package/esm/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.js.map +0 -1
- package/esm/util/fs/readFile/readFileSafeSync.js +0 -21
- package/esm/util/fs/readFile/readFileSafeSync.js.map +0 -1
- package/esm/util/fs/readFile/readFileSync.js +0 -13
- package/esm/util/fs/readFile/readFileSync.js.map +0 -1
- package/esm/util/fs/readJsonFile/readJsonFileSafeSync.js +0 -17
- package/esm/util/fs/readJsonFile/readJsonFileSafeSync.js.map +0 -1
- package/esm/util/fs/removeFile/removeFile.js +0 -2
- package/esm/util/fs/removeFile/removeFile.js.map +0 -1
- package/esm/util/fs/tempFile/tempFileSync.js +0 -21
- package/esm/util/fs/tempFile/tempFileSync.js.map +0 -1
- package/esm/util/fs/types/IReadJsonFileOptions.js +0 -2
- package/esm/util/fs/types/IReadJsonFileOptions.js.map +0 -1
- package/esm/util/fs/writeFile/writeFileSafeSync.js +0 -2
- package/esm/util/fs/writeFile/writeFileSafeSync.js.map +0 -1
- package/esm/util/fs/writeFile/writeFileSync.js +0 -2
- package/esm/util/fs/writeFile/writeFileSync.js.map +0 -1
- package/esm/util/fs/writeJsonFile/writeJsonFileSafe.js +0 -2
- package/esm/util/fs/writeJsonFile/writeJsonFileSafe.js.map +0 -1
- package/esm/util/function/MethodDisabler.js +0 -90
- package/esm/util/function/MethodDisabler.js.map +0 -1
- package/esm/util/function/funSetName.js +0 -17
- package/esm/util/function/funSetName.js.map +0 -1
- package/esm/util/node/execInherit.js +0 -15
- package/esm/util/node/execInherit.js.map +0 -1
- package/esm/util/node/formatTableForTerminal.js +0 -14
- package/esm/util/node/formatTableForTerminal.js.map +0 -1
- package/esm/util/object/arrAssign.js +0 -3
- package/esm/util/object/arrAssign.js.map +0 -1
- package/esm/util/object/createArrayMerger.js +0 -16
- package/esm/util/object/createArrayMerger.js.map +0 -1
- package/esm/util/object/createObjectMerger.js +0 -16
- package/esm/util/object/createObjectMerger.js.map +0 -1
- package/esm/util/object/objAssign.js +0 -3
- package/esm/util/object/objAssign.js.map +0 -1
- package/esm/util/object/objUpdatePropertyDescriptors.js +0 -24
- package/esm/util/object/objUpdatePropertyDescriptors.js.map +0 -1
- package/esm/util/object/realizeLazyProperty.js +0 -10
- package/esm/util/object/realizeLazyProperty.js.map +0 -1
- package/esm/util/object/setNonEnumerable.js +0 -21
- package/esm/util/object/setNonEnumerable.js.map +0 -1
- package/esm/util/os/defaultOpenInEditorCommand.js +0 -14
- package/esm/util/os/defaultOpenInEditorCommand.js.map +0 -1
- package/esm/util/os/isOSX.js +0 -9
- package/esm/util/os/isOSX.js.map +0 -1
- package/esm/util/os/isVsCodeInstalled.js +0 -15
- package/esm/util/os/isVsCodeInstalled.js.map +0 -1
- package/esm/util/os/isWindows.js +0 -12
- package/esm/util/os/isWindows.js.map +0 -1
- package/esm/util/path/getTempDataPath.js +0 -13
- package/esm/util/path/getTempDataPath.js.map +0 -1
- package/esm/util/regex/regexEscapeString.js +0 -14
- package/esm/util/regex/regexEscapeString.js.map +0 -1
- package/esm/util/string/strEnsureStartsWith.js +0 -15
- package/esm/util/string/strEnsureStartsWith.js.map +0 -1
- package/esm/util/string/strFirstCharToUpperCase.js +0 -12
- package/esm/util/string/strFirstCharToUpperCase.js.map +0 -1
- package/esm/util/string/strIsLowerCase.js +0 -14
- package/esm/util/string/strIsLowerCase.js.map +0 -1
- package/esm/util/string/strIsUpperCase.js +0 -14
- package/esm/util/string/strIsUpperCase.js.map +0 -1
- package/esm/util/string/strSplitCamelCase.js +0 -51
- package/esm/util/string/strSplitCamelCase.js.map +0 -1
- package/esm/util/string-parsers/createBooleanParser.js +0 -17
- package/esm/util/string-parsers/createBooleanParser.js.map +0 -1
- package/esm/util/string-parsers/createTypedListParser.js +0 -18
- package/esm/util/string-parsers/createTypedListParser.js.map +0 -1
- package/esm/util/string-parsers/parseBoolean.js +0 -12
- package/esm/util/string-parsers/parseBoolean.js.map +0 -1
- package/esm/util/string-parsers/parseInteger.js +0 -13
- package/esm/util/string-parsers/parseInteger.js.map +0 -1
- package/esm/util/string-parsers/parseNumber.js +0 -9
- package/esm/util/string-parsers/parseNumber.js.map +0 -1
- package/esm/util/string-parsers/parseString.js +0 -4
- package/esm/util/string-parsers/parseString.js.map +0 -1
- package/esm/util/types/Any.js +0 -2
- package/esm/util/types/Any.js.map +0 -1
- package/esm/util/types/DeepArray.js +0 -2
- package/esm/util/types/DeepArray.js.map +0 -1
- package/esm/util/types/DeepObject.js +0 -2
- package/esm/util/types/DeepObject.js.map +0 -1
- package/esm/util/types/JsonArray.js +0 -2
- package/esm/util/types/JsonArray.js.map +0 -1
- package/esm/util/types/JsonDefinedPrimitive.js +0 -5
- package/esm/util/types/JsonDefinedPrimitive.js.map +0 -1
- package/esm/util/types/JsonObject.js +0 -2
- package/esm/util/types/JsonObject.js.map +0 -1
- package/esm/util/types/JsonRawPrimitive.js +0 -2
- package/esm/util/types/JsonRawPrimitive.js.map +0 -1
- package/esm/util/types/JsonValue.js +0 -2
- package/esm/util/types/JsonValue.js.map +0 -1
- package/esm/util/types/ObjectKey.js +0 -2
- package/esm/util/types/ObjectKey.js.map +0 -1
- package/esm/util/types/TConstructor.js +0 -2
- package/esm/util/types/TConstructor.js.map +0 -1
- package/esm/util/types/TFunction.js +0 -2
- package/esm/util/types/TFunction.js.map +0 -1
- package/esm/util/types/TFunctionNoNew.js +0 -2
- package/esm/util/types/TFunctionNoNew.js.map +0 -1
- package/esm/util/types/TPlainObject.js +0 -2
- package/esm/util/types/TPlainObject.js.map +0 -1
- package/esm/util/types/TPrimitive.js +0 -2
- package/esm/util/types/TPrimitive.js.map +0 -1
- package/esm/util/types/TStringParser.js +0 -2
- package/esm/util/types/TStringParser.js.map +0 -1
- package/esm/util/types/TValidator.js +0 -2
- package/esm/util/types/TValidator.js.map +0 -1
- package/esm/util/validation/createTypedArrayValidator.js +0 -22
- package/esm/util/validation/createTypedArrayValidator.js.map +0 -1
- package/esm/util/validation/ensureThat.js +0 -8
- package/esm/util/validation/ensureThat.js.map +0 -1
- package/esm/util/validation/isArray.js +0 -2
- package/esm/util/validation/isArray.js.map +0 -1
- package/esm/util/validation/isBoolean.js +0 -4
- package/esm/util/validation/isBoolean.js.map +0 -1
- package/esm/util/validation/isFunction.js +0 -13
- package/esm/util/validation/isFunction.js.map +0 -1
- package/esm/util/validation/isNamedFunction.js +0 -7
- package/esm/util/validation/isNamedFunction.js.map +0 -1
- package/esm/util/validation/isNamedFunctionArray.js +0 -5
- package/esm/util/validation/isNamedFunctionArray.js.map +0 -1
- package/esm/util/validation/isObject.js +0 -18
- package/esm/util/validation/isObject.js.map +0 -1
- package/esm/util/validation/isPlainObject.js +0 -15
- package/esm/util/validation/isPlainObject.js.map +0 -1
- package/esm/util/validation/isPrimitive.js +0 -14
- package/esm/util/validation/isPrimitive.js.map +0 -1
- package/esm/util/validation/isString.js +0 -4
- package/esm/util/validation/isString.js.map +0 -1
- package/esm/util/validation/isStringArray.js +0 -8
- package/esm/util/validation/isStringArray.js.map +0 -1
- package/esm/util/validation/isStringWithNoSpacesOrDashes.js +0 -5
- package/esm/util/validation/isStringWithNoSpacesOrDashes.js.map +0 -1
- package/esm/util/validation/numbers/isInteger.js +0 -14
- package/esm/util/validation/numbers/isInteger.js.map +0 -1
- package/esm/util/validation/numbers/isValidNumber.js +0 -18
- package/esm/util/validation/numbers/isValidNumber.js.map +0 -1
- package/types/_example/bFindIn.d.ts +0 -1
- package/types/cmd/asdas.d.ts +0 -6
- package/types/util/array/arrLast.d.ts +0 -12
- package/types/util/array/arrSome.d.ts +0 -15
- package/types/util/array/types/ArrayPredicate.d.ts +0 -10
- package/types/util/db/JsonDB.d.ts +0 -65
- package/types/util/errors/ErrorParser.d.ts +0 -15
- package/types/util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions.d.ts +0 -15
- package/types/util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync.d.ts +0 -9
- package/types/util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync.d.ts +0 -13
- package/types/util/fs/readFile/readFileSafeSync.d.ts +0 -13
- package/types/util/fs/readFile/readFileSync.d.ts +0 -10
- package/types/util/fs/readJsonFile/readJsonFileSafeSync.d.ts +0 -9
- package/types/util/fs/removeFile/removeFile.d.ts +0 -1
- package/types/util/fs/tempFile/tempFileSync.d.ts +0 -7
- package/types/util/fs/types/IReadJsonFileOptions.d.ts +0 -1
- package/types/util/fs/writeFile/writeFileSafeSync.d.ts +0 -1
- package/types/util/fs/writeFile/writeFileSync.d.ts +0 -1
- package/types/util/fs/writeJsonFile/writeJsonFileSafe.d.ts +0 -1
- package/types/util/function/MethodDisabler.d.ts +0 -43
- package/types/util/function/funSetName.d.ts +0 -13
- package/types/util/node/execInherit.d.ts +0 -1
- package/types/util/node/formatTableForTerminal.d.ts +0 -1
- package/types/util/object/arrAssign.d.ts +0 -1
- package/types/util/object/createArrayMerger.d.ts +0 -4
- package/types/util/object/createObjectMerger.d.ts +0 -5
- package/types/util/object/objAssign.d.ts +0 -1
- package/types/util/object/objUpdatePropertyDescriptors.d.ts +0 -16
- package/types/util/object/realizeLazyProperty.d.ts +0 -1
- package/types/util/object/setNonEnumerable.d.ts +0 -15
- package/types/util/os/defaultOpenInEditorCommand.d.ts +0 -5
- package/types/util/os/isOSX.d.ts +0 -6
- package/types/util/os/isVsCodeInstalled.d.ts +0 -5
- package/types/util/os/isWindows.d.ts +0 -8
- package/types/util/path/getTempDataPath.d.ts +0 -6
- package/types/util/regex/regexEscapeString.d.ts +0 -11
- package/types/util/string/strEnsureStartsWith.d.ts +0 -12
- package/types/util/string/strFirstCharToUpperCase.d.ts +0 -9
- package/types/util/string/strIsLowerCase.d.ts +0 -11
- package/types/util/string/strIsUpperCase.d.ts +0 -11
- package/types/util/string/strSplitCamelCase.d.ts +0 -11
- package/types/util/string-parsers/createBooleanParser.d.ts +0 -7
- package/types/util/string-parsers/createTypedListParser.d.ts +0 -11
- package/types/util/string-parsers/parseBoolean.d.ts +0 -10
- package/types/util/string-parsers/parseInteger.d.ts +0 -1
- package/types/util/string-parsers/parseNumber.d.ts +0 -1
- package/types/util/string-parsers/parseString.d.ts +0 -1
- package/types/util/types/Any.d.ts +0 -1
- package/types/util/types/DeepArray.d.ts +0 -10
- package/types/util/types/DeepObject.d.ts +0 -14
- package/types/util/types/JsonArray.d.ts +0 -6
- package/types/util/types/JsonDefinedPrimitive.d.ts +0 -4
- package/types/util/types/JsonObject.d.ts +0 -6
- package/types/util/types/JsonRawPrimitive.d.ts +0 -5
- package/types/util/types/JsonValue.d.ts +0 -7
- package/types/util/types/ObjectKey.d.ts +0 -1
- package/types/util/types/TConstructor.d.ts +0 -5
- package/types/util/types/TFunction.d.ts +0 -4
- package/types/util/types/TFunctionNoNew.d.ts +0 -2
- package/types/util/types/TPlainObject.d.ts +0 -2
- package/types/util/types/TPrimitive.d.ts +0 -1
- package/types/util/types/TStringParser.d.ts +0 -1
- package/types/util/types/TValidator.d.ts +0 -2
- package/types/util/validation/createTypedArrayValidator.d.ts +0 -9
- package/types/util/validation/ensureThat.d.ts +0 -6
- package/types/util/validation/isArray.d.ts +0 -1
- package/types/util/validation/isBoolean.d.ts +0 -1
- package/types/util/validation/isFunction.d.ts +0 -11
- package/types/util/validation/isNamedFunction.d.ts +0 -5
- package/types/util/validation/isNamedFunctionArray.d.ts +0 -1
- package/types/util/validation/isObject.d.ts +0 -15
- package/types/util/validation/isPlainObject.d.ts +0 -6
- package/types/util/validation/isPrimitive.d.ts +0 -12
- package/types/util/validation/isString.d.ts +0 -1
- package/types/util/validation/isStringArray.d.ts +0 -4
- package/types/util/validation/isStringWithNoSpacesOrDashes.d.ts +0 -1
- package/types/util/validation/numbers/isInteger.d.ts +0 -13
- package/types/util/validation/numbers/isValidNumber.d.ts +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Any } from '
|
|
1
|
+
import type { Any } from '@bemoje/util';
|
|
2
2
|
import { ArgumentBuilder } from '../arg/ArgumentBuilder';
|
|
3
3
|
import { CommandBuilderMetaData } from './CommandBuilderMetaData';
|
|
4
4
|
import { CommandFeatureSelector } from './CommandFeatureSelector';
|
|
@@ -6,8 +6,8 @@ import type { IConfig } from '../types/IConfig';
|
|
|
6
6
|
import type { IPreset, IPresetPartial } from '../types/IPreset';
|
|
7
7
|
import { JsonFile } from '../db/JsonFile';
|
|
8
8
|
import { OptionBuilder } from '../opt/OptionBuilder';
|
|
9
|
-
import { type AddHelpTextPosition, Argument, Command, CommanderError, type CommandUnknownOpts, type ErrorOptions, type HelpConfiguration, type HookEvent, Option, type OptionValues, type OptionValueSource } from '@commander-js/extra-typings';
|
|
10
|
-
import { type JsonValue } from '
|
|
9
|
+
import { type AddHelpTextPosition, Argument, Command, CommanderError, type CommandUnknownOpts, type ErrorOptions, type HelpConfiguration, type HookEvent, Option, type OptionValues, type OptionValueSource, ParseOptions } from '@commander-js/extra-typings';
|
|
10
|
+
import { type JsonValue } from '@bemoje/util';
|
|
11
11
|
/**
|
|
12
12
|
* Wrapper around the @see Command class, for more intuitive construction.
|
|
13
13
|
*/
|
|
@@ -15,7 +15,7 @@ export declare class CommandBuilder<Args extends Any[] = unknown[], Opts extends
|
|
|
15
15
|
static dataDirectory: string;
|
|
16
16
|
protected readonly features: CommandFeatureSelector;
|
|
17
17
|
readonly parent: CommandBuilder | null;
|
|
18
|
-
readonly $: Command
|
|
18
|
+
readonly $: Command;
|
|
19
19
|
readonly meta: CommandBuilderMetaData<Args>;
|
|
20
20
|
get db(): JsonFile;
|
|
21
21
|
constructor(name: string, callback?: (this: CommandBuilder<Args, Opts>, cmd: CommandBuilder<Args, Opts>) => void, parent?: CommandBuilder, isNative?: boolean);
|
|
@@ -128,7 +128,7 @@ export declare class CommandBuilder<Args extends Any[] = unknown[], Opts extends
|
|
|
128
128
|
get isRoot(): boolean;
|
|
129
129
|
get arguments(): readonly Argument<"", undefined, undefined, undefined, undefined>[];
|
|
130
130
|
get options(): readonly Option<"", undefined, undefined, undefined, false, undefined>[];
|
|
131
|
-
get commander(): Command<
|
|
131
|
+
get commander(): Command<[], {}>;
|
|
132
132
|
get hasGrandChildren(): boolean;
|
|
133
133
|
/**
|
|
134
134
|
* Returns whether a command's last argument is variadic.
|
|
@@ -233,6 +233,40 @@ export declare class CommandBuilder<Args extends Any[] = unknown[], Opts extends
|
|
|
233
233
|
protected initializeHelp(): void;
|
|
234
234
|
protected inheritParentHiddenGlobals(): void;
|
|
235
235
|
protected assertCommandNameNotReserved(name: string): void;
|
|
236
|
+
/**
|
|
237
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
238
|
+
*
|
|
239
|
+
* The default expectation is that the arguments are from node and have the application as argv[0]
|
|
240
|
+
* and the script being run in argv[1], with user parameters after that.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```
|
|
244
|
+
* program.parse(process.argv);
|
|
245
|
+
* program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
|
|
246
|
+
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
247
|
+
* ```
|
|
248
|
+
*
|
|
249
|
+
* @returns `this` command for chaining
|
|
250
|
+
*/
|
|
251
|
+
parse(argv?: readonly string[], options?: ParseOptions): this;
|
|
252
|
+
/**
|
|
253
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
254
|
+
*
|
|
255
|
+
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
|
|
256
|
+
*
|
|
257
|
+
* The default expectation is that the arguments are from node and have the application as argv[0]
|
|
258
|
+
* and the script being run in argv[1], with user parameters after that.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```
|
|
262
|
+
* program.parseAsync(process.argv);
|
|
263
|
+
* program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
|
|
264
|
+
* program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* @returns Promise
|
|
268
|
+
*/
|
|
269
|
+
parseAsync(argv?: readonly string[], options?: ParseOptions): Promise<this>;
|
|
236
270
|
}
|
|
237
271
|
export declare const commanderBackRefs: WeakMap<Command<any, any>, CommandBuilder<any, any>>;
|
|
238
272
|
declare module '@commander-js/extra-typings' {
|
|
@@ -240,4 +274,4 @@ declare module '@commander-js/extra-typings' {
|
|
|
240
274
|
get builder(): CommandBuilder;
|
|
241
275
|
}
|
|
242
276
|
}
|
|
243
|
-
export declare function CLI(name: string, cb: (cmd: CommandBuilder) => void):
|
|
277
|
+
export declare function CLI(name: string, cb: (cmd: CommandBuilder) => void): CommandBuilder<unknown[], OptionValues>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Any } from '
|
|
1
|
+
import type { Any } from '@bemoje/util';
|
|
2
2
|
import { CommandBuilder } from './CommandBuilder';
|
|
3
3
|
import { Option } from '@commander-js/extra-typings';
|
|
4
|
-
import type { TStringParser } from '
|
|
5
|
-
import type { TValidator } from '
|
|
4
|
+
import type { TStringParser } from '@bemoje/util';
|
|
5
|
+
import type { TValidator } from '@bemoje/util';
|
|
6
6
|
export declare class CommandBuilderMetaData<Args extends Any[] = unknown[]> {
|
|
7
7
|
subcommands: CommandBuilder[];
|
|
8
8
|
optsMap: Record<string, Option>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import colors from 'ansi-colors';
|
|
2
|
-
import type { Any } from '
|
|
3
|
-
import { MethodDisabler } from '
|
|
2
|
+
import type { Any } from '@bemoje/util';
|
|
3
|
+
import { MethodDisabler } from '@bemoje/util';
|
|
4
4
|
/**
|
|
5
5
|
* The OutputManager class manages the output of debug messages to the console.
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ArgumentBuilder } from '../arg/ArgumentBuilder';
|
|
2
|
-
import type { JsonValue } from '
|
|
2
|
+
import type { JsonValue } from '@bemoje/util';
|
|
3
3
|
import { OptionBuilder } from '../opt/OptionBuilder';
|
|
4
|
-
import type { TStringParser } from '
|
|
4
|
+
import type { TStringParser } from '@bemoje/util';
|
|
5
5
|
export declare abstract class ParserSelector<Builder extends ArgumentBuilder | OptionBuilder> {
|
|
6
6
|
protected readonly builder: Builder;
|
|
7
7
|
constructor(builder: Builder);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ArgumentBuilder } from '../arg/ArgumentBuilder';
|
|
2
|
-
import type { JsonValue } from '
|
|
2
|
+
import type { JsonValue } from '@bemoje/util';
|
|
3
3
|
import { OptionBuilder } from '../opt/OptionBuilder';
|
|
4
|
-
import type { TValidator } from '
|
|
4
|
+
import type { TValidator } from '@bemoje/util';
|
|
5
5
|
export declare abstract class ValidatorSelector<Builder extends OptionBuilder | ArgumentBuilder> {
|
|
6
6
|
protected readonly builder: Builder;
|
|
7
7
|
constructor(builder: Builder);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Any, JsonValue } from '@bemoje/util';
|
|
2
2
|
import { JsonFile } from './JsonFile';
|
|
3
|
-
import type { JsonValue } from '../util/types/JsonValue';
|
|
4
3
|
/**
|
|
5
4
|
* A class that represents a section of the JSON file used as a simple database.
|
|
6
5
|
*/
|
|
@@ -48,7 +47,7 @@ export declare abstract class AbstractJsonFileSection<Val = JsonValue> {
|
|
|
48
47
|
/**
|
|
49
48
|
* The JsonDB associated with the section.
|
|
50
49
|
*/
|
|
51
|
-
get db(): import("
|
|
50
|
+
get db(): import("@bemoje/util").JsonDB;
|
|
52
51
|
/**
|
|
53
52
|
* The CommandBuilder associated with the section.
|
|
54
53
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractJsonFileSection } from './AbstractJsonFileSection';
|
|
2
2
|
import { JsonFile } from './JsonFile';
|
|
3
|
-
import
|
|
3
|
+
import { JsonValue } from '@bemoje/util';
|
|
4
4
|
/**
|
|
5
5
|
* A class that represents the appdata section of the JSON file used as simple database.
|
|
6
6
|
*/
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { AbstractJsonFileSection } from './AbstractJsonFileSection';
|
|
2
|
+
import { JsonValue, TStringParser, TValidator } from '@bemoje/util';
|
|
2
3
|
import type { IConfig } from '../types/IConfig';
|
|
3
4
|
import { JsonFile } from './JsonFile';
|
|
4
|
-
import type { JsonValue } from '../util/types/JsonValue';
|
|
5
|
-
import type { TStringParser } from '../util/types/TStringParser';
|
|
6
|
-
import type { TValidator } from '../util/types/TValidator';
|
|
7
5
|
/**
|
|
8
6
|
* A class that represents the user-config section of the JSON file used as simple database.
|
|
9
7
|
*/
|
package/types/db/JsonFile.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppDataSection } from './AppDataSection';
|
|
2
2
|
import { CommandBuilder } from '../cmd/CommandBuilder';
|
|
3
3
|
import { ConfigSection } from './ConfigSection';
|
|
4
|
-
import { JsonDB } from '
|
|
4
|
+
import { JsonDB } from '@bemoje/util';
|
|
5
5
|
import { PresetsSection } from './PresetsSection';
|
|
6
6
|
/**
|
|
7
7
|
* A class that represents the JSON file used as a simple database.
|
package/types/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './arg/ArgumentBuilder';
|
|
|
2
2
|
export * from './arg/ArgumentParserSelector';
|
|
3
3
|
export * from './arg/ArgumentReader';
|
|
4
4
|
export * from './arg/ArgumentValidatorSelector';
|
|
5
|
-
export * from './cmd/asdas';
|
|
6
5
|
export * from './cmd/CommandBuilder';
|
|
7
6
|
export * from './cmd/CommandBuilderMetaData';
|
|
8
7
|
export * from './cmd/CommandFeatureSelector';
|
|
@@ -23,80 +22,3 @@ export * from './opt/OptionHelpers';
|
|
|
23
22
|
export * from './opt/OptionReader';
|
|
24
23
|
export * from './types/IConfig';
|
|
25
24
|
export * from './types/IPreset';
|
|
26
|
-
export * from './util/array/arrLast';
|
|
27
|
-
export * from './util/array/arrSome';
|
|
28
|
-
export * from './util/array/types/ArrayPredicate';
|
|
29
|
-
export * from './util/db/JsonDB';
|
|
30
|
-
export * from './util/errors/ErrorParser';
|
|
31
|
-
export * from './util/fs/promptUserEditInTextEditor/IGetUserInputFromEditorOptions';
|
|
32
|
-
export * from './util/fs/promptUserEditInTextEditor/promptUserEditInTextEditorSync';
|
|
33
|
-
export * from './util/fs/promptUserEditInTextEditor/promptUserEditJsonInTextEditorSync';
|
|
34
|
-
export * from './util/fs/readFile/readFileSafeSync';
|
|
35
|
-
export * from './util/fs/readFile/readFileSync';
|
|
36
|
-
export * from './util/fs/readJsonFile/readJsonFileSafeSync';
|
|
37
|
-
export * from './util/fs/removeFile/removeFile';
|
|
38
|
-
export * from './util/fs/tempFile/tempFileSync';
|
|
39
|
-
export * from './util/fs/types/IReadJsonFileOptions';
|
|
40
|
-
export * from './util/fs/writeFile/writeFileSafeSync';
|
|
41
|
-
export * from './util/fs/writeFile/writeFileSync';
|
|
42
|
-
export * from './util/fs/writeJsonFile/writeJsonFileSafe';
|
|
43
|
-
export * from './util/function/funSetName';
|
|
44
|
-
export * from './util/function/MethodDisabler';
|
|
45
|
-
export * from './util/node/execInherit';
|
|
46
|
-
export * from './util/node/formatTableForTerminal';
|
|
47
|
-
export * from './util/object/arrAssign';
|
|
48
|
-
export * from './util/object/createArrayMerger';
|
|
49
|
-
export * from './util/object/createObjectMerger';
|
|
50
|
-
export * from './util/object/objAssign';
|
|
51
|
-
export * from './util/object/objUpdatePropertyDescriptors';
|
|
52
|
-
export * from './util/object/realizeLazyProperty';
|
|
53
|
-
export * from './util/object/setNonEnumerable';
|
|
54
|
-
export * from './util/os/defaultOpenInEditorCommand';
|
|
55
|
-
export * from './util/os/isOSX';
|
|
56
|
-
export * from './util/os/isVsCodeInstalled';
|
|
57
|
-
export * from './util/os/isWindows';
|
|
58
|
-
export * from './util/path/getTempDataPath';
|
|
59
|
-
export * from './util/regex/regexEscapeString';
|
|
60
|
-
export * from './util/string/strEnsureStartsWith';
|
|
61
|
-
export * from './util/string/strFirstCharToUpperCase';
|
|
62
|
-
export * from './util/string/strIsLowerCase';
|
|
63
|
-
export * from './util/string/strIsUpperCase';
|
|
64
|
-
export * from './util/string/strSplitCamelCase';
|
|
65
|
-
export * from './util/string-parsers/createBooleanParser';
|
|
66
|
-
export * from './util/string-parsers/createTypedListParser';
|
|
67
|
-
export * from './util/string-parsers/parseBoolean';
|
|
68
|
-
export * from './util/string-parsers/parseInteger';
|
|
69
|
-
export * from './util/string-parsers/parseNumber';
|
|
70
|
-
export * from './util/string-parsers/parseString';
|
|
71
|
-
export * from './util/types/Any';
|
|
72
|
-
export * from './util/types/DeepArray';
|
|
73
|
-
export * from './util/types/DeepObject';
|
|
74
|
-
export * from './util/types/JsonArray';
|
|
75
|
-
export * from './util/types/JsonDefinedPrimitive';
|
|
76
|
-
export * from './util/types/JsonObject';
|
|
77
|
-
export * from './util/types/JsonRawPrimitive';
|
|
78
|
-
export * from './util/types/JsonValue';
|
|
79
|
-
export * from './util/types/ObjectKey';
|
|
80
|
-
export * from './util/types/TConstructor';
|
|
81
|
-
export * from './util/types/TFunction';
|
|
82
|
-
export * from './util/types/TFunctionNoNew';
|
|
83
|
-
export * from './util/types/TPlainObject';
|
|
84
|
-
export * from './util/types/TPrimitive';
|
|
85
|
-
export * from './util/types/TStringParser';
|
|
86
|
-
export * from './util/types/TValidator';
|
|
87
|
-
export * from './util/validation/createTypedArrayValidator';
|
|
88
|
-
export * from './util/validation/ensureThat';
|
|
89
|
-
export * from './util/validation/isArray';
|
|
90
|
-
export * from './util/validation/isBoolean';
|
|
91
|
-
export * from './util/validation/isFunction';
|
|
92
|
-
export * from './util/validation/isNamedFunction';
|
|
93
|
-
export * from './util/validation/isNamedFunctionArray';
|
|
94
|
-
export * from './util/validation/isObject';
|
|
95
|
-
export * from './util/validation/isPlainObject';
|
|
96
|
-
export * from './util/validation/isPrimitive';
|
|
97
|
-
export * from './util/validation/isString';
|
|
98
|
-
export * from './util/validation/isStringArray';
|
|
99
|
-
export * from './util/validation/isStringWithNoSpacesOrDashes';
|
|
100
|
-
export * from './util/validation/numbers/isInteger';
|
|
101
|
-
export * from './util/validation/numbers/isValidNumber';
|
|
102
|
-
export * from './_example/bFindIn';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OptionBuilder } from './OptionBuilder';
|
|
2
2
|
import { ParserSelector } from '../core/ParserSelector';
|
|
3
|
-
import type { TStringParser } from '
|
|
3
|
+
import type { TStringParser } from '@bemoje/util';
|
|
4
4
|
export declare class OptionArgumentParserSelector extends ParserSelector<OptionBuilder> {
|
|
5
5
|
constructor(builder: OptionBuilder);
|
|
6
6
|
custom<T>(parser: TStringParser<T>): OptionBuilder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OptionBuilder } from './OptionBuilder';
|
|
2
|
-
import type { TValidator } from '
|
|
2
|
+
import type { TValidator } from '@bemoje/util';
|
|
3
3
|
import { ValidatorSelector } from '../core/ValidatorSelector';
|
|
4
4
|
export declare class OptionArgumentValidatorSelector extends ValidatorSelector<OptionBuilder> {
|
|
5
5
|
constructor(builder: OptionBuilder);
|
package/types/types/IConfig.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { JsonValue } from '
|
|
2
|
-
import type { TStringParser } from '
|
|
3
|
-
import type { TValidator } from '
|
|
1
|
+
import type { JsonValue } from '@bemoje/util';
|
|
2
|
+
import type { TStringParser } from '@bemoje/util';
|
|
3
|
+
import type { TValidator } from '@bemoje/util';
|
|
4
4
|
export interface IConfig<Val extends JsonValue> {
|
|
5
5
|
/**
|
|
6
6
|
* The default value of the property.
|
package/types/types/IPreset.d.ts
CHANGED
package/cjs/_example/bFindIn.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const CommandBuilder_1 = require("../cmd/CommandBuilder");
|
|
4
|
-
const execInherit_1 = require("../util/node/execInherit");
|
|
5
|
-
const strSplitCamelCase_1 = require("../util/string/strSplitCamelCase");
|
|
6
|
-
console.time('load');
|
|
7
|
-
const cli = new CommandBuilder_1.CommandBuilder('bFindIn', (b) => {
|
|
8
|
-
b.setRecommended();
|
|
9
|
-
b.version('0.0.1');
|
|
10
|
-
b.description([
|
|
11
|
-
"Search for 'PATTERN' inside files in 'DIRPATH'.",
|
|
12
|
-
' Can search inside zip and binary files - and more.',
|
|
13
|
-
'',
|
|
14
|
-
"This is a wrapper for 'ag' which needs to be installed.",
|
|
15
|
-
' https://github.com/JFLarvoire/the_silver_searcher',
|
|
16
|
-
'',
|
|
17
|
-
'Example Usage:',
|
|
18
|
-
` ${b.name} matches keyword ./src`,
|
|
19
|
-
` ${b.name} paths keyword --depth=1`,
|
|
20
|
-
` ${b.name} file keyword readme.md --ignore-case`,
|
|
21
|
-
].join('\n'));
|
|
22
|
-
b.argument('<pattern>', 'search pattern');
|
|
23
|
-
b.argument('[dirpath]', 'dirpath to search');
|
|
24
|
-
// pattern settings
|
|
25
|
-
b.option('-i, --ignore-case', 'Case-insensitive');
|
|
26
|
-
b.option('-s, --case-sensitive', 'Case-sensitive.');
|
|
27
|
-
b.option('-Q, --literal', 'Do not parse PATTERN as a regular expression');
|
|
28
|
-
b.option('-m, --max-count <NUM>', (o) => {
|
|
29
|
-
o.description('Skip the rest of a file after NUM matches.');
|
|
30
|
-
o.parser.integer();
|
|
31
|
-
o.default(10000);
|
|
32
|
-
});
|
|
33
|
-
b.option('-w, --word-regexp', 'Only match whole words');
|
|
34
|
-
b.option('--invert-match', 'Match anything except PATTERN');
|
|
35
|
-
// navigation patterns
|
|
36
|
-
b.option('--ignore <names>', (o) => {
|
|
37
|
-
o.description('Comma-delimited list of dirnames to ignore');
|
|
38
|
-
o.parser.delimitedStrings(',');
|
|
39
|
-
});
|
|
40
|
-
b.option('-U, --skip-vcs-ignores', 'Ignore VCS ignore files (.gitignore, .hgignore; still obey .ignore)');
|
|
41
|
-
// directory selection
|
|
42
|
-
b.option('--depth <n>', (o) => {
|
|
43
|
-
o.description('Max directory depth.');
|
|
44
|
-
o.parser.integer();
|
|
45
|
-
o.default(25);
|
|
46
|
-
});
|
|
47
|
-
b.option('-f, --follow', 'Follow symlinks');
|
|
48
|
-
b.option('--one-device', 'Do not follow links to other devices.');
|
|
49
|
-
b.option('--path-to-ignore <PATH>', 'Filepath to file with paths to ignore.');
|
|
50
|
-
// file selection
|
|
51
|
-
b.option('-u, --unrestricted', 'Search all files (ignore .ignore, .gitignore, etc.; searches binary and hidden files as well).');
|
|
52
|
-
b.option('-z, --search-zip', 'Search contents of compressed (e.g., gzip) files. Note that Windows zip files are not supported.');
|
|
53
|
-
b.option('-a, --all-types', 'Search all files (does not include hidden files or patterns from ignore files)');
|
|
54
|
-
b.option('-t, --all-text', 'Search all text files (does not include hidden files)');
|
|
55
|
-
b.option('--ext <file-extensions>', (o) => {
|
|
56
|
-
o.description('Comma-delimited list of file extensions to include.');
|
|
57
|
-
o.parser.custom((string) => {
|
|
58
|
-
const arr = string
|
|
59
|
-
.split(',')
|
|
60
|
-
.map((s) => s.trim())
|
|
61
|
-
.filter(Boolean);
|
|
62
|
-
if (arr.length === 1)
|
|
63
|
-
return '"\\.' + arr[0] + '$"';
|
|
64
|
-
return '"\\.(' + arr.join('|') + ')$"';
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
// output modes
|
|
68
|
-
b.option('--files-with-matches', 'Only print filenames that contain matches (do not print the matching lines)');
|
|
69
|
-
b.option('--silent', 'Suppress all log messages, including errors');
|
|
70
|
-
b.option('--stats', 'Print stats (files scanned, time taken, etc.)');
|
|
71
|
-
b.option('--stats-only', 'Print stats and nothing else.');
|
|
72
|
-
// context
|
|
73
|
-
b.option('-B, --before <lines>', (o) => {
|
|
74
|
-
o.description('Print lines before match');
|
|
75
|
-
o.default(0);
|
|
76
|
-
o.parser.integer();
|
|
77
|
-
});
|
|
78
|
-
b.option('-A, --after <lines>', (o) => {
|
|
79
|
-
o.description('Print lines after match');
|
|
80
|
-
o.default(0);
|
|
81
|
-
o.parser.integer();
|
|
82
|
-
});
|
|
83
|
-
b.option('--nobreak', 'Disable printing newlines between matches in different files');
|
|
84
|
-
b.option('-W, --width <n>', (o) => {
|
|
85
|
-
o.description('Truncate match lines after n characters.');
|
|
86
|
-
o.parser.integer();
|
|
87
|
-
});
|
|
88
|
-
b.option('--column', 'Print column numbers in results');
|
|
89
|
-
b.option('--nonumbers', 'Print line numbers. Default is to omit line numbers when searching streams');
|
|
90
|
-
b.option('--filename', 'Print file names (Enabled unless searching a single file)');
|
|
91
|
-
b.option('--print-all-files', 'Print headings for all files searched, even those that do not contain matches');
|
|
92
|
-
b.option('-o, --only-matching', 'Prints only the matching part of the lines');
|
|
93
|
-
b.option('--print-long-lines', 'Print matches on very long lines (Default: >2k characters)');
|
|
94
|
-
b.option('-C, --context <lines>', (o) => {
|
|
95
|
-
o.description('Print lines before and after matches');
|
|
96
|
-
o.default(0);
|
|
97
|
-
o.parser.integer();
|
|
98
|
-
});
|
|
99
|
-
b.option('-H, --noheading', "Disable printing file names before each file's matches");
|
|
100
|
-
b.option('-c, --count', 'Only print file match counts. (Not always equal to matching lines count)');
|
|
101
|
-
// misc
|
|
102
|
-
b.option('-g, --filename-pattern <pattern>', 'Print filenames matching PATTERN');
|
|
103
|
-
b.option('-L, --files-without-matches', 'Only print filenames that do not contain matches');
|
|
104
|
-
b.option('--passthrough', 'When searching a stream, print all lines even if they do not match');
|
|
105
|
-
b.option('-0, --print0', "Separate filenames with null (for 'xargs -0')");
|
|
106
|
-
b.option('--ackmate', 'Print results in AckMate-parseable format');
|
|
107
|
-
b.option('--vimgrep', 'Print results like :vimgrep /pattern/g would in vim (reports every line match)');
|
|
108
|
-
// teminal colors
|
|
109
|
-
b.option('--nocolor', 'Disable printing color codes in results');
|
|
110
|
-
b.option('--color-line-number <cc>', (o) => {
|
|
111
|
-
o.description('Color codes for line numbers');
|
|
112
|
-
o.default('1;33');
|
|
113
|
-
});
|
|
114
|
-
b.option('--color-match <cc>', (o) => {
|
|
115
|
-
o.description('Color codes for result match numbers');
|
|
116
|
-
o.default('30;43');
|
|
117
|
-
});
|
|
118
|
-
b.option('--color-path <cc>', (o) => {
|
|
119
|
-
o.description('Color codes for path names');
|
|
120
|
-
o.default('1;32');
|
|
121
|
-
});
|
|
122
|
-
b.option('--color-win-ansi', 'Always use ANSI colors in Windows (except pager/pipe remain ANSI)');
|
|
123
|
-
////////////////
|
|
124
|
-
b.action(async (pattern, dirpath, opts) => {
|
|
125
|
-
const args = [];
|
|
126
|
-
for (const [k, value] of Object.entries(opts)) {
|
|
127
|
-
if (k === 'debug')
|
|
128
|
-
continue;
|
|
129
|
-
let key = (0, strSplitCamelCase_1.strSplitCamelCase)(k)
|
|
130
|
-
.map((s) => s.trim())
|
|
131
|
-
.join('-')
|
|
132
|
-
.toLowerCase();
|
|
133
|
-
if (key === 'ext')
|
|
134
|
-
key = 'file-search-regex';
|
|
135
|
-
if (value == null || value === false) {
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if (b.options.find((o) => o.attributeName() === k)?.defaultValue === value) {
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
if (value === true) {
|
|
142
|
-
args.push(`--${key}`);
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
args.push(`--${key} "${value}"`);
|
|
146
|
-
}
|
|
147
|
-
const cmd = `ag ${args.join(' ')} ${pattern} ${dirpath || ''}`.trim();
|
|
148
|
-
console.log({ pattern, dirpath, opts, cmd });
|
|
149
|
-
await (0, execInherit_1.execInherit)(cmd);
|
|
150
|
-
});
|
|
151
|
-
b.preset('#matches', {
|
|
152
|
-
description: 'Print matches found in each file',
|
|
153
|
-
options: { count: false, numbers: true, column: true, printLongLines: false, onlyMatching: true, width: 100 },
|
|
154
|
-
});
|
|
155
|
-
b.preset('#paths', {
|
|
156
|
-
description: 'Print only paths to files with matches',
|
|
157
|
-
options: { paths: true, maxCount: 1, silent: true },
|
|
158
|
-
});
|
|
159
|
-
b.preset('#bin', {
|
|
160
|
-
description: 'Search everything, including zipped, binary, and hidden files.',
|
|
161
|
-
options: {
|
|
162
|
-
unrestricted: true,
|
|
163
|
-
searchBinary: true,
|
|
164
|
-
searchZip: true,
|
|
165
|
-
hidden: true,
|
|
166
|
-
printLongLines: true,
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
b.preset('#text', {
|
|
170
|
-
description: 'Search all text files.',
|
|
171
|
-
options: {
|
|
172
|
-
allText: true,
|
|
173
|
-
},
|
|
174
|
-
});
|
|
175
|
-
b.preset('#ts', {
|
|
176
|
-
description: 'Search source code in a js/ts repository.',
|
|
177
|
-
args: [null, 'C:/Users/bemoj/repos'],
|
|
178
|
-
options: {
|
|
179
|
-
ext: '\\.(ts|tsx|json|js|jsx|md|css|html|txt)$',
|
|
180
|
-
ignore: 'node_modules',
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
////////////////
|
|
184
|
-
});
|
|
185
|
-
console.timeEnd('load');
|
|
186
|
-
console.time('exec');
|
|
187
|
-
cli.$.parse();
|
|
188
|
-
console.timeEnd('exec');
|
|
189
|
-
//# sourceMappingURL=bFindIn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bFindIn.js","sourceRoot":"","sources":["../../../../../packages/cli/src/_example/bFindIn.ts"],"names":[],"mappings":";;AAAA,0DAAsD;AACtD,0DAAsD;AACtD,wEAAoE;AAEpE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAEpB,MAAM,GAAG,GAAG,IAAI,+BAAc,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;IAC9C,CAAC,CAAC,cAAc,EAAE,CAAA;IAClB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAClB,CAAC,CAAC,WAAW,CACX;QACE,iDAAiD;QACjD,sDAAsD;QACtD,EAAE;QACF,yDAAyD;QACzD,qDAAqD;QACrD,EAAE;QACF,gBAAgB;QAChB,KAAK,CAAC,CAAC,IAAI,wBAAwB;QACnC,KAAK,CAAC,CAAC,IAAI,0BAA0B;QACrC,KAAK,CAAC,CAAC,IAAI,uCAAuC;KACnD,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAA;IAED,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAA;IACzC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAA;IAC5C,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AAC,CAAA;AAEvB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACpB,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;AACb,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA"}
|
package/cjs/cmd/asdas.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// export type MappedTypeWithNewProperties<T> = {
|
|
3
|
-
// [K in keyof T]: T[K]
|
|
4
|
-
// }
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const CommandBuilder_1 = require("./CommandBuilder");
|
|
7
|
-
const args = [() => 1, () => '1', () => true];
|
|
8
|
-
const opts = { a: () => 1, b: () => '1', c: () => true };
|
|
9
|
-
const cli = new CommandBuilder_1.CommandBuilder('test', (c) => {
|
|
10
|
-
c.argument('[int]', (a) => {
|
|
11
|
-
a.parser.integer();
|
|
12
|
-
});
|
|
13
|
-
c.argument('[str]', (a) => {
|
|
14
|
-
a.parser.string();
|
|
15
|
-
});
|
|
16
|
-
c.option('--opt1 <value>', (o) => {
|
|
17
|
-
o.parser.string();
|
|
18
|
-
});
|
|
19
|
-
c.option('--opt1 <value>', (o) => {
|
|
20
|
-
o.parser.integer();
|
|
21
|
-
});
|
|
22
|
-
c.action((int, str, opts) => {
|
|
23
|
-
const parsers = cli.meta.argParsers;
|
|
24
|
-
console.log({ int, str, opts });
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=asdas.js.map
|
package/cjs/cmd/asdas.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asdas.js","sourceRoot":"","sources":["../../../../../packages/cli/src/cmd/asdas.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,yBAAyB;AACzB,IAAI;;AAEJ,qDAAiD;AAUjD,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,G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ast = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Returns the last element of an array.
|
|
6
|
-
* Throws an error if the array is empty.
|
|
7
|
-
* @template T The type of elements in the array.
|
|
8
|
-
* @param array The array to get the last element from.
|
|
9
|
-
* @returns The last element of the array.
|
|
10
|
-
* @throws If the array is empty.
|
|
11
|
-
* @example const numbers = [1, 2, 3, 4, 5];
|
|
12
|
-
* const lastNumber = arrLast(numbers);
|
|
13
|
-
* //=> 5
|
|
14
|
-
*/
|
|
15
|
-
function arrLast(array) {
|
|
16
|
-
if (!array.length)
|
|
17
|
-
throw new Error('Cannot get last element of empty array.');
|
|
18
|
-
return array[array.length - 1];
|
|
19
|
-
}
|
|
20
|
-
exports.arrLast = arrLast;
|
|
21
|
-
//# sourceMappingURL=arrLast.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrLast.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/util/array/arrLast.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,SAAgB,OAAO,CAAI,KAAU;IACnC,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;IAC7E,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAChC,CAAC;AAHD,0BAGC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.arrSome = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Checks if at least one element in the array satisfies the provided predicate.
|
|
6
|
-
* @param predicate The predicate function to apply to each element.
|
|
7
|
-
* @template T The type of elements in the input array.
|
|
8
|
-
* @returns Returns `true` if at least one element in the array passes the test implemented by the provided function, otherwise `false`.
|
|
9
|
-
* @param input The array to check.
|
|
10
|
-
* @example ```ts
|
|
11
|
-
* const numbers = [1, 2, 3, 4, 5];
|
|
12
|
-
* const isEven = (num) => num % 2 === 0;
|
|
13
|
-
* arrSome(numbers, isEven);
|
|
14
|
-
* //=> true
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
function arrSome(input, predicate) {
|
|
18
|
-
for (let i = 0, len = input.length; i < len; i++) {
|
|
19
|
-
if (predicate(input[i], i, input) === true) {
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
exports.arrSome = arrSome;
|
|
26
|
-
//# sourceMappingURL=arrSome.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrSome.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/util/array/arrSome.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;GAYG;AACH,SAAgB,OAAO,CAAI,KAAe,EAAE,SAA4B;IACtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QAChD,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE;YAC1C,OAAO,IAAI,CAAA;SACZ;KACF;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAPD,0BAOC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayPredicate.js","sourceRoot":"","sources":["../../../../../../../packages/cli/src/util/array/types/ArrayPredicate.ts"],"names":[],"mappings":""}
|