zcw-shared 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +512 -512
- package/assets/logo-colorful.svg +18 -18
- package/assets/logo-name.svg +7 -7
- package/assets/logo-transparent.svg +14 -14
- package/assets/logo.svg +8 -8
- package/dist/constants/softwareConfigs.d.ts +14 -0
- package/dist/constants/softwareConfigs.js +156 -0
- package/dist/constants/softwareConfigs.js.map +1 -0
- package/dist/functions/ag-grid/generateLicense.d.ts +3 -0
- package/dist/functions/ag-grid/generateLicense.js +12 -0
- package/dist/functions/ag-grid/generateLicense.js.map +1 -0
- package/dist/functions/altool/createAltoolClient.d.ts +21 -0
- package/dist/functions/altool/createAltoolClient.js +53 -0
- package/dist/functions/altool/createAltoolClient.js.map +1 -0
- package/dist/functions/altool/getAltoolAuth.d.ts +2 -0
- package/dist/functions/altool/getAltoolAuth.js +8 -0
- package/dist/functions/altool/getAltoolAuth.js.map +1 -0
- package/dist/functions/altool/getAppInfo.d.ts +13 -0
- package/dist/functions/altool/getAppInfo.js +39 -0
- package/dist/functions/altool/getAppInfo.js.map +1 -0
- package/dist/functions/altool/index.d.ts +10 -0
- package/dist/functions/altool/index.js +6 -0
- package/dist/functions/altool/index.js.map +1 -0
- package/dist/functions/altool/isApiKeyAuth.d.ts +2 -0
- package/dist/functions/altool/isApiKeyAuth.js +4 -0
- package/dist/functions/altool/isApiKeyAuth.js.map +1 -0
- package/dist/functions/altool/isCredentialsAuth.d.ts +2 -0
- package/dist/functions/altool/isCredentialsAuth.js +4 -0
- package/dist/functions/altool/isCredentialsAuth.js.map +1 -0
- package/dist/functions/altool/parseAppInfoOutput.d.ts +2 -0
- package/dist/functions/altool/parseAppInfoOutput.js +55 -0
- package/dist/functions/altool/parseAppInfoOutput.js.map +1 -0
- package/dist/functions/altool/parseValidationOutput.d.ts +6 -0
- package/dist/functions/altool/parseValidationOutput.js +21 -0
- package/dist/functions/altool/parseValidationOutput.js.map +1 -0
- package/dist/functions/altool/types.d.ts +26 -0
- package/dist/functions/altool/types.js +7 -0
- package/dist/functions/altool/types.js.map +1 -0
- package/dist/functions/altool/uploadApp.d.ts +6 -0
- package/dist/functions/altool/uploadApp.js +36 -0
- package/dist/functions/altool/uploadApp.js.map +1 -0
- package/dist/functions/altool/validateApp.d.ts +17 -0
- package/dist/functions/altool/validateApp.js +40 -0
- package/dist/functions/altool/validateApp.js.map +1 -0
- package/dist/functions/android/buildProject.d.ts +2 -1
- package/dist/functions/android/buildProject.js +32 -6
- package/dist/functions/android/buildProject.js.map +1 -1
- package/dist/functions/android/modifyGradle.js +10 -10
- package/dist/functions/base64/strToBase64.d.ts +2 -0
- package/dist/functions/base64/strToBase64.js +6 -0
- package/dist/functions/base64/strToBase64.js.map +1 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.d.ts +2 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.js +9 -0
- package/dist/functions/color-converter/COLOR_PATTERNS.js.map +1 -0
- package/dist/functions/color-converter/colorPatterns.d.ts +4 -0
- package/dist/functions/color-converter/colorPatterns.js +41 -0
- package/dist/functions/color-converter/colorPatterns.js.map +1 -0
- package/dist/functions/color-converter/convertColor.d.ts +6 -0
- package/dist/functions/color-converter/convertColor.js +12 -0
- package/dist/functions/color-converter/convertColor.js.map +1 -0
- package/dist/functions/color-converter/createColorReference.d.ts +2 -0
- package/dist/functions/color-converter/createColorReference.js +12 -0
- package/dist/functions/color-converter/createColorReference.js.map +1 -0
- package/dist/functions/color-converter/detectColorFormat.d.ts +2 -0
- package/dist/functions/color-converter/detectColorFormat.js +19 -0
- package/dist/functions/color-converter/detectColorFormat.js.map +1 -0
- package/dist/functions/color-converter/extractColors.d.ts +3 -0
- package/dist/functions/color-converter/extractColors.js +16 -0
- package/dist/functions/color-converter/extractColors.js.map +1 -0
- package/dist/functions/color-converter/extractColorsFromLine.d.ts +2 -0
- package/dist/functions/color-converter/extractColorsFromLine.js +18 -0
- package/dist/functions/color-converter/extractColorsFromLine.js.map +1 -0
- package/dist/functions/color-converter/extractColorsGeneric.d.ts +2 -0
- package/dist/functions/color-converter/extractColorsGeneric.js +12 -0
- package/dist/functions/color-converter/extractColorsGeneric.js.map +1 -0
- package/dist/functions/color-converter/extractCssVariableReferences.d.ts +2 -0
- package/dist/functions/color-converter/extractCssVariableReferences.js +15 -0
- package/dist/functions/color-converter/extractCssVariableReferences.js.map +1 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.d.ts +2 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js +15 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js.map +1 -0
- package/dist/functions/color-converter/formatColorOutput.d.ts +5 -0
- package/dist/functions/color-converter/formatColorOutput.js +48 -0
- package/dist/functions/color-converter/formatColorOutput.js.map +1 -0
- package/dist/functions/color-converter/getColorPatterns.d.ts +2 -0
- package/dist/functions/color-converter/getColorPatterns.js +11 -0
- package/dist/functions/color-converter/getColorPatterns.js.map +1 -0
- package/dist/functions/color-converter/getNamedColorMap.d.ts +2 -0
- package/dist/functions/color-converter/getNamedColorMap.js +19 -0
- package/dist/functions/color-converter/getNamedColorMap.js.map +1 -0
- package/dist/functions/color-converter/hexToRgb.d.ts +2 -0
- package/dist/functions/color-converter/hexToRgb.js +42 -0
- package/dist/functions/color-converter/hexToRgb.js.map +1 -0
- package/dist/functions/color-converter/hslToRgb.d.ts +2 -0
- package/dist/functions/color-converter/hslToRgb.js +78 -0
- package/dist/functions/color-converter/hslToRgb.js.map +1 -0
- package/dist/functions/color-converter/hslToRgbInternal.d.ts +2 -0
- package/dist/functions/color-converter/hslToRgbInternal.js +24 -0
- package/dist/functions/color-converter/hslToRgbInternal.js.map +1 -0
- package/dist/functions/color-converter/hueToRgb.d.ts +1 -0
- package/dist/functions/color-converter/hueToRgb.js +14 -0
- package/dist/functions/color-converter/hueToRgb.js.map +1 -0
- package/dist/functions/color-converter/isColorValue.d.ts +2 -0
- package/dist/functions/color-converter/isColorValue.js +79 -0
- package/dist/functions/color-converter/isColorValue.js.map +1 -0
- package/dist/functions/color-converter/isValidColorValue.d.ts +1 -0
- package/dist/functions/color-converter/isValidColorValue.js +4 -0
- package/dist/functions/color-converter/isValidColorValue.js.map +1 -0
- package/dist/functions/color-converter/isValidHslColor.d.ts +2 -0
- package/dist/functions/color-converter/isValidHslColor.js +14 -0
- package/dist/functions/color-converter/isValidHslColor.js.map +1 -0
- package/dist/functions/color-converter/isValidRgbColor.d.ts +2 -0
- package/dist/functions/color-converter/isValidRgbColor.js +14 -0
- package/dist/functions/color-converter/isValidRgbColor.js.map +1 -0
- package/dist/functions/color-converter/normalizeColor.d.ts +1 -0
- package/dist/functions/color-converter/normalizeColor.js +49 -0
- package/dist/functions/color-converter/normalizeColor.js.map +1 -0
- package/dist/functions/color-converter/normalizeColorInput.d.ts +6 -0
- package/dist/functions/color-converter/normalizeColorInput.js +94 -0
- package/dist/functions/color-converter/normalizeColorInput.js.map +1 -0
- package/dist/functions/color-converter/parseColorString.d.ts +12 -0
- package/dist/functions/color-converter/parseColorString.js +89 -0
- package/dist/functions/color-converter/parseColorString.js.map +1 -0
- package/dist/functions/color-converter/parseCssVariables.d.ts +2 -0
- package/dist/functions/color-converter/parseCssVariables.js +19 -0
- package/dist/functions/color-converter/parseCssVariables.js.map +1 -0
- package/dist/functions/color-converter/parseHexColor.d.ts +6 -0
- package/dist/functions/color-converter/parseHexColor.js +42 -0
- package/dist/functions/color-converter/parseHexColor.js.map +1 -0
- package/dist/functions/color-converter/rgbToHex.d.ts +2 -0
- package/dist/functions/color-converter/rgbToHex.js +65 -0
- package/dist/functions/color-converter/rgbToHex.js.map +1 -0
- package/dist/functions/color-converter/rgbToHslInternal.d.ts +2 -0
- package/dist/functions/color-converter/rgbToHslInternal.js +31 -0
- package/dist/functions/color-converter/rgbToHslInternal.js.map +1 -0
- package/dist/functions/color-converter/standardizeColor.d.ts +1 -0
- package/dist/functions/color-converter/standardizeColor.js +147 -0
- package/dist/functions/color-converter/standardizeColor.js.map +1 -0
- package/dist/functions/desensitize/desensitizeName.d.ts +1 -0
- package/dist/functions/desensitize/desensitizeName.js +8 -0
- package/dist/functions/desensitize/desensitizeName.js.map +1 -0
- package/dist/functions/desensitize/desensitizePhone.d.ts +1 -0
- package/dist/functions/desensitize/desensitizePhone.js +8 -0
- package/dist/functions/desensitize/desensitizePhone.js.map +1 -0
- package/dist/functions/dom/getViewportSize.d.ts +5 -0
- package/dist/functions/dom/getViewportSize.js +7 -0
- package/dist/functions/dom/getViewportSize.js.map +1 -0
- package/dist/functions/software/buildPathExecutables.d.ts +1 -0
- package/dist/functions/software/buildPathExecutables.js +14 -0
- package/dist/functions/software/buildPathExecutables.js.map +1 -0
- package/dist/functions/software/buildSoftwarePaths.d.ts +2 -0
- package/dist/functions/software/buildSoftwarePaths.js +22 -0
- package/dist/functions/software/buildSoftwarePaths.js.map +1 -0
- package/dist/functions/software/createConfigGenerator.d.ts +8 -0
- package/dist/functions/software/createConfigGenerator.js +13 -0
- package/dist/functions/software/createConfigGenerator.js.map +1 -0
- package/dist/functions/software/detectPlatform.d.ts +2 -0
- package/dist/functions/software/detectPlatform.js +9 -0
- package/dist/functions/software/detectPlatform.js.map +1 -0
- package/dist/functions/software/find.d.ts +2 -0
- package/dist/functions/software/find.js +12 -0
- package/dist/functions/software/find.js.map +1 -0
- package/dist/functions/software/findSoftware.js.map +1 -1
- package/dist/functions/software/findSoftwareWithGenerator.d.ts +3 -0
- package/dist/functions/software/findSoftwareWithGenerator.js +8 -0
- package/dist/functions/software/findSoftwareWithGenerator.js.map +1 -0
- package/dist/functions/software/getConfigGenerator.d.ts +2 -0
- package/dist/functions/software/getConfigGenerator.js +10 -0
- package/dist/functions/software/getConfigGenerator.js.map +1 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.d.ts +1 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.js +8 -0
- package/dist/functions/software/getEnvironmentSoftwarePath.js.map +1 -0
- package/dist/functions/software/getSupportedSoftware.d.ts +1 -0
- package/dist/functions/software/getSupportedSoftware.js +5 -0
- package/dist/functions/software/getSupportedSoftware.js.map +1 -0
- package/dist/functions/software/parseEnvironmentPaths.d.ts +1 -0
- package/dist/functions/software/parseEnvironmentPaths.js +11 -0
- package/dist/functions/software/parseEnvironmentPaths.js.map +1 -0
- package/dist/functions/software/softwareConfigs.d.ts +2 -0
- package/dist/functions/software/softwareConfigs.js +148 -0
- package/dist/functions/software/softwareConfigs.js.map +1 -0
- package/dist/functions/software/softwareNameMap.d.ts +1 -0
- package/dist/functions/software/softwareNameMap.js +9 -0
- package/dist/functions/software/softwareNameMap.js.map +1 -0
- package/dist/functions/software/types.d.ts +11 -0
- package/dist/functions/software/types.js +2 -0
- package/dist/functions/software/types.js.map +1 -0
- package/dist/functions/string/base64.d.ts +2 -0
- package/dist/functions/string/base64.js +6 -0
- package/dist/functions/string/base64.js.map +1 -0
- package/dist/functions/string/camelCase.d.ts +1 -0
- package/dist/functions/string/camelCase.js +8 -0
- package/dist/functions/string/camelCase.js.map +1 -0
- package/dist/functions/string/capitalize.d.ts +1 -0
- package/dist/functions/string/capitalize.js +6 -0
- package/dist/functions/string/capitalize.js.map +1 -0
- package/dist/functions/string/caseConverter.d.ts +19 -0
- package/dist/functions/string/caseConverter.js +94 -0
- package/dist/functions/string/caseConverter.js.map +1 -0
- package/dist/functions/string/desensitize.d.ts +13 -0
- package/dist/functions/string/desensitize.js +107 -0
- package/dist/functions/string/desensitize.js.map +1 -0
- package/dist/functions/string/escape.d.ts +1 -0
- package/dist/functions/string/escape.js +13 -0
- package/dist/functions/string/escape.js.map +1 -0
- package/dist/functions/string/htmlEscape.d.ts +20 -0
- package/dist/functions/string/htmlEscape.js +80 -0
- package/dist/functions/string/htmlEscape.js.map +1 -0
- package/dist/functions/string/kebabCase.d.ts +1 -0
- package/dist/functions/string/kebabCase.js +10 -0
- package/dist/functions/string/kebabCase.js.map +1 -0
- package/dist/functions/string/levenshtein.d.ts +1 -0
- package/dist/functions/string/levenshtein.js +27 -0
- package/dist/functions/string/levenshtein.js.map +1 -0
- package/dist/functions/string/mask.d.ts +1 -0
- package/dist/functions/string/mask.js +40 -0
- package/dist/functions/string/mask.js.map +1 -0
- package/dist/functions/string/normalize.d.ts +8 -0
- package/dist/functions/string/normalize.js +37 -0
- package/dist/functions/string/normalize.js.map +1 -0
- package/dist/functions/string/pad.d.ts +13 -0
- package/dist/functions/string/pad.js +50 -0
- package/dist/functions/string/pad.js.map +1 -0
- package/dist/functions/string/padEnd.d.ts +1 -0
- package/dist/functions/string/padEnd.js +8 -0
- package/dist/functions/string/padEnd.js.map +1 -0
- package/dist/functions/string/padStart.d.ts +1 -0
- package/dist/functions/string/padStart.js +8 -0
- package/dist/functions/string/padStart.js.map +1 -0
- package/dist/functions/string/palindrome.d.ts +3 -0
- package/dist/functions/string/palindrome.js +15 -0
- package/dist/functions/string/palindrome.js.map +1 -0
- package/dist/functions/string/pascalCase.d.ts +1 -0
- package/dist/functions/string/pascalCase.js +8 -0
- package/dist/functions/string/pascalCase.js.map +1 -0
- package/dist/functions/string/similarity.d.ts +1 -0
- package/dist/functions/string/similarity.js +13 -0
- package/dist/functions/string/similarity.js.map +1 -0
- package/dist/functions/string/snakeCase.d.ts +1 -0
- package/dist/functions/string/snakeCase.js +10 -0
- package/dist/functions/string/snakeCase.js.map +1 -0
- package/dist/functions/string/template.d.ts +4 -0
- package/dist/functions/string/template.js +21 -0
- package/dist/functions/string/template.js.map +1 -0
- package/dist/functions/string/unescape.d.ts +1 -0
- package/dist/functions/string/unescape.js +13 -0
- package/dist/functions/string/unescape.js.map +1 -0
- package/dist/functions/string/wordCount.d.ts +5 -0
- package/dist/functions/string/wordCount.js +11 -0
- package/dist/functions/string/wordCount.js.map +1 -0
- package/dist/functions/tencent-cloud/getSecret.d.ts +6 -0
- package/dist/functions/tencent-cloud/getSecret.js +18 -0
- package/dist/functions/tencent-cloud/getSecret.js.map +1 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.d.ts +13 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js +175 -0
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js.map +1 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +19 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +55 -0
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildAndroidProject.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js +60 -0
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js +51 -0
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js +63 -0
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.d.ts +9 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js +57 -0
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js +34 -0
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js.map +1 -0
- package/dist/functions/uniapp/app-plus/configureStrings.d.ts +5 -0
- package/dist/functions/uniapp/app-plus/configureStrings.js +42 -0
- package/dist/functions/uniapp/app-plus/configureStrings.js.map +1 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.d.ts +8 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.js +25 -0
- package/dist/functions/uniapp/app-plus/copyAppResources.js.map +1 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.js +18 -0
- package/dist/functions/uniapp/app-plus/copyDirectory.js.map +1 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js +35 -0
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js.map +1 -0
- package/dist/functions/uniapp/app-plus/parseManifest.d.ts +14 -0
- package/dist/functions/uniapp/app-plus/parseManifest.js +44 -0
- package/dist/functions/uniapp/app-plus/parseManifest.js.map +1 -0
- package/dist/functions/uniapp/app-plus/validateOptions.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/validateOptions.js +10 -0
- package/dist/functions/uniapp/app-plus/validateOptions.js.map +1 -0
- package/dist/functions/uniapp/waitForPages.d.ts +3 -0
- package/dist/functions/uniapp/waitForPages.js +20 -0
- package/dist/functions/uniapp/waitForPages.js.map +1 -0
- package/dist/functions/utils/compose.d.ts +1 -0
- package/dist/functions/utils/compose.js +10 -0
- package/dist/functions/utils/compose.js.map +1 -0
- package/dist/functions/utils/cond.d.ts +1 -0
- package/dist/functions/utils/cond.js +15 -0
- package/dist/functions/utils/cond.js.map +1 -0
- package/dist/functions/utils/curry.d.ts +1 -0
- package/dist/functions/utils/curry.js +13 -0
- package/dist/functions/utils/curry.js.map +1 -0
- package/dist/functions/utils/debounce.d.ts +1 -0
- package/dist/functions/utils/debounce.js +13 -0
- package/dist/functions/utils/debounce.js.map +1 -0
- package/dist/functions/utils/evolve.d.ts +3 -0
- package/dist/functions/utils/evolve.js +15 -0
- package/dist/functions/utils/evolve.js.map +1 -0
- package/dist/functions/utils/flow.d.ts +1 -0
- package/dist/functions/utils/flow.js +14 -0
- package/dist/functions/utils/flow.js.map +1 -0
- package/dist/functions/utils/generateExports.js +1 -1
- package/dist/functions/utils/generateExports.js.map +1 -1
- package/dist/functions/utils/isType.d.ts +11 -0
- package/dist/functions/utils/isType.js +30 -0
- package/dist/functions/utils/isType.js.map +1 -0
- package/dist/functions/utils/memoize.d.ts +1 -0
- package/dist/functions/utils/memoize.js +13 -0
- package/dist/functions/utils/memoize.js.map +1 -0
- package/dist/functions/utils/once.d.ts +1 -0
- package/dist/functions/utils/once.js +13 -0
- package/dist/functions/utils/once.js.map +1 -0
- package/dist/functions/utils/partial.d.ts +1 -0
- package/dist/functions/utils/partial.js +13 -0
- package/dist/functions/utils/partial.js.map +1 -0
- package/dist/functions/utils/pipe.d.ts +1 -0
- package/dist/functions/utils/pipe.js +10 -0
- package/dist/functions/utils/pipe.js.map +1 -0
- package/dist/functions/utils/retryWithBackoff.d.ts +9 -0
- package/dist/functions/utils/retryWithBackoff.js +30 -0
- package/dist/functions/utils/retryWithBackoff.js.map +1 -0
- package/dist/functions/utils/tap.d.ts +1 -0
- package/dist/functions/utils/tap.js +14 -0
- package/dist/functions/utils/tap.js.map +1 -0
- package/dist/functions/utils/throttle.d.ts +1 -0
- package/dist/functions/utils/throttle.js +11 -0
- package/dist/functions/utils/throttle.js.map +1 -0
- package/dist/functions/utils/until.d.ts +1 -0
- package/dist/functions/utils/until.js +10 -0
- package/dist/functions/utils/until.js.map +1 -0
- package/dist/functions/utils/validate.d.ts +8 -0
- package/dist/functions/utils/validate.js +45 -0
- package/dist/functions/utils/validate.js.map +1 -0
- package/dist/functions/utils/walk.d.ts +11 -0
- package/dist/functions/utils/walk.js +27 -0
- package/dist/functions/utils/walk.js.map +1 -0
- package/dist/functions/vue/checkVueType.d.ts +8 -0
- package/dist/functions/vue/checkVueType.js +29 -0
- package/dist/functions/vue/checkVueType.js.map +1 -0
- package/dist/functions/vue/deduplicateColors.d.ts +2 -0
- package/dist/functions/vue/deduplicateColors.js +13 -0
- package/dist/functions/vue/deduplicateColors.js.map +1 -0
- package/dist/functions/vue/dynamicMount.d.ts +15 -0
- package/dist/functions/vue/dynamicMount.js +25 -0
- package/dist/functions/vue/dynamicMount.js.map +1 -0
- package/dist/functions/vue/filterSections.js +11 -0
- package/dist/functions/vue/filterSections.js.map +1 -0
- package/dist/functions/vue/isVNode.d.ts +2 -0
- package/dist/functions/vue/isVNode.js +6 -0
- package/dist/functions/vue/isVNode.js.map +1 -0
- package/dist/functions/vue/isVueComponent.d.ts +2 -0
- package/dist/functions/vue/isVueComponent.js +6 -0
- package/dist/functions/vue/isVueComponent.js.map +1 -0
- package/dist/functions/vue/parseVueFile.js +53 -0
- package/dist/functions/vue/parseVueFile.js.map +1 -0
- package/dist/functions/vue/processVueFile.d.ts +3 -0
- package/dist/functions/vue/processVueFile.js +26 -0
- package/dist/functions/vue/processVueFile.js.map +1 -0
- package/dist/functions/vue/saveVueSection.d.ts +2 -0
- package/dist/functions/vue/saveVueSection.js +11 -0
- package/dist/functions/vue/saveVueSection.js.map +1 -0
- package/dist/functions/wechat/miniapp/downloadFile.d.ts +2 -0
- package/dist/functions/wechat/miniapp/downloadFile.js +39 -0
- package/dist/functions/wechat/miniapp/downloadFile.js.map +1 -0
- package/dist/hooks/useAi.d.ts +27 -0
- package/dist/hooks/useAi.js +163 -0
- package/dist/hooks/useAi.js.map +1 -0
- package/dist/hooks/useCache.d.ts +18 -0
- package/dist/hooks/useCache.js +82 -0
- package/dist/hooks/useCache.js.map +1 -0
- package/dist/hooks/useFetch.d.ts +3 -0
- package/dist/hooks/useFetch.js +154 -0
- package/dist/hooks/useFetch.js.map +1 -0
- package/dist/hooks/usePluginSystem.d.ts +11 -0
- package/dist/hooks/usePluginSystem.js +34 -0
- package/dist/hooks/usePluginSystem.js.map +1 -0
- package/dist/hooks/useRequest.d.ts +3 -0
- package/dist/hooks/useRequest.js +139 -0
- package/dist/hooks/useRequest.js.map +1 -0
- package/dist/hooks/useStorageWithIndexedDB.d.ts +2 -1
- package/dist/hooks/useStorageWithIndexedDB.js +1 -1
- package/dist/hooks/useStorageWithIndexedDB.js.map +1 -1
- package/dist/hooks/useWASM.d.ts +4 -0
- package/dist/hooks/useWASM.js +263 -0
- package/dist/hooks/useWASM.js.map +1 -0
- package/dist/hooks/useWorkerFunction.js +27 -27
- package/package.json +1 -1
- package/references/arraybuffer.d.ts +108 -108
- package/references/blob.d.ts +36 -36
- package/references/browser.d.ts +69 -69
- package/references/chrome.extension.d.ts +82 -82
- package/references/console.d.ts +24 -24
- package/references/crypto-js.d.ts +57 -57
- package/references/dom.d.ts +40 -40
- package/references/encoding.d.ts +23 -23
- package/references/fetch.d.ts +123 -123
- package/references/indexeddb.d.ts +48 -48
- package/references/json5.d.ts +21 -21
- package/references/location.d.ts +15 -15
- package/references/node.d.ts +121 -115
- package/references/sharp.d.ts +18 -18
- package/references/storage.d.ts +17 -17
- package/references/timer.d.ts +44 -44
- package/references/uniapp.d.ts +50 -50
- package/references/url.d.ts +55 -55
- package/references/vue.d.ts +85 -85
- package/references/webassembly.d.ts +100 -100
- package/references/wechat.d.ts +48 -48
- package/references/worker.d.ts +152 -152
- package/references/xml.d.ts +87 -88
- package/types/android-build.d.ts +60 -60
- package/types/color.d.ts +72 -72
- package/types/geometry.d.ts +28 -28
- package/types/platform.d.ts +3 -3
- package/types/software.d.ts +14 -14
- package/types/storage.d.ts +50 -50
- package/types/uniapp-android-build.d.ts +48 -48
- package/types/vue.d.ts +29 -29
- package/types/worker.d.ts +177 -177
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SUPPORTED_PLATFORMS } from '../../constants/softwareConfigs';
|
|
2
|
+
export function detectPlatform(processObj) {
|
|
3
|
+
const platform = processObj.platform;
|
|
4
|
+
if (!SUPPORTED_PLATFORMS.includes(platform)) {
|
|
5
|
+
throw new Error(`不支持的平台: ${platform}。支持的平台: ${SUPPORTED_PLATFORMS.join(', ')}`);
|
|
6
|
+
}
|
|
7
|
+
return platform;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=detectPlatform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectPlatform.js","sourceRoot":"","sources":["../../../src/functions/software/detectPlatform.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AAsBrE,MAAM,UAAU,cAAc,CAAC,UAAuB;IACpD,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAA;IAGpC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,QAAoB,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,WAAW,QAAQ,WAAW,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjF,CAAC;IAED,OAAO,QAAoB,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getConfigGenerator } from './getConfigGenerator';
|
|
2
|
+
import { findSoftwareWithGenerator } from './findSoftwareWithGenerator';
|
|
3
|
+
import { SOFTWARE_NAME_MAP } from './softwareNameMap';
|
|
4
|
+
export function find(softwareName, systemInfo) {
|
|
5
|
+
const actualName = SOFTWARE_NAME_MAP[softwareName.toLowerCase()];
|
|
6
|
+
if (!actualName) {
|
|
7
|
+
throw new Error(`不支持的软件: ${softwareName}。支持的软件: ${Object.keys(SOFTWARE_NAME_MAP).join(', ')}`);
|
|
8
|
+
}
|
|
9
|
+
const generator = getConfigGenerator(actualName);
|
|
10
|
+
return findSoftwareWithGenerator(generator, systemInfo);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sourceRoot":"","sources":["../../../src/functions/software/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAQrD,MAAM,UAAU,IAAI,CAAC,YAAoB,EAAE,UAAsB;IAC/D,MAAM,UAAU,GAAG,iBAAiB,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAA;IAEhE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,WAAW,YAAY,WAAW,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChG,CAAC;IAED,MAAM,SAAS,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAA;IAChD,OAAO,yBAAyB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;AACzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findSoftware.js","sourceRoot":"","sources":["../../../src/functions/software/findSoftware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"findSoftware.js","sourceRoot":"","sources":["../../../src/functions/software/findSoftware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAyCrF,MAAM,UAAU,kBAAkB,CAChC,YAAoB,EACpB,UAAsB;IAGtB,MAAM,cAAc,GAAG,iBAAiB,CAAC,YAAY,CAAC,IAAI,YAAY,CAAA;IACtE,MAAM,MAAM,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAA;IAE/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,QAAoB,CAAA;IACxD,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IAGvC,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;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AC,YAAY,CAAC,CAAA;IAC7B,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;QAChC,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;QAC/E,IAAI,UAAU,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,CAAA;QAC9C,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SoftwareConfig, Platform } from '../../../types/software.d';
|
|
2
|
+
import type { SystemInfo, SoftwareSearchResult } from './findSoftware';
|
|
3
|
+
export declare function findSoftwareWithGenerator(softwareConfigGenerator: (platform: Platform) => SoftwareConfig, systemInfo: SystemInfo): SoftwareSearchResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { detectPlatform } from './detectPlatform';
|
|
2
|
+
import { findSoftware } from './findSoftware';
|
|
3
|
+
export function findSoftwareWithGenerator(softwareConfigGenerator, systemInfo) {
|
|
4
|
+
const platform = detectPlatform(systemInfo.process);
|
|
5
|
+
const config = softwareConfigGenerator(platform);
|
|
6
|
+
return findSoftware(config, systemInfo);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=findSoftwareWithGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findSoftwareWithGenerator.js","sourceRoot":"","sources":["../../../src/functions/software/findSoftwareWithGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAS7C,MAAM,UAAU,yBAAyB,CACvC,uBAA+D,EAC/D,UAAsB;IAGtB,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAGnD,MAAM,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAA;IAGhD,OAAO,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createConfigGenerator } from './createConfigGenerator';
|
|
2
|
+
import { SOFTWARE_CONFIGS } from './softwareConfigs';
|
|
3
|
+
export function getConfigGenerator(softwareName) {
|
|
4
|
+
const definition = SOFTWARE_CONFIGS[softwareName];
|
|
5
|
+
if (!definition) {
|
|
6
|
+
throw new Error(`Unknown software: ${softwareName}`);
|
|
7
|
+
}
|
|
8
|
+
return createConfigGenerator(definition);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=getConfigGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getConfigGenerator.js","sourceRoot":"","sources":["../../../src/functions/software/getConfigGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAOpD,MAAM,UAAU,kBAAkB,CAAC,YAAoB;IACrD,MAAM,UAAU,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAA;IACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,qBAAqB,YAAY,EAAE,CAAC,CAAA;IACtD,CAAC;IACD,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAA;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getEnvironmentSoftwarePath(envVar: string, env: Record<string, string | undefined>): string | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function getEnvironmentSoftwarePath(envVar, env) {
|
|
2
|
+
if (!envVar || typeof envVar !== 'string') {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
const value = env[envVar];
|
|
6
|
+
return (value && typeof value === 'string' && value.trim() !== '') ? value.trim() : null;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=getEnvironmentSoftwarePath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEnvironmentSoftwarePath.js","sourceRoot":"","sources":["../../../src/functions/software/getEnvironmentSoftwarePath.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,0BAA0B,CAAC,MAAc,EAAE,GAAuC;IAEhG,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AAC1F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getSupportedSoftware(): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSupportedSoftware.js","sourceRoot":"","sources":["../../../src/functions/software/getSupportedSoftware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAMrD,MAAM,UAAU,oBAAoB;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseEnvironmentPaths(pathEnv: string, platform?: string): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function parseEnvironmentPaths(pathEnv, platform) {
|
|
2
|
+
if (!pathEnv || typeof pathEnv !== 'string') {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
const separator = platform === 'win32' || (!platform && pathEnv.includes(';')) ? ';' : ':';
|
|
6
|
+
return pathEnv
|
|
7
|
+
.split(separator)
|
|
8
|
+
.map(path => path.trim())
|
|
9
|
+
.filter(path => path !== '');
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=parseEnvironmentPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseEnvironmentPaths.js","sourceRoot":"","sources":["../../../src/functions/software/parseEnvironmentPaths.ts"],"names":[],"mappings":"AAyBA,MAAM,UAAU,qBAAqB,CAAC,OAAe,EAAE,QAAiB;IAEtE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,EAAE,CAAA;IACX,CAAC;IAGD,MAAM,SAAS,GAAG,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAA;IAE1F,OAAO,OAAO;SACX,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SACxB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export const SOFTWARE_CONFIGS = {
|
|
2
|
+
git: {
|
|
3
|
+
win32: {
|
|
4
|
+
executable: 'git.exe',
|
|
5
|
+
possiblePaths: [
|
|
6
|
+
'C:\\Program Files\\Git\\bin',
|
|
7
|
+
'C:\\Program Files (x86)\\Git\\bin'
|
|
8
|
+
],
|
|
9
|
+
userPaths: ['AppData\\Local\\Programs\\Git\\bin'],
|
|
10
|
+
registryKey: 'HKEY_LOCAL_MACHINE\\SOFTWARE\\GitForWindows'
|
|
11
|
+
},
|
|
12
|
+
darwin: {
|
|
13
|
+
executable: 'git',
|
|
14
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin', '/opt/homebrew/bin'],
|
|
15
|
+
userPaths: ['~/.local/bin']
|
|
16
|
+
},
|
|
17
|
+
linux: {
|
|
18
|
+
executable: 'git',
|
|
19
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin'],
|
|
20
|
+
userPaths: ['~/.local/bin']
|
|
21
|
+
},
|
|
22
|
+
envVar: 'GIT_PATH'
|
|
23
|
+
},
|
|
24
|
+
chrome: {
|
|
25
|
+
win32: {
|
|
26
|
+
executable: 'chrome.exe',
|
|
27
|
+
possiblePaths: [
|
|
28
|
+
'C:\\Program Files\\Google\\Chrome\\Application',
|
|
29
|
+
'C:\\Program Files (x86)\\Google\\Chrome\\Application'
|
|
30
|
+
],
|
|
31
|
+
userPaths: ['AppData\\Local\\Google\\Chrome\\Application'],
|
|
32
|
+
registryKey: 'HKEY_CURRENT_USER\\Software\\Google\\Chrome'
|
|
33
|
+
},
|
|
34
|
+
darwin: {
|
|
35
|
+
executable: 'Google Chrome',
|
|
36
|
+
possiblePaths: ['/Applications/Google Chrome.app/Contents/MacOS'],
|
|
37
|
+
userPaths: ['~/Applications/Google Chrome.app/Contents/MacOS']
|
|
38
|
+
},
|
|
39
|
+
linux: {
|
|
40
|
+
executable: 'google-chrome',
|
|
41
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin', '/opt/google/chrome'],
|
|
42
|
+
userPaths: ['~/.local/bin']
|
|
43
|
+
},
|
|
44
|
+
envVar: 'CHROME_PATH'
|
|
45
|
+
},
|
|
46
|
+
nodejs: {
|
|
47
|
+
win32: {
|
|
48
|
+
executable: 'node.exe',
|
|
49
|
+
possiblePaths: [
|
|
50
|
+
'C:\\Program Files\\nodejs',
|
|
51
|
+
'C:\\Program Files (x86)\\nodejs'
|
|
52
|
+
],
|
|
53
|
+
userPaths: ['AppData\\Roaming\\npm'],
|
|
54
|
+
registryKey: 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Node.js'
|
|
55
|
+
},
|
|
56
|
+
darwin: {
|
|
57
|
+
executable: 'node',
|
|
58
|
+
possiblePaths: ['/usr/local/bin', '/opt/homebrew/bin', '/usr/bin'],
|
|
59
|
+
userPaths: ['~/.local/bin']
|
|
60
|
+
},
|
|
61
|
+
linux: {
|
|
62
|
+
executable: 'node',
|
|
63
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin'],
|
|
64
|
+
userPaths: ['~/.local/bin']
|
|
65
|
+
},
|
|
66
|
+
envVar: 'NODE_PATH'
|
|
67
|
+
},
|
|
68
|
+
wechat: {
|
|
69
|
+
win32: {
|
|
70
|
+
executable: 'cli.bat',
|
|
71
|
+
possiblePaths: [
|
|
72
|
+
'C:\\Program Files (x86)\\Tencent\\微信web开发者工具',
|
|
73
|
+
'C:\\Program Files\\Tencent\\微信web开发者工具'
|
|
74
|
+
],
|
|
75
|
+
userPaths: [
|
|
76
|
+
'AppData\\Local\\微信web开发者工具',
|
|
77
|
+
'AppData\\Roaming\\微信web开发者工具'
|
|
78
|
+
],
|
|
79
|
+
registryKey: 'HKEY_CURRENT_USER\\Software\\Tencent\\微信web开发者工具'
|
|
80
|
+
},
|
|
81
|
+
darwin: {
|
|
82
|
+
executable: 'cli',
|
|
83
|
+
possiblePaths: [
|
|
84
|
+
'/Applications/wechatwebdevtools.app/Contents/MacOS',
|
|
85
|
+
'/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin'
|
|
86
|
+
],
|
|
87
|
+
userPaths: [
|
|
88
|
+
'/Applications/wechatwebdevtools.app/Contents/MacOS',
|
|
89
|
+
'/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin'
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
linux: {
|
|
93
|
+
executable: 'cli',
|
|
94
|
+
possiblePaths: ['/usr/local/bin', '/usr/bin'],
|
|
95
|
+
userPaths: ['.local/bin']
|
|
96
|
+
},
|
|
97
|
+
envVar: 'WECHAT_DEV_TOOLS_PATH'
|
|
98
|
+
},
|
|
99
|
+
hbuilderx: {
|
|
100
|
+
win32: {
|
|
101
|
+
executable: 'HBuilderX.exe',
|
|
102
|
+
possiblePaths: [
|
|
103
|
+
'C:\\Program Files\\HBuilderX',
|
|
104
|
+
'C:\\Program Files (x86)\\HBuilderX'
|
|
105
|
+
],
|
|
106
|
+
userPaths: [
|
|
107
|
+
'AppData\\Local\\HBuilderX',
|
|
108
|
+
'AppData\\Roaming\\HBuilderX'
|
|
109
|
+
],
|
|
110
|
+
registryKey: 'HKEY_CURRENT_USER\\Software\\DCloud\\HBuilderX'
|
|
111
|
+
},
|
|
112
|
+
darwin: {
|
|
113
|
+
executable: 'HBuilderX',
|
|
114
|
+
possiblePaths: ['/Applications/HBuilderX.app/Contents/MacOS'],
|
|
115
|
+
userPaths: ['~/Applications/HBuilderX.app/Contents/MacOS']
|
|
116
|
+
},
|
|
117
|
+
linux: {
|
|
118
|
+
executable: 'HBuilderX',
|
|
119
|
+
possiblePaths: ['/opt/HBuilderX', '/usr/local/HBuilderX'],
|
|
120
|
+
userPaths: ['~/.local/share/HBuilderX', '~/HBuilderX']
|
|
121
|
+
},
|
|
122
|
+
envVar: 'HBUILDERX_PATH'
|
|
123
|
+
},
|
|
124
|
+
altool: {
|
|
125
|
+
win32: {
|
|
126
|
+
executable: 'altool.exe',
|
|
127
|
+
possiblePaths: [],
|
|
128
|
+
userPaths: []
|
|
129
|
+
},
|
|
130
|
+
darwin: {
|
|
131
|
+
executable: 'altool',
|
|
132
|
+
possiblePaths: [
|
|
133
|
+
'/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support',
|
|
134
|
+
'/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin',
|
|
135
|
+
'/Applications/Xcode.app/Contents/Developer/usr/bin',
|
|
136
|
+
'/usr/local/bin'
|
|
137
|
+
],
|
|
138
|
+
userPaths: ['~/Applications/Xcode.app/Contents/Developer/usr/bin']
|
|
139
|
+
},
|
|
140
|
+
linux: {
|
|
141
|
+
executable: 'altool',
|
|
142
|
+
possiblePaths: [],
|
|
143
|
+
userPaths: []
|
|
144
|
+
},
|
|
145
|
+
envVar: 'ALTOOL_PATH'
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=softwareConfigs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softwareConfigs.js","sourceRoot":"","sources":["../../../src/functions/software/softwareConfigs.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,gBAAgB,GAA6C;IACxE,GAAG,EAAE;QACH,KAAK,EAAE;YACL,UAAU,EAAE,SAAS;YACrB,aAAa,EAAE;gBACb,6BAA6B;gBAC7B,mCAAmC;aACpC;YACD,SAAS,EAAE,CAAC,oCAAoC,CAAC;YACjD,WAAW,EAAE,6CAA6C;SAC3D;QACD,MAAM,EAAE;YACN,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;YAClE,SAAS,EAAE,CAAC,cAAc,CAAC;SAC5B;QACD,KAAK,EAAE;YACL,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC;YAC7C,SAAS,EAAE,CAAC,cAAc,CAAC;SAC5B;QACD,MAAM,EAAE,UAAU;KACnB;IAED,MAAM,EAAE;QACN,KAAK,EAAE;YACL,UAAU,EAAE,YAAY;YACxB,aAAa,EAAE;gBACb,gDAAgD;gBAChD,sDAAsD;aACvD;YACD,SAAS,EAAE,CAAC,6CAA6C,CAAC;YAC1D,WAAW,EAAE,6CAA6C;SAC3D;QACD,MAAM,EAAE;YACN,UAAU,EAAE,eAAe;YAC3B,aAAa,EAAE,CAAC,gDAAgD,CAAC;YACjE,SAAS,EAAE,CAAC,iDAAiD,CAAC;SAC/D;QACD,KAAK,EAAE;YACL,UAAU,EAAE,eAA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8BAA8B;gBAC9B,oCAAoC;aACrC;YACD,SAAS,EAAE;gBACT,2BAA2B;gBAC3B,6BAA6B;aAC9B;YACD,WAAW,EAAE,gDAAgD;SAC9D;QACD,MAAM,EAAE;YACN,UAAU,EAAE,WAAW;YACvB,aAAa,EAAE,CAAC,4CAA4C,CAAC;YAC7D,SAAS,EAAE,CAAC,6CAA6C,CAAC;SAC3D;QACD,KAAK,EAAE;YACL,UAAU,EAAE,WAAW;YACvB,aAAa,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;YACzD,SAAS,EAAE,CAAC,0BAA0B,EAAE,aAAa,CAAC;SACvD;QACD,MAAM,EAAE,gBAAgB;KACzB;IAED,MAAM,EAAE;QACN,KAAK,EAAE;YACL,UAAU,EAAE,YAAY;YACxB,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,EAAE;SACd;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ;YACpB,aAAa,EAAE;gBACb,6IAA6I;gBAC7I,wFAAwF;gBACxF,oDAAoD;gBACpD,gBAAgB;aACjB;YACD,SAAS,EAAE,CAAC,qDAAqD,CAAC;SACnE;QACD,KAAK,EAAE;YACL,UAAU,EAAE,QAAQ;YACpB,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,EAAE;SACd;QACD,MAAM,EAAE,aAAa;KACtB;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SOFTWARE_NAME_MAP: Record<string, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softwareNameMap.js","sourceRoot":"","sources":["../../../src/functions/software/softwareNameMap.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,QAAQ;CACf,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SoftwareConfig {
|
|
2
|
+
executable: string;
|
|
3
|
+
possiblePaths: string[];
|
|
4
|
+
userPaths?: string[];
|
|
5
|
+
registryKey?: string;
|
|
6
|
+
envVar: string;
|
|
7
|
+
}
|
|
8
|
+
export type Platform = 'win32' | 'darwin' | 'linux';
|
|
9
|
+
export interface ProcessLike {
|
|
10
|
+
platform: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/functions/software/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../src/functions/string/base64.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,aAA4B;IACnE,OAAO,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;QACzF,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function camelCase(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camelCase.js","sourceRoot":"","sources":["../../../src/functions/string/camelCase.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAA;IAEpB,OAAO,GAAG;SACP,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrE,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function capitalize(str: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capitalize.js","sourceRoot":"","sources":["../../../src/functions/string/capitalize.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAA;IAEpB,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type CaseType = 'camel' | 'pascal' | 'kebab' | 'snake' | 'constant' | 'dot' | 'path' | 'sentence' | 'title';
|
|
2
|
+
export interface CaseOptions {
|
|
3
|
+
targetCase?: CaseType;
|
|
4
|
+
preserveConsecutiveUppercase?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface CaseResult {
|
|
7
|
+
original: string;
|
|
8
|
+
camelCase: string;
|
|
9
|
+
pascalCase: string;
|
|
10
|
+
kebabCase: string;
|
|
11
|
+
snakeCase: string;
|
|
12
|
+
constantCase: string;
|
|
13
|
+
dotCase: string;
|
|
14
|
+
pathCase: string;
|
|
15
|
+
sentenceCase: string;
|
|
16
|
+
titleCase: string;
|
|
17
|
+
detectedCase: CaseType | 'mixed';
|
|
18
|
+
}
|
|
19
|
+
export declare function caseConverter(str: string, options?: CaseOptions, returnDetails?: boolean): string | CaseResult;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { capitalize } from './capitalize';
|
|
2
|
+
export function caseConverter(str, options = {}, returnDetails = false) {
|
|
3
|
+
const { targetCase = 'camel', preserveConsecutiveUppercase = false } = options;
|
|
4
|
+
if (!str) {
|
|
5
|
+
const emptyResult = {
|
|
6
|
+
original: str,
|
|
7
|
+
camelCase: str,
|
|
8
|
+
pascalCase: str,
|
|
9
|
+
kebabCase: str,
|
|
10
|
+
snakeCase: str,
|
|
11
|
+
constantCase: str,
|
|
12
|
+
dotCase: str,
|
|
13
|
+
pathCase: str,
|
|
14
|
+
sentenceCase: str,
|
|
15
|
+
titleCase: str,
|
|
16
|
+
detectedCase: 'mixed'
|
|
17
|
+
};
|
|
18
|
+
return returnDetails ? emptyResult : str;
|
|
19
|
+
}
|
|
20
|
+
const detectedCase = detectCase(str);
|
|
21
|
+
const words = splitIntoWords(str, preserveConsecutiveUppercase);
|
|
22
|
+
const camelCase = words.map((word, index) => index === 0 ? word.toLowerCase() : capitalize(word.toLowerCase())).join('');
|
|
23
|
+
const pascalCase = words.map(word => capitalize(word.toLowerCase())).join('');
|
|
24
|
+
const kebabCase = words.map(word => word.toLowerCase()).join('-');
|
|
25
|
+
const snakeCase = words.map(word => word.toLowerCase()).join('_');
|
|
26
|
+
const constantCase = words.map(word => word.toUpperCase()).join('_');
|
|
27
|
+
const dotCase = words.map(word => word.toLowerCase()).join('.');
|
|
28
|
+
const pathCase = words.map(word => word.toLowerCase()).join('/');
|
|
29
|
+
const sentenceCase = words.map((word, index) => index === 0 ? capitalize(word.toLowerCase()) : word.toLowerCase()).join(' ');
|
|
30
|
+
const titleCase = words.map(word => capitalize(word.toLowerCase())).join(' ');
|
|
31
|
+
const result = {
|
|
32
|
+
original: str,
|
|
33
|
+
camelCase,
|
|
34
|
+
pascalCase,
|
|
35
|
+
kebabCase,
|
|
36
|
+
snakeCase,
|
|
37
|
+
constantCase,
|
|
38
|
+
dotCase,
|
|
39
|
+
pathCase,
|
|
40
|
+
sentenceCase,
|
|
41
|
+
titleCase,
|
|
42
|
+
detectedCase
|
|
43
|
+
};
|
|
44
|
+
if (returnDetails) {
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
switch (targetCase) {
|
|
48
|
+
case 'camel': return camelCase;
|
|
49
|
+
case 'pascal': return pascalCase;
|
|
50
|
+
case 'kebab': return kebabCase;
|
|
51
|
+
case 'snake': return snakeCase;
|
|
52
|
+
case 'constant': return constantCase;
|
|
53
|
+
case 'dot': return dotCase;
|
|
54
|
+
case 'path': return pathCase;
|
|
55
|
+
case 'sentence': return sentenceCase;
|
|
56
|
+
case 'title': return titleCase;
|
|
57
|
+
default:
|
|
58
|
+
throw new Error(`Invalid target case: ${targetCase}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function detectCase(str) {
|
|
62
|
+
if (/^[a-z]+([A-Z][a-z]*)*$/.test(str))
|
|
63
|
+
return 'camel';
|
|
64
|
+
if (/^[A-Z][a-z]*([A-Z][a-z]*)*$/.test(str))
|
|
65
|
+
return 'pascal';
|
|
66
|
+
if (/^[a-z]+(-[a-z]+)*$/.test(str))
|
|
67
|
+
return 'kebab';
|
|
68
|
+
if (/^[a-z]+(_[a-z]+)*$/.test(str))
|
|
69
|
+
return 'snake';
|
|
70
|
+
if (/^[A-Z]+(_[A-Z]+)*$/.test(str))
|
|
71
|
+
return 'constant';
|
|
72
|
+
if (/^[a-z]+(\.[a-z]+)*$/.test(str))
|
|
73
|
+
return 'dot';
|
|
74
|
+
if (/^[a-z]+(\/[a-z]+)*$/.test(str))
|
|
75
|
+
return 'path';
|
|
76
|
+
if (/^[A-Z][a-z]*( [a-z]+)*$/.test(str))
|
|
77
|
+
return 'sentence';
|
|
78
|
+
if (/^[A-Z][a-z]*( [A-Z][a-z]*)*$/.test(str))
|
|
79
|
+
return 'title';
|
|
80
|
+
return 'mixed';
|
|
81
|
+
}
|
|
82
|
+
function splitIntoWords(str, preserveConsecutiveUppercase) {
|
|
83
|
+
let result = str
|
|
84
|
+
.replace(/[-_.\/ ]+/g, '|')
|
|
85
|
+
.replace(/([a-z])([A-Z])/g, '$1|$2');
|
|
86
|
+
if (!preserveConsecutiveUppercase) {
|
|
87
|
+
result = result.replace(/([A-Z])([A-Z][a-z])/g, '$1|$2');
|
|
88
|
+
}
|
|
89
|
+
return result
|
|
90
|
+
.split('|')
|
|
91
|
+
.filter(word => word.length > 0)
|
|
92
|
+
.map(word => word.trim());
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=caseConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caseConverter.js","sourceRoot":"","sources":["../../../src/functions/string/caseConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAoCzC,MAAM,UAAU,aAAa,CAC3B,GAAW,EACX,UAAuB,EAAE,EACzB,gBAAyB,KAAK;IAE9B,MAAM,EAAE,UAAU,GAAG,OAAO,EAAE,4BAA4B,GAAG,KAAK,EAAE,GAAG,OAAO,CAAA;IAE9E,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,WAAW,GAAG;YAClB,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YACd,UAAU,EAAE,GAAG;YACf,SAAS,EAAE,GAAG;YACd,SAAS,EAAE,GAAG;YACd,YAAY,EAAE,GAAG;YACjB,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,GAAG;YACb,YAAY,EAAE,GAAG;YACjB,SAAS,EAAE,GAAG;YACd,YAAY,EAAE,OAAgB;SAC/B,CAAA;QACD,OAAO,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAA;IAC1C,CAAC;IAGD,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAA;IAGpC,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,EAAE,4BAA4B,CAAC,CAAA;IAG/D,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC1C,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,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AC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,UAAU,CAAA;IACrD,IAAI,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACjD,IAAI,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,MAAM,CAAA;IAClD,IAAI,yBAAyB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,UAAU,CAAA;IAC1D,IAAI,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,OAAO,CAAA;IAC5D,OAAO,OAAO,CAAA;AAChB,CAAC;AAKD,SAAS,cAAc,CAAC,GAAW,EAAE,4BAAqC;IAExE,IAAI,MAAM,GAAG,GAAG;SAEb,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC;SAE1B,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;IAEtC,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAElC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAA;IAC1D,CAAC;IAED,OAAO,MAAM;SACV,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SAC/B,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type DesensitizeType = 'name' | 'phone' | 'email' | 'idCard' | 'bankCard' | 'auto';
|
|
2
|
+
export interface DesensitizeOptions {
|
|
3
|
+
maskChar?: string;
|
|
4
|
+
keepStart?: number;
|
|
5
|
+
keepEnd?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function desensitize(data: string, type: DesensitizeType, options?: DesensitizeOptions): string;
|
|
8
|
+
export declare function autoDesensitize(data: string, options?: DesensitizeOptions): string;
|
|
9
|
+
export declare function desensitizeName(name: string, options?: DesensitizeOptions): string;
|
|
10
|
+
export declare function desensitizePhone(phone: string, options?: DesensitizeOptions): string;
|
|
11
|
+
export declare function desensitizeEmail(email: string, options?: DesensitizeOptions): string;
|
|
12
|
+
export declare function desensitizeIdCard(idCard: string, options?: DesensitizeOptions): string;
|
|
13
|
+
export declare function desensitizeBankCard(bankCard: string, options?: DesensitizeOptions): string;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export function desensitize(data, type, options = {}) {
|
|
2
|
+
if (!data)
|
|
3
|
+
return '';
|
|
4
|
+
const { maskChar = '*' } = options;
|
|
5
|
+
switch (type) {
|
|
6
|
+
case 'name':
|
|
7
|
+
return desensitizeName(data, { maskChar, ...options });
|
|
8
|
+
case 'phone':
|
|
9
|
+
return desensitizePhone(data, { maskChar, ...options });
|
|
10
|
+
case 'email':
|
|
11
|
+
return desensitizeEmail(data, { maskChar, ...options });
|
|
12
|
+
case 'idCard':
|
|
13
|
+
return desensitizeIdCard(data, { maskChar, ...options });
|
|
14
|
+
case 'bankCard':
|
|
15
|
+
return desensitizeBankCard(data, { maskChar, ...options });
|
|
16
|
+
case 'auto':
|
|
17
|
+
return autoDesensitize(data, { maskChar, ...options });
|
|
18
|
+
default:
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function autoDesensitize(data, options = {}) {
|
|
23
|
+
if (!data || typeof data !== 'string')
|
|
24
|
+
return data;
|
|
25
|
+
const { maskChar = '*' } = options;
|
|
26
|
+
if (data.length === 11 && /^1\d{10}$/.test(data)) {
|
|
27
|
+
return desensitizePhone(data, options);
|
|
28
|
+
}
|
|
29
|
+
if (data.includes('@')) {
|
|
30
|
+
return desensitizeEmail(data, options);
|
|
31
|
+
}
|
|
32
|
+
if (data.length === 18 && /^\d{17}[\dXx]$/.test(data)) {
|
|
33
|
+
return desensitizeIdCard(data, options);
|
|
34
|
+
}
|
|
35
|
+
if (data.length >= 16 && /^\d+$/.test(data)) {
|
|
36
|
+
return desensitizeBankCard(data, options);
|
|
37
|
+
}
|
|
38
|
+
if (data.length <= 4 && /^[\u4e00-\u9fa5a-zA-Z]+$/.test(data)) {
|
|
39
|
+
return desensitizeName(data, options);
|
|
40
|
+
}
|
|
41
|
+
const len = data.length;
|
|
42
|
+
if (len <= 2)
|
|
43
|
+
return data;
|
|
44
|
+
return data.charAt(0) + maskChar.repeat(len - 2) + data.charAt(len - 1);
|
|
45
|
+
}
|
|
46
|
+
export function desensitizeName(name, options = {}) {
|
|
47
|
+
if (!name)
|
|
48
|
+
return '';
|
|
49
|
+
if (name.length === 1)
|
|
50
|
+
return name;
|
|
51
|
+
const { maskChar = '*', keepStart = 0, keepEnd = 1 } = options;
|
|
52
|
+
const start = name.slice(0, keepStart);
|
|
53
|
+
const end = name.slice(-keepEnd);
|
|
54
|
+
const maskLength = Math.max(0, name.length - keepStart - keepEnd);
|
|
55
|
+
return start + maskChar.repeat(maskLength) + end;
|
|
56
|
+
}
|
|
57
|
+
export function desensitizePhone(phone, options = {}) {
|
|
58
|
+
if (!phone)
|
|
59
|
+
return '';
|
|
60
|
+
if (phone.length <= 7)
|
|
61
|
+
return phone;
|
|
62
|
+
const { maskChar = '*', keepStart = 3, keepEnd = 4 } = options;
|
|
63
|
+
const start = phone.slice(0, keepStart);
|
|
64
|
+
const end = phone.slice(-keepEnd);
|
|
65
|
+
const maskLength = Math.max(0, phone.length - keepStart - keepEnd);
|
|
66
|
+
return start + maskChar.repeat(maskLength) + end;
|
|
67
|
+
}
|
|
68
|
+
export function desensitizeEmail(email, options = {}) {
|
|
69
|
+
if (!email)
|
|
70
|
+
return '';
|
|
71
|
+
const atIndex = email.indexOf('@');
|
|
72
|
+
if (atIndex === -1)
|
|
73
|
+
return email;
|
|
74
|
+
const { maskChar = '*', keepStart = 1, keepEnd = 1 } = options;
|
|
75
|
+
const username = email.slice(0, atIndex);
|
|
76
|
+
const domain = email.slice(atIndex);
|
|
77
|
+
if (username.length <= keepStart + keepEnd) {
|
|
78
|
+
return email;
|
|
79
|
+
}
|
|
80
|
+
const start = username.slice(0, keepStart);
|
|
81
|
+
const end = username.slice(-keepEnd);
|
|
82
|
+
const maskLength = username.length - keepStart - keepEnd;
|
|
83
|
+
return start + maskChar.repeat(maskLength) + end + domain;
|
|
84
|
+
}
|
|
85
|
+
export function desensitizeIdCard(idCard, options = {}) {
|
|
86
|
+
if (!idCard)
|
|
87
|
+
return '';
|
|
88
|
+
if (idCard.length < 8)
|
|
89
|
+
return idCard;
|
|
90
|
+
const { maskChar = '*', keepStart = 4, keepEnd = 4 } = options;
|
|
91
|
+
const start = idCard.slice(0, keepStart);
|
|
92
|
+
const end = idCard.slice(-keepEnd);
|
|
93
|
+
const maskLength = Math.max(0, idCard.length - keepStart - keepEnd);
|
|
94
|
+
return start + maskChar.repeat(maskLength) + end;
|
|
95
|
+
}
|
|
96
|
+
export function desensitizeBankCard(bankCard, options = {}) {
|
|
97
|
+
if (!bankCard)
|
|
98
|
+
return '';
|
|
99
|
+
if (bankCard.length < 8)
|
|
100
|
+
return bankCard;
|
|
101
|
+
const { maskChar = '*', keepStart = 4, keepEnd = 4 } = options;
|
|
102
|
+
const start = bankCard.slice(0, keepStart);
|
|
103
|
+
const end = bankCard.slice(-keepEnd);
|
|
104
|
+
const maskLength = Math.max(0, bankCard.length - keepStart - keepEnd);
|
|
105
|
+
return start + maskChar.repeat(maskLength) + end;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=desensitize.js.map
|