zcw-shared 1.5.0 → 1.7.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 -782
- 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/colorPatterns.d.ts +8 -2
- package/dist/constants/colorPatterns.js.map +1 -1
- package/dist/constants/namedColors.d.ts +16 -2
- package/dist/constants/namedColors.js.map +1 -1
- package/dist/functions/android/buildProject.d.ts +11 -0
- package/dist/functions/android/buildProject.js +97 -0
- package/dist/functions/android/buildProject.js.map +1 -0
- package/dist/functions/android/modifyGradle.d.ts +17 -0
- package/dist/functions/android/modifyGradle.js +69 -0
- package/dist/functions/android/modifyGradle.js.map +1 -0
- package/dist/functions/android/modifyManifest.d.ts +23 -0
- package/dist/functions/android/modifyManifest.js +198 -0
- package/dist/functions/android/modifyManifest.js.map +1 -0
- package/dist/functions/android/permission.d.ts +30 -0
- package/dist/functions/android/permission.js +65 -0
- package/dist/functions/android/permission.js.map +1 -0
- package/dist/functions/color/colorValidation.d.ts +11 -0
- package/dist/functions/color/colorValidation.js +35 -0
- package/dist/functions/color/colorValidation.js.map +1 -0
- package/dist/functions/color/convertColor.d.ts +0 -1
- package/dist/functions/color/convertColor.js +135 -166
- package/dist/functions/color/convertColor.js.map +1 -1
- package/dist/functions/color/deduplicateColors.js +23 -38
- package/dist/functions/color/deduplicateColors.js.map +1 -1
- package/dist/functions/color/detectColorFormat.d.ts +8 -2
- package/dist/functions/color/detectColorFormat.js +49 -51
- package/dist/functions/color/detectColorFormat.js.map +1 -1
- package/dist/functions/color/extractColors.js +48 -18
- package/dist/functions/color/extractColors.js.map +1 -1
- package/dist/functions/css/extractCssVariables.d.ts +1 -1
- package/dist/functions/css/extractCssVariables.js +1 -1
- package/dist/functions/css/extractCssVariables.js.map +1 -1
- package/dist/functions/debug/createDebugger.d.ts +8 -7
- package/dist/functions/debug/createDebugger.js +49 -39
- package/dist/functions/debug/createDebugger.js.map +1 -1
- package/dist/functions/dom/detectOverflow.d.ts +3 -3
- package/dist/functions/dom/detectOverflow.js +3 -3
- package/dist/functions/dom/detectOverflow.js.map +1 -1
- package/dist/functions/dom/getElementRect.d.ts +1 -1
- package/dist/functions/dom/getElementRect.js.map +1 -1
- package/dist/functions/dom/getRelativePosition.d.ts +1 -1
- package/dist/functions/dom/getRelativePosition.js.map +1 -1
- package/dist/functions/dom/getViewportRect.d.ts +2 -2
- package/dist/functions/dom/getViewportRect.js +2 -2
- package/dist/functions/dom/getViewportRect.js.map +1 -1
- package/dist/functions/image/generateMacIcons.d.ts +3 -3
- package/dist/functions/image/generateMacIcons.js.map +1 -1
- package/dist/functions/image/generateMacTrayIcon.d.ts +3 -3
- package/dist/functions/image/generateMacTrayIcon.js.map +1 -1
- package/dist/functions/image/generatePaddedImage.d.ts +2 -2
- package/dist/functions/image/generatePaddedImage.js.map +1 -1
- package/dist/functions/image/generatePwaIcons.d.ts +3 -3
- package/dist/functions/image/generatePwaIcons.js.map +1 -1
- package/dist/functions/image/generateRoundedImage.d.ts +2 -2
- package/dist/functions/image/generateRoundedImage.js.map +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.d.ts +2 -2
- package/dist/functions/ipc/dispatchIpcRequest.js +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -1
- package/dist/functions/software/findSoftware.d.ts +3 -3
- package/dist/functions/software/findSoftware.js +7 -9
- package/dist/functions/software/findSoftware.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +97 -24
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/uniapp/build.d.ts +20 -0
- package/dist/functions/uniapp/build.js +84 -0
- package/dist/functions/uniapp/build.js.map +1 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.d.ts +7 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js +30 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js.map +1 -0
- package/dist/functions/uniapp/detectProjectType.d.ts +16 -0
- package/dist/functions/uniapp/detectProjectType.js +68 -0
- package/dist/functions/uniapp/detectProjectType.js.map +1 -0
- package/dist/functions/uniapp/parseManifest.d.ts +12 -0
- package/dist/functions/uniapp/{app-plus/parseManifest.js → parseManifest.js} +9 -7
- package/dist/functions/uniapp/parseManifest.js.map +1 -0
- package/dist/functions/utils/generateExports.d.ts +16 -0
- package/dist/functions/utils/generateExports.js +34 -0
- package/dist/functions/utils/generateExports.js.map +1 -0
- package/dist/functions/vue/extractColorsFromVueFile.js +2 -11
- package/dist/functions/vue/extractColorsFromVueFile.js.map +1 -1
- package/dist/functions/vue/extractColorsFromVueSection.js.map +1 -1
- package/dist/functions/xml/modifyXml.d.ts +11 -0
- package/dist/functions/xml/modifyXml.js +46 -0
- package/dist/functions/xml/modifyXml.js.map +1 -0
- package/dist/hooks/useAltool.d.ts +3 -32
- package/dist/hooks/useAltool.js.map +1 -1
- package/dist/hooks/useLocalStorage.d.ts +4 -4
- package/dist/hooks/useLocalStorage.js +51 -18
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useSessionStorage.d.ts +4 -4
- package/dist/hooks/useSessionStorage.js +51 -18
- package/dist/hooks/useSessionStorage.js.map +1 -1
- package/dist/hooks/useStorage.d.ts +10 -3
- package/dist/hooks/useStorage.js +33 -35
- package/dist/hooks/useStorage.js.map +1 -1
- package/dist/hooks/useStorageWithIndexedDB.d.ts +3 -4
- package/dist/hooks/useStorageWithIndexedDB.js +39 -29
- package/dist/hooks/useStorageWithIndexedDB.js.map +1 -1
- package/dist/hooks/useWebWorker.d.ts +25 -4
- package/dist/hooks/useWebWorker.js.map +1 -1
- package/dist/hooks/useWorkerFunction.d.ts +22 -4
- package/dist/hooks/useWorkerFunction.js +28 -28
- package/dist/hooks/useWorkerFunction.js.map +1 -1
- package/dist/hooks/useWorkerPool.d.ts +30 -4
- package/dist/hooks/useWorkerPool.js.map +1 -1
- package/package.json +17 -22
- package/references/arraybuffer.d.ts +109 -0
- package/references/blob.d.ts +37 -0
- package/references/browser.d.ts +69 -174
- package/references/chrome.extension.d.ts +83 -0
- package/references/console.d.ts +25 -164
- package/references/{crypto.d.ts → crypto-js.d.ts} +57 -57
- package/references/dom.d.ts +41 -0
- package/references/encoding.d.ts +24 -0
- package/references/fetch.d.ts +124 -269
- package/references/indexeddb.d.ts +49 -0
- package/references/json5.d.ts +21 -28
- package/references/location.d.ts +16 -0
- package/references/node.d.ts +116 -111
- package/references/sharp.d.ts +18 -18
- package/references/storage.d.ts +17 -111
- package/references/timer.d.ts +45 -46
- package/references/uniapp.d.ts +51 -9
- package/references/url.d.ts +55 -160
- package/references/vue.d.ts +86 -113
- package/references/webassembly.d.ts +101 -127
- package/references/wechat.d.ts +48 -48
- package/references/worker.d.ts +152 -206
- package/references/xml.d.ts +88 -55
- package/types/altool.d.ts +49 -17
- package/types/android-build.d.ts +60 -85
- package/types/color.d.ts +72 -162
- package/types/geometry.d.ts +28 -65
- package/types/platform.d.ts +4 -0
- package/types/software.d.ts +14 -26
- package/types/storage.d.ts +50 -48
- package/types/uniapp-android-build.d.ts +49 -0
- package/types/vue.d.ts +29 -29
- package/types/worker.d.ts +178 -364
- package/dist/constants/softwareConfigs.d.ts +0 -15
- package/dist/constants/softwareConfigs.js +0 -157
- package/dist/constants/softwareConfigs.js.map +0 -1
- package/dist/functions/ag-grid/generateLicense.d.ts +0 -3
- package/dist/functions/ag-grid/generateLicense.js +0 -12
- package/dist/functions/ag-grid/generateLicense.js.map +0 -1
- package/dist/functions/altool/createAltoolClient.d.ts +0 -21
- package/dist/functions/altool/createAltoolClient.js +0 -53
- package/dist/functions/altool/createAltoolClient.js.map +0 -1
- package/dist/functions/altool/getAltoolAuth.d.ts +0 -2
- package/dist/functions/altool/getAltoolAuth.js +0 -8
- package/dist/functions/altool/getAltoolAuth.js.map +0 -1
- package/dist/functions/altool/getAppInfo.d.ts +0 -13
- package/dist/functions/altool/getAppInfo.js +0 -39
- package/dist/functions/altool/getAppInfo.js.map +0 -1
- package/dist/functions/altool/index.d.ts +0 -10
- package/dist/functions/altool/index.js +0 -6
- package/dist/functions/altool/index.js.map +0 -1
- package/dist/functions/altool/isApiKeyAuth.d.ts +0 -2
- package/dist/functions/altool/isApiKeyAuth.js +0 -4
- package/dist/functions/altool/isApiKeyAuth.js.map +0 -1
- package/dist/functions/altool/isCredentialsAuth.d.ts +0 -2
- package/dist/functions/altool/isCredentialsAuth.js +0 -4
- package/dist/functions/altool/isCredentialsAuth.js.map +0 -1
- package/dist/functions/altool/parseAppInfoOutput.d.ts +0 -2
- package/dist/functions/altool/parseAppInfoOutput.js +0 -55
- package/dist/functions/altool/parseAppInfoOutput.js.map +0 -1
- package/dist/functions/altool/parseValidationOutput.d.ts +0 -6
- package/dist/functions/altool/parseValidationOutput.js +0 -21
- package/dist/functions/altool/parseValidationOutput.js.map +0 -1
- package/dist/functions/altool/types.d.ts +0 -26
- package/dist/functions/altool/types.js +0 -7
- package/dist/functions/altool/types.js.map +0 -1
- package/dist/functions/altool/uploadApp.d.ts +0 -6
- package/dist/functions/altool/uploadApp.js +0 -36
- package/dist/functions/altool/uploadApp.js.map +0 -1
- package/dist/functions/altool/validateApp.d.ts +0 -17
- package/dist/functions/altool/validateApp.js +0 -40
- package/dist/functions/altool/validateApp.js.map +0 -1
- package/dist/functions/base64/strToBase64.d.ts +0 -2
- package/dist/functions/base64/strToBase64.js +0 -6
- package/dist/functions/base64/strToBase64.js.map +0 -1
- package/dist/functions/color-converter/COLOR_PATTERNS.d.ts +0 -2
- package/dist/functions/color-converter/COLOR_PATTERNS.js +0 -9
- package/dist/functions/color-converter/COLOR_PATTERNS.js.map +0 -1
- package/dist/functions/color-converter/colorPatterns.d.ts +0 -4
- package/dist/functions/color-converter/colorPatterns.js +0 -41
- package/dist/functions/color-converter/colorPatterns.js.map +0 -1
- package/dist/functions/color-converter/convertColor.d.ts +0 -6
- package/dist/functions/color-converter/convertColor.js +0 -12
- package/dist/functions/color-converter/convertColor.js.map +0 -1
- package/dist/functions/color-converter/createColorReference.d.ts +0 -2
- package/dist/functions/color-converter/createColorReference.js +0 -12
- package/dist/functions/color-converter/createColorReference.js.map +0 -1
- package/dist/functions/color-converter/detectColorFormat.d.ts +0 -2
- package/dist/functions/color-converter/detectColorFormat.js +0 -19
- package/dist/functions/color-converter/detectColorFormat.js.map +0 -1
- package/dist/functions/color-converter/extractColors.d.ts +0 -3
- package/dist/functions/color-converter/extractColors.js +0 -16
- package/dist/functions/color-converter/extractColors.js.map +0 -1
- package/dist/functions/color-converter/extractColorsFromLine.d.ts +0 -2
- package/dist/functions/color-converter/extractColorsFromLine.js +0 -18
- package/dist/functions/color-converter/extractColorsFromLine.js.map +0 -1
- package/dist/functions/color-converter/extractColorsGeneric.d.ts +0 -2
- package/dist/functions/color-converter/extractColorsGeneric.js +0 -12
- package/dist/functions/color-converter/extractColorsGeneric.js.map +0 -1
- package/dist/functions/color-converter/extractCssVariableReferences.d.ts +0 -2
- package/dist/functions/color-converter/extractCssVariableReferences.js +0 -15
- package/dist/functions/color-converter/extractCssVariableReferences.js.map +0 -1
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.d.ts +0 -2
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js +0 -15
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js.map +0 -1
- package/dist/functions/color-converter/formatColorOutput.d.ts +0 -5
- package/dist/functions/color-converter/formatColorOutput.js +0 -48
- package/dist/functions/color-converter/formatColorOutput.js.map +0 -1
- package/dist/functions/color-converter/getColorPatterns.d.ts +0 -2
- package/dist/functions/color-converter/getColorPatterns.js +0 -11
- package/dist/functions/color-converter/getColorPatterns.js.map +0 -1
- package/dist/functions/color-converter/getNamedColorMap.d.ts +0 -2
- package/dist/functions/color-converter/getNamedColorMap.js +0 -19
- package/dist/functions/color-converter/getNamedColorMap.js.map +0 -1
- package/dist/functions/color-converter/hexToRgb.d.ts +0 -2
- package/dist/functions/color-converter/hexToRgb.js +0 -42
- package/dist/functions/color-converter/hexToRgb.js.map +0 -1
- package/dist/functions/color-converter/hslToRgb.d.ts +0 -2
- package/dist/functions/color-converter/hslToRgb.js +0 -78
- package/dist/functions/color-converter/hslToRgb.js.map +0 -1
- package/dist/functions/color-converter/hslToRgbInternal.d.ts +0 -2
- package/dist/functions/color-converter/hslToRgbInternal.js +0 -24
- package/dist/functions/color-converter/hslToRgbInternal.js.map +0 -1
- package/dist/functions/color-converter/hueToRgb.d.ts +0 -1
- package/dist/functions/color-converter/hueToRgb.js +0 -14
- package/dist/functions/color-converter/hueToRgb.js.map +0 -1
- package/dist/functions/color-converter/isColorValue.d.ts +0 -2
- package/dist/functions/color-converter/isColorValue.js +0 -79
- package/dist/functions/color-converter/isColorValue.js.map +0 -1
- package/dist/functions/color-converter/isValidColorValue.d.ts +0 -1
- package/dist/functions/color-converter/isValidColorValue.js +0 -4
- package/dist/functions/color-converter/isValidColorValue.js.map +0 -1
- package/dist/functions/color-converter/isValidHslColor.d.ts +0 -2
- package/dist/functions/color-converter/isValidHslColor.js +0 -14
- package/dist/functions/color-converter/isValidHslColor.js.map +0 -1
- package/dist/functions/color-converter/isValidRgbColor.d.ts +0 -2
- package/dist/functions/color-converter/isValidRgbColor.js +0 -14
- package/dist/functions/color-converter/isValidRgbColor.js.map +0 -1
- package/dist/functions/color-converter/normalizeColor.d.ts +0 -1
- package/dist/functions/color-converter/normalizeColor.js +0 -49
- package/dist/functions/color-converter/normalizeColor.js.map +0 -1
- package/dist/functions/color-converter/normalizeColorInput.d.ts +0 -6
- package/dist/functions/color-converter/normalizeColorInput.js +0 -94
- package/dist/functions/color-converter/normalizeColorInput.js.map +0 -1
- package/dist/functions/color-converter/parseColorString.d.ts +0 -12
- package/dist/functions/color-converter/parseColorString.js +0 -89
- package/dist/functions/color-converter/parseColorString.js.map +0 -1
- package/dist/functions/color-converter/parseCssVariables.d.ts +0 -2
- package/dist/functions/color-converter/parseCssVariables.js +0 -19
- package/dist/functions/color-converter/parseCssVariables.js.map +0 -1
- package/dist/functions/color-converter/parseHexColor.d.ts +0 -6
- package/dist/functions/color-converter/parseHexColor.js +0 -42
- package/dist/functions/color-converter/parseHexColor.js.map +0 -1
- package/dist/functions/color-converter/rgbToHex.d.ts +0 -2
- package/dist/functions/color-converter/rgbToHex.js +0 -65
- package/dist/functions/color-converter/rgbToHex.js.map +0 -1
- package/dist/functions/color-converter/rgbToHslInternal.d.ts +0 -2
- package/dist/functions/color-converter/rgbToHslInternal.js +0 -31
- package/dist/functions/color-converter/rgbToHslInternal.js.map +0 -1
- package/dist/functions/color-converter/standardizeColor.d.ts +0 -1
- package/dist/functions/color-converter/standardizeColor.js +0 -147
- package/dist/functions/color-converter/standardizeColor.js.map +0 -1
- package/dist/functions/desensitize/desensitizeName.d.ts +0 -1
- package/dist/functions/desensitize/desensitizeName.js +0 -8
- package/dist/functions/desensitize/desensitizeName.js.map +0 -1
- package/dist/functions/desensitize/desensitizePhone.d.ts +0 -1
- package/dist/functions/desensitize/desensitizePhone.js +0 -8
- package/dist/functions/desensitize/desensitizePhone.js.map +0 -1
- package/dist/functions/dom/getViewportSize.d.ts +0 -5
- package/dist/functions/dom/getViewportSize.js +0 -7
- package/dist/functions/dom/getViewportSize.js.map +0 -1
- package/dist/functions/software/buildPathExecutables.d.ts +0 -1
- package/dist/functions/software/buildPathExecutables.js +0 -14
- package/dist/functions/software/buildPathExecutables.js.map +0 -1
- package/dist/functions/software/buildSoftwarePaths.d.ts +0 -2
- package/dist/functions/software/buildSoftwarePaths.js +0 -22
- package/dist/functions/software/buildSoftwarePaths.js.map +0 -1
- package/dist/functions/software/createConfigGenerator.d.ts +0 -8
- package/dist/functions/software/createConfigGenerator.js +0 -13
- package/dist/functions/software/createConfigGenerator.js.map +0 -1
- package/dist/functions/software/detectPlatform.d.ts +0 -2
- package/dist/functions/software/detectPlatform.js +0 -9
- package/dist/functions/software/detectPlatform.js.map +0 -1
- package/dist/functions/software/find.d.ts +0 -2
- package/dist/functions/software/find.js +0 -12
- package/dist/functions/software/find.js.map +0 -1
- package/dist/functions/software/findSoftwareWithGenerator.d.ts +0 -3
- package/dist/functions/software/findSoftwareWithGenerator.js +0 -8
- package/dist/functions/software/findSoftwareWithGenerator.js.map +0 -1
- package/dist/functions/software/getConfigGenerator.d.ts +0 -2
- package/dist/functions/software/getConfigGenerator.js +0 -10
- package/dist/functions/software/getConfigGenerator.js.map +0 -1
- package/dist/functions/software/getEnvironmentSoftwarePath.d.ts +0 -1
- package/dist/functions/software/getEnvironmentSoftwarePath.js +0 -8
- package/dist/functions/software/getEnvironmentSoftwarePath.js.map +0 -1
- package/dist/functions/software/getSupportedSoftware.d.ts +0 -1
- package/dist/functions/software/getSupportedSoftware.js +0 -5
- package/dist/functions/software/getSupportedSoftware.js.map +0 -1
- package/dist/functions/software/parseEnvironmentPaths.d.ts +0 -1
- package/dist/functions/software/parseEnvironmentPaths.js +0 -11
- package/dist/functions/software/parseEnvironmentPaths.js.map +0 -1
- package/dist/functions/software/softwareConfigs.d.ts +0 -2
- package/dist/functions/software/softwareConfigs.js +0 -148
- package/dist/functions/software/softwareConfigs.js.map +0 -1
- package/dist/functions/software/softwareNameMap.d.ts +0 -1
- package/dist/functions/software/softwareNameMap.js +0 -9
- package/dist/functions/software/softwareNameMap.js.map +0 -1
- package/dist/functions/software/types.d.ts +0 -11
- package/dist/functions/software/types.js +0 -2
- package/dist/functions/software/types.js.map +0 -1
- package/dist/functions/string/base64.d.ts +0 -2
- package/dist/functions/string/base64.js +0 -6
- package/dist/functions/string/base64.js.map +0 -1
- package/dist/functions/string/camelCase.d.ts +0 -1
- package/dist/functions/string/camelCase.js +0 -8
- package/dist/functions/string/camelCase.js.map +0 -1
- package/dist/functions/string/capitalize.d.ts +0 -1
- package/dist/functions/string/capitalize.js +0 -6
- package/dist/functions/string/capitalize.js.map +0 -1
- package/dist/functions/string/caseConverter.d.ts +0 -20
- package/dist/functions/string/caseConverter.js +0 -101
- package/dist/functions/string/caseConverter.js.map +0 -1
- package/dist/functions/string/desensitize.d.ts +0 -13
- package/dist/functions/string/desensitize.js +0 -107
- package/dist/functions/string/desensitize.js.map +0 -1
- package/dist/functions/string/escape.d.ts +0 -1
- package/dist/functions/string/escape.js +0 -13
- package/dist/functions/string/escape.js.map +0 -1
- package/dist/functions/string/htmlEscape.d.ts +0 -17
- package/dist/functions/string/htmlEscape.js +0 -68
- package/dist/functions/string/htmlEscape.js.map +0 -1
- package/dist/functions/string/kebabCase.d.ts +0 -1
- package/dist/functions/string/kebabCase.js +0 -10
- package/dist/functions/string/kebabCase.js.map +0 -1
- package/dist/functions/string/levenshtein.d.ts +0 -1
- package/dist/functions/string/levenshtein.js +0 -27
- package/dist/functions/string/levenshtein.js.map +0 -1
- package/dist/functions/string/mask.d.ts +0 -1
- package/dist/functions/string/mask.js +0 -40
- package/dist/functions/string/mask.js.map +0 -1
- package/dist/functions/string/normalize.d.ts +0 -8
- package/dist/functions/string/normalize.js +0 -37
- package/dist/functions/string/normalize.js.map +0 -1
- package/dist/functions/string/pad.d.ts +0 -14
- package/dist/functions/string/pad.js +0 -53
- package/dist/functions/string/pad.js.map +0 -1
- package/dist/functions/string/padEnd.d.ts +0 -1
- package/dist/functions/string/padEnd.js +0 -8
- package/dist/functions/string/padEnd.js.map +0 -1
- package/dist/functions/string/padStart.d.ts +0 -1
- package/dist/functions/string/padStart.js +0 -8
- package/dist/functions/string/padStart.js.map +0 -1
- package/dist/functions/string/palindrome.d.ts +0 -3
- package/dist/functions/string/palindrome.js +0 -15
- package/dist/functions/string/palindrome.js.map +0 -1
- package/dist/functions/string/pascalCase.d.ts +0 -1
- package/dist/functions/string/pascalCase.js +0 -8
- package/dist/functions/string/pascalCase.js.map +0 -1
- package/dist/functions/string/similarity.d.ts +0 -1
- package/dist/functions/string/similarity.js +0 -13
- package/dist/functions/string/similarity.js.map +0 -1
- package/dist/functions/string/snakeCase.d.ts +0 -1
- package/dist/functions/string/snakeCase.js +0 -10
- package/dist/functions/string/snakeCase.js.map +0 -1
- package/dist/functions/string/template.d.ts +0 -4
- package/dist/functions/string/template.js +0 -21
- package/dist/functions/string/template.js.map +0 -1
- package/dist/functions/string/unescape.d.ts +0 -1
- package/dist/functions/string/unescape.js +0 -13
- package/dist/functions/string/unescape.js.map +0 -1
- package/dist/functions/string/wordCount.d.ts +0 -5
- package/dist/functions/string/wordCount.js +0 -11
- package/dist/functions/string/wordCount.js.map +0 -1
- package/dist/functions/tencent-cloud/getSecret.d.ts +0 -6
- package/dist/functions/tencent-cloud/getSecret.js +0 -18
- package/dist/functions/tencent-cloud/getSecret.js.map +0 -1
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.d.ts +0 -13
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js +0 -175
- package/dist/functions/uniapp/app-plus/androidProjectConfigSteps.js.map +0 -1
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +0 -19
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +0 -55
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +0 -1
- package/dist/functions/uniapp/app-plus/buildAndroidProject.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js +0 -60
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.d.ts +0 -5
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js +0 -51
- package/dist/functions/uniapp/app-plus/configureAndroidManifest.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureAndroidProject.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js +0 -63
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureBuildGradle.d.ts +0 -9
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js +0 -57
- package/dist/functions/uniapp/app-plus/configureBuildGradle.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureDcloudControl.d.ts +0 -5
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js +0 -34
- package/dist/functions/uniapp/app-plus/configureDcloudControl.js.map +0 -1
- package/dist/functions/uniapp/app-plus/configureStrings.d.ts +0 -5
- package/dist/functions/uniapp/app-plus/configureStrings.js +0 -42
- package/dist/functions/uniapp/app-plus/configureStrings.js.map +0 -1
- package/dist/functions/uniapp/app-plus/copyAppResources.d.ts +0 -8
- package/dist/functions/uniapp/app-plus/copyAppResources.js +0 -25
- package/dist/functions/uniapp/app-plus/copyAppResources.js.map +0 -1
- package/dist/functions/uniapp/app-plus/copyDirectory.d.ts +0 -2
- package/dist/functions/uniapp/app-plus/copyDirectory.js +0 -18
- package/dist/functions/uniapp/app-plus/copyDirectory.js.map +0 -1
- package/dist/functions/uniapp/app-plus/generateUniAppResources.d.ts +0 -2
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js +0 -35
- package/dist/functions/uniapp/app-plus/generateUniAppResources.js.map +0 -1
- package/dist/functions/uniapp/app-plus/parseManifest.d.ts +0 -14
- package/dist/functions/uniapp/app-plus/parseManifest.js.map +0 -1
- package/dist/functions/uniapp/app-plus/validateOptions.d.ts +0 -3
- package/dist/functions/uniapp/app-plus/validateOptions.js +0 -10
- package/dist/functions/uniapp/app-plus/validateOptions.js.map +0 -1
- package/dist/functions/uniapp/waitForPages.d.ts +0 -2
- package/dist/functions/uniapp/waitForPages.js +0 -20
- package/dist/functions/uniapp/waitForPages.js.map +0 -1
- package/dist/functions/utils/compose.d.ts +0 -1
- package/dist/functions/utils/compose.js +0 -10
- package/dist/functions/utils/compose.js.map +0 -1
- package/dist/functions/utils/cond.d.ts +0 -1
- package/dist/functions/utils/cond.js +0 -15
- package/dist/functions/utils/cond.js.map +0 -1
- package/dist/functions/utils/curry.d.ts +0 -1
- package/dist/functions/utils/curry.js +0 -13
- package/dist/functions/utils/curry.js.map +0 -1
- package/dist/functions/utils/debounce.d.ts +0 -1
- package/dist/functions/utils/debounce.js +0 -13
- package/dist/functions/utils/debounce.js.map +0 -1
- package/dist/functions/utils/evolve.d.ts +0 -3
- package/dist/functions/utils/evolve.js +0 -15
- package/dist/functions/utils/evolve.js.map +0 -1
- package/dist/functions/utils/flow.d.ts +0 -1
- package/dist/functions/utils/flow.js +0 -14
- package/dist/functions/utils/flow.js.map +0 -1
- package/dist/functions/utils/isType.d.ts +0 -11
- package/dist/functions/utils/isType.js +0 -30
- package/dist/functions/utils/isType.js.map +0 -1
- package/dist/functions/utils/memoize.d.ts +0 -1
- package/dist/functions/utils/memoize.js +0 -13
- package/dist/functions/utils/memoize.js.map +0 -1
- package/dist/functions/utils/once.d.ts +0 -1
- package/dist/functions/utils/once.js +0 -13
- package/dist/functions/utils/once.js.map +0 -1
- package/dist/functions/utils/partial.d.ts +0 -1
- package/dist/functions/utils/partial.js +0 -13
- package/dist/functions/utils/partial.js.map +0 -1
- package/dist/functions/utils/pipe.d.ts +0 -1
- package/dist/functions/utils/pipe.js +0 -10
- package/dist/functions/utils/pipe.js.map +0 -1
- package/dist/functions/utils/retryWithBackoff.d.ts +0 -9
- package/dist/functions/utils/retryWithBackoff.js +0 -30
- package/dist/functions/utils/retryWithBackoff.js.map +0 -1
- package/dist/functions/utils/tap.d.ts +0 -1
- package/dist/functions/utils/tap.js +0 -14
- package/dist/functions/utils/tap.js.map +0 -1
- package/dist/functions/utils/throttle.d.ts +0 -1
- package/dist/functions/utils/throttle.js +0 -11
- package/dist/functions/utils/throttle.js.map +0 -1
- package/dist/functions/utils/until.d.ts +0 -1
- package/dist/functions/utils/until.js +0 -10
- package/dist/functions/utils/until.js.map +0 -1
- package/dist/functions/utils/validate.d.ts +0 -8
- package/dist/functions/utils/validate.js +0 -45
- package/dist/functions/utils/validate.js.map +0 -1
- package/dist/functions/vue/checkVueType.d.ts +0 -8
- package/dist/functions/vue/checkVueType.js +0 -29
- package/dist/functions/vue/checkVueType.js.map +0 -1
- package/dist/functions/vue/deduplicateColors.d.ts +0 -2
- package/dist/functions/vue/deduplicateColors.js +0 -13
- package/dist/functions/vue/deduplicateColors.js.map +0 -1
- package/dist/functions/vue/dynamicMount.d.ts +0 -15
- package/dist/functions/vue/dynamicMount.js +0 -23
- package/dist/functions/vue/dynamicMount.js.map +0 -1
- package/dist/functions/vue/filterSections.js +0 -11
- package/dist/functions/vue/filterSections.js.map +0 -1
- package/dist/functions/vue/isVNode.d.ts +0 -2
- package/dist/functions/vue/isVNode.js +0 -4
- package/dist/functions/vue/isVNode.js.map +0 -1
- package/dist/functions/vue/isVueComponent.d.ts +0 -2
- package/dist/functions/vue/isVueComponent.js +0 -6
- package/dist/functions/vue/isVueComponent.js.map +0 -1
- package/dist/functions/vue/parseVueFile.js +0 -53
- package/dist/functions/vue/parseVueFile.js.map +0 -1
- package/dist/functions/vue/processVueFile.d.ts +0 -3
- package/dist/functions/vue/processVueFile.js +0 -26
- package/dist/functions/vue/processVueFile.js.map +0 -1
- package/dist/functions/vue/saveVueSection.d.ts +0 -2
- package/dist/functions/vue/saveVueSection.js +0 -11
- package/dist/functions/vue/saveVueSection.js.map +0 -1
- package/dist/functions/wechat/miniapp/downloadFile.d.ts +0 -2
- package/dist/functions/wechat/miniapp/downloadFile.js +0 -39
- package/dist/functions/wechat/miniapp/downloadFile.js.map +0 -1
- package/dist/hooks/useAi.d.ts +0 -27
- package/dist/hooks/useAi.js +0 -163
- package/dist/hooks/useAi.js.map +0 -1
- package/dist/hooks/useCache.d.ts +0 -18
- package/dist/hooks/useCache.js +0 -82
- package/dist/hooks/useCache.js.map +0 -1
- package/dist/hooks/useFetch.d.ts +0 -3
- package/dist/hooks/useFetch.js +0 -154
- package/dist/hooks/useFetch.js.map +0 -1
- package/dist/hooks/usePluginSystem.d.ts +0 -11
- package/dist/hooks/usePluginSystem.js +0 -34
- package/dist/hooks/usePluginSystem.js.map +0 -1
- package/dist/hooks/useRequest.d.ts +0 -3
- package/dist/hooks/useRequest.js +0 -139
- package/dist/hooks/useRequest.js.map +0 -1
- package/dist/hooks/useWASM.d.ts +0 -4
- package/dist/hooks/useWASM.js +0 -267
- package/dist/hooks/useWASM.js.map +0 -1
- package/references/browser.extension.d.ts +0 -14
- package/types/network.d.ts +0 -184
- package/types/util.d.ts +0 -27
- package/types/wasm.d.ts +0 -217
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export function levenshtein(str1, str2) {
|
|
2
|
-
if (str1 === str2)
|
|
3
|
-
return 0;
|
|
4
|
-
if (str1.length === 0)
|
|
5
|
-
return str2.length;
|
|
6
|
-
if (str2.length === 0)
|
|
7
|
-
return str1.length;
|
|
8
|
-
const matrix = [];
|
|
9
|
-
for (let i = 0; i <= str2.length; i++) {
|
|
10
|
-
matrix[i] = [i];
|
|
11
|
-
}
|
|
12
|
-
for (let j = 0; j <= str1.length; j++) {
|
|
13
|
-
matrix[0][j] = j;
|
|
14
|
-
}
|
|
15
|
-
for (let i = 1; i <= str2.length; i++) {
|
|
16
|
-
for (let j = 1; j <= str1.length; j++) {
|
|
17
|
-
if (str2.charAt(i - 1) === str1.charAt(j - 1)) {
|
|
18
|
-
matrix[i][j] = matrix[i - 1][j - 1];
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, matrix[i][j - 1] + 1, matrix[i - 1][j] + 1);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return matrix[str2.length][str1.length];
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=levenshtein.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"levenshtein.js","sourceRoot":"","sources":["../../../src/functions/string/levenshtein.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,IAAY;IACpD,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,CAAC,CAAA;IAC3B,IAAI,IAAI,CAAC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,CAAC,EACpB,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CACrB,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function mask(str: string, type?: 'phone' | 'email' | 'card' | 'idcard' | 'name' | 'auto', maskChar?: string): string;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export function mask(str, type = 'auto', maskChar = '*') {
|
|
2
|
-
if (!str || typeof str !== 'string')
|
|
3
|
-
return str;
|
|
4
|
-
switch (type) {
|
|
5
|
-
case 'phone':
|
|
6
|
-
return str.replace(/^(\d{3})\d{4}(\d{4})$/, `$1${maskChar.repeat(4)}$2`);
|
|
7
|
-
case 'email':
|
|
8
|
-
return str.replace(/^(\w)\w*(@.+)$/, `$1${maskChar.repeat(3)}$2`);
|
|
9
|
-
case 'card':
|
|
10
|
-
return str.replace(/^(\d{4})\d+(\d{4})$/, `$1${maskChar.repeat(4)}$2`);
|
|
11
|
-
case 'idcard':
|
|
12
|
-
return str.replace(/^(\d{6})\d+(\d{4})$/, `$1${maskChar.repeat(4)}$2`);
|
|
13
|
-
case 'name':
|
|
14
|
-
return str.replace(/^(\w)\w*$/, `$1${maskChar}`);
|
|
15
|
-
case 'auto':
|
|
16
|
-
default:
|
|
17
|
-
if (str.length === 11 && /^1\d{10}$/.test(str)) {
|
|
18
|
-
return mask(str, 'phone', maskChar);
|
|
19
|
-
}
|
|
20
|
-
else if (str.includes('@')) {
|
|
21
|
-
return mask(str, 'email', maskChar);
|
|
22
|
-
}
|
|
23
|
-
else if (str.length >= 16 && /^\d+$/.test(str)) {
|
|
24
|
-
return mask(str, 'card', maskChar);
|
|
25
|
-
}
|
|
26
|
-
else if (str.length === 18 && /^\d{17}[\dXx]$/.test(str)) {
|
|
27
|
-
return mask(str, 'idcard', maskChar);
|
|
28
|
-
}
|
|
29
|
-
else if (str.length <= 4 && /^[\u4e00-\u9fa5a-zA-Z]+$/.test(str)) {
|
|
30
|
-
return mask(str, 'name', maskChar);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
const len = str.length;
|
|
34
|
-
if (len <= 2)
|
|
35
|
-
return str;
|
|
36
|
-
return str.charAt(0) + maskChar.repeat(len - 2) + str.charAt(len - 1);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=mask.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mask.js","sourceRoot":"","sources":["../../../src/functions/string/mask.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,IAAI,CAClB,GAAW,EACX,OAAgE,MAAM,EACtE,WAAmB,GAAG;IAEtB,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IAE/C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YAEV,OAAO,GAAG,CAAC,OAAO,CAAC,uBAAuB,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAE1E,KAAK,OAAO;YAEV,OAAO,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAEnE,KAAK,MAAM;YAET,OAAO,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAExE,KAAK,QAAQ;YAEX,OAAO,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAExE,KAAK,MAAM;YAET,OAAO,GAAG,CAAC,OAAO,CAA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AC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export function normalize(str, options = {}) {
|
|
2
|
-
if (!str || typeof str !== 'string')
|
|
3
|
-
return str;
|
|
4
|
-
const { case: caseOption = 'none', trim = true, removeSpecial = false, removeNumbers = false, removePunctuation = false, normalizeWhitespace = true } = options;
|
|
5
|
-
let result = str;
|
|
6
|
-
if (removeSpecial) {
|
|
7
|
-
result = result.replace(/[^\w\s]/g, '');
|
|
8
|
-
}
|
|
9
|
-
if (removeNumbers) {
|
|
10
|
-
result = result.replace(/\d/g, '');
|
|
11
|
-
}
|
|
12
|
-
if (removePunctuation) {
|
|
13
|
-
result = result.replace(/[^\w\s]/g, '');
|
|
14
|
-
}
|
|
15
|
-
if (normalizeWhitespace) {
|
|
16
|
-
result = result.replace(/\s+/g, ' ');
|
|
17
|
-
}
|
|
18
|
-
if (trim) {
|
|
19
|
-
result = result.trim();
|
|
20
|
-
}
|
|
21
|
-
switch (caseOption) {
|
|
22
|
-
case 'lower':
|
|
23
|
-
result = result.toLowerCase();
|
|
24
|
-
break;
|
|
25
|
-
case 'upper':
|
|
26
|
-
result = result.toUpperCase();
|
|
27
|
-
break;
|
|
28
|
-
case 'title':
|
|
29
|
-
result = result.toLowerCase().replace(/\b\w/g, (char) => char.toUpperCase());
|
|
30
|
-
break;
|
|
31
|
-
case 'none':
|
|
32
|
-
default:
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=normalize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../src/functions/string/normalize.ts"],"names":[],"mappings":"AA0CA,MAAM,UAAU,SAAS,CACvB,GAAW,EACX,UAOI,EAAE;IAEN,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IAE/C,MAAM,EACJ,IAAI,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
1
|
-
export type PadDirection = 'start' | 'end' | 'both';
|
|
2
|
-
export interface PadOptions {
|
|
3
|
-
direction?: PadDirection;
|
|
4
|
-
padString?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface PadResult {
|
|
7
|
-
original: string;
|
|
8
|
-
padded: string;
|
|
9
|
-
paddedLength: number;
|
|
10
|
-
padDirection: PadDirection;
|
|
11
|
-
padCharacter: string;
|
|
12
|
-
}
|
|
13
|
-
export declare function pad(str: string, targetLength: number, options?: PadOptions, returnDetails?: boolean): string | PadResult;
|
|
14
|
-
export declare function padWithDetails(str: string, targetLength: number, options?: PadOptions): PadResult;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export function pad(str, targetLength, options = {}, returnDetails = false) {
|
|
2
|
-
const { direction = 'end', padString = ' ' } = options;
|
|
3
|
-
if (str.length >= targetLength) {
|
|
4
|
-
if (returnDetails) {
|
|
5
|
-
return {
|
|
6
|
-
original: str,
|
|
7
|
-
padded: str,
|
|
8
|
-
paddedLength: str.length,
|
|
9
|
-
padDirection: direction,
|
|
10
|
-
padCharacter: padString
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
return str;
|
|
14
|
-
}
|
|
15
|
-
const padLength = targetLength - str.length;
|
|
16
|
-
let padded;
|
|
17
|
-
switch (direction) {
|
|
18
|
-
case 'start': {
|
|
19
|
-
const pad = padString.repeat(Math.ceil(padLength / padString.length)).slice(0, padLength);
|
|
20
|
-
padded = pad + str;
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
case 'end': {
|
|
24
|
-
const pad = padString.repeat(Math.ceil(padLength / padString.length)).slice(0, padLength);
|
|
25
|
-
padded = str + pad;
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
case 'both': {
|
|
29
|
-
const leftPadLength = Math.floor(padLength / 2);
|
|
30
|
-
const rightPadLength = padLength - leftPadLength;
|
|
31
|
-
const leftPad = padString.repeat(Math.ceil(leftPadLength / padString.length)).slice(0, leftPadLength);
|
|
32
|
-
const rightPad = padString.repeat(Math.ceil(rightPadLength / padString.length)).slice(0, rightPadLength);
|
|
33
|
-
padded = leftPad + str + rightPad;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
default:
|
|
37
|
-
throw new Error(`Invalid pad direction: ${direction}`);
|
|
38
|
-
}
|
|
39
|
-
if (returnDetails) {
|
|
40
|
-
return {
|
|
41
|
-
original: str,
|
|
42
|
-
padded,
|
|
43
|
-
paddedLength: padded.length,
|
|
44
|
-
padDirection: direction,
|
|
45
|
-
padCharacter: padString
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return padded;
|
|
49
|
-
}
|
|
50
|
-
export function padWithDetails(str, targetLength, options = {}) {
|
|
51
|
-
return pad(str, targetLength, options, true);
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=pad.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pad.js","sourceRoot":"","sources":["../../../src/functions/string/pad.ts"],"names":[],"mappings":"AA2CA,MAAM,UAAU,GAAG,CACjB,GAAW,EACX,YAAoB,EACpB,UAAsB,EAAE,EACxB,gBAAyB,KAAK;IAE9B,MAAM,EAAE,SAAS,GAAG,KAAK,EAAE,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,CAAA;IAGtD,IAAI,GAAG,CAAC,MAAM,IAAI,YAAY,EAAE,CAAC;QAC/B,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO;gBACL,QAAQ,EAAE,GAAG;gBACb,MAAM,EAAE,GAAG;gBACX,YAAY,EAAE,GAAG,CAAC,MAAM;gBACxB,YAAY,EAAE,SAAS;gBACvB,YAAY,EAAE,SAAS;aACxB,CAAA;QACH,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,GAAG,GAAG,CAAC,MAAM,CAAA;IAC3C,IAAI,MAAc,CAAA;IAElB,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,OAAO,CA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AAY,EAAE,MAAM,CAAC,MAAM;YAC3B,YAAY,EAAE,SAAS;YACvB,YAAY,EAAE,SAAS;SACxB,CAAA;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAKD,MAAM,UAAU,cAAc,CAC5B,GAAW,EACX,YAAoB,EACpB,UAAsB,EAAE;IAExB,OAAO,GAAG,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,CAAc,CAAA;AAC3D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function padEnd(str: string, targetLength: number, padString?: string): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function padEnd(str, targetLength, padString = ' ') {
|
|
2
|
-
if (str.length >= targetLength)
|
|
3
|
-
return str;
|
|
4
|
-
const padLength = targetLength - str.length;
|
|
5
|
-
const pad = padString.repeat(Math.ceil(padLength / padString.length)).slice(0, padLength);
|
|
6
|
-
return str + pad;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=padEnd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"padEnd.js","sourceRoot":"","sources":["../../../src/functions/string/padEnd.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,YAAoB,EAAE,YAAoB,GAAG;IAC/E,IAAI,GAAG,CAAC,MAAM,IAAI,YAAY;QAAE,OAAO,GAAG,CAAA;IAE1C,MAAM,SAAS,GAAG,YAAY,GAAG,GAAG,CAAC,MAAM,CAAA;IAC3C,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IAEzF,OAAO,GAAG,GAAG,GAAG,CAAA;AAClB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function padStart(str: string, targetLength: number, padString?: string): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function padStart(str, targetLength, padString = ' ') {
|
|
2
|
-
if (str.length >= targetLength)
|
|
3
|
-
return str;
|
|
4
|
-
const padLength = targetLength - str.length;
|
|
5
|
-
const pad = padString.repeat(Math.ceil(padLength / padString.length)).slice(0, padLength);
|
|
6
|
-
return pad + str;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=padStart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"padStart.js","sourceRoot":"","sources":["../../../src/functions/string/padStart.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,YAAoB,EAAE,YAAoB,GAAG;IACjF,IAAI,GAAG,CAAC,MAAM,IAAI,YAAY;QAAE,OAAO,GAAG,CAAA;IAE1C,MAAM,SAAS,GAAG,YAAY,GAAG,GAAG,CAAC,MAAM,CAAA;IAC3C,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IAEzF,OAAO,GAAG,GAAG,GAAG,CAAA;AAClB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function palindrome(str, options = {}) {
|
|
2
|
-
if (!str || typeof str !== 'string')
|
|
3
|
-
return true;
|
|
4
|
-
const { strict = false } = options;
|
|
5
|
-
if (strict) {
|
|
6
|
-
return str === str.split('').reverse().join('');
|
|
7
|
-
}
|
|
8
|
-
const cleaned = str
|
|
9
|
-
.toLowerCase()
|
|
10
|
-
.replace(/[\s\p{P}]/gu, '');
|
|
11
|
-
if (cleaned.length <= 1)
|
|
12
|
-
return true;
|
|
13
|
-
return cleaned === cleaned.split('').reverse().join('');
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=palindrome.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"palindrome.js","sourceRoot":"","sources":["../../../src/functions/string/palindrome.ts"],"names":[],"mappings":"AAyBA,MAAM,UAAU,UAAU,CACxB,GAAW,EACX,UAEI,EAAE;IAEN,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAEhD,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,CAAA;IAElC,IAAI,MAAM,EAAE,CAAC;QAEX,OAAO,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjD,CAAC;IAGD,MAAM,OAAO,GAAG,GAAG;SAChB,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IAE7B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAEpC,OAAO,OAAO,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACzD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function pascalCase(str: string): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function pascalCase(str) {
|
|
2
|
-
if (!str)
|
|
3
|
-
return str;
|
|
4
|
-
const camelCaseStr = str
|
|
5
|
-
.replace(/[-_\s.]+(.)?/g, (_, char) => char ? char.toUpperCase() : '');
|
|
6
|
-
return camelCaseStr.charAt(0).toUpperCase() + camelCaseStr.slice(1);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=pascalCase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pascalCase.js","sourceRoot":"","sources":["../../../src/functions/string/pascalCase.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAA;IAEpB,MAAM,YAAY,GAAG,GAAG;SACrB,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAExE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function similarity(str1: string, str2: string): number;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { levenshtein } from './levenshtein';
|
|
2
|
-
export function similarity(str1, str2) {
|
|
3
|
-
if (str1 === str2)
|
|
4
|
-
return 1;
|
|
5
|
-
if (str1.length === 0 && str2.length === 0)
|
|
6
|
-
return 1;
|
|
7
|
-
if (str1.length === 0 || str2.length === 0)
|
|
8
|
-
return 0;
|
|
9
|
-
const distance = levenshtein(str1, str2);
|
|
10
|
-
const maxLength = Math.max(str1.length, str2.length);
|
|
11
|
-
return 1 - distance / maxLength;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=similarity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"similarity.js","sourceRoot":"","sources":["../../../src/functions/string/similarity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAyB3C,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAAY;IACnD,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,CAAC,CAAA;IAC3B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAA;IACpD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAA;IAEpD,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACxC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IAEpD,OAAO,CAAC,GAAG,QAAQ,GAAG,SAAS,CAAA;AACjC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function snakeCase(str: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snakeCase.js","sourceRoot":"","sources":["../../../src/functions/string/snakeCase.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAA;IAEpB,OAAO,GAAG;SACP,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;SACnC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC;SACzB,WAAW,EAAE;SACb,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;AAC5B,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function template(template, data, options = {}) {
|
|
2
|
-
if (!template || typeof template !== 'string')
|
|
3
|
-
return template;
|
|
4
|
-
const { placeholder = /{{([^}]+)}}/g, defaultValue = '' } = options;
|
|
5
|
-
return template.replace(placeholder, (match, key) => {
|
|
6
|
-
const keys = key.trim().split('.');
|
|
7
|
-
let value = data;
|
|
8
|
-
for (const k of keys) {
|
|
9
|
-
if (value == null)
|
|
10
|
-
return defaultValue;
|
|
11
|
-
if (k === 'length' && Array.isArray(value)) {
|
|
12
|
-
value = value.length;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
value = value[k];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return value != null ? String(value) : defaultValue;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/functions/string/template.ts"],"names":[],"mappings":"AA8BA,MAAM,UAAU,QAAQ,CACtB,QAAgB,EAChB,IAAyB,EACzB,UAGI,EAAE;IAEN,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAE9D,MAAM,EAAE,WAAW,GAAG,cAAc,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,OAAO,CAAA;IAEnE,OAAO,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAClD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClC,IAAI,KAAK,GAAQ,IAAI,CAAA;QAErB,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;YACrB,IAAI,KAAK,IAAI,IAAI;gBAAE,OAAO,YAAY,CAAA;YAEtC,IAAI,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3C,KAAK,GAAG,KAAK,CAAC,MAAM,CAAA;YACtB,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YAClB,CAAC;QACH,CAAC;QAED,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function unescape(str: string): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function unescape(str) {
|
|
2
|
-
if (!str)
|
|
3
|
-
return str;
|
|
4
|
-
const htmlUnescapes = {
|
|
5
|
-
'&': '&',
|
|
6
|
-
'<': '<',
|
|
7
|
-
'>': '>',
|
|
8
|
-
'"': '"',
|
|
9
|
-
''': "'"
|
|
10
|
-
};
|
|
11
|
-
return str.replace(/&(?:amp|lt|gt|quot|#39);/g, (match) => htmlUnescapes[match]);
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=unescape.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../../src/functions/string/unescape.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAA;IAEpB,MAAM,aAAa,GAA2B;QAC5C,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,GAAG;QACX,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,GAAG;KACb,CAAA;IAED,OAAO,GAAG,CAAC,OAAO,CAAC,2BAA2B,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;AAClF,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function wordCount(str, options = {}) {
|
|
2
|
-
if (!str || typeof str !== 'string')
|
|
3
|
-
return 0;
|
|
4
|
-
const { separator = /\s+/, includeEmpty = false, minLength = 0 } = options;
|
|
5
|
-
const words = str.split(separator);
|
|
6
|
-
if (includeEmpty) {
|
|
7
|
-
return words.filter(word => word.length >= minLength).length;
|
|
8
|
-
}
|
|
9
|
-
return words.filter(word => word.trim().length > minLength).length;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=wordCount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wordCount.js","sourceRoot":"","sources":["../../../src/functions/string/wordCount.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,SAAS,CACvB,GAAW,EACX,UAII,EAAE;IAEN,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAA;IAE7C,MAAM,EACJ,SAAS,GAAG,KAAK,EACjB,YAAY,GAAG,KAAK,EACpB,SAAS,GAAG,CAAC,EACd,GAAG,OAAO,CAAA;IAEX,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAElC,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC,MAAM,CAAA;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,MAAM,CAAA;AACpE,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const secretMap = {
|
|
2
|
-
personal: {
|
|
3
|
-
secretId: 'AKIDKVQ5VjiQu73j9IBnFRN2QYQ2MQEl22mI',
|
|
4
|
-
secretKey: 'IL7cqoWy94lDsGSXP9gxzkGXcSFrDJ8h',
|
|
5
|
-
},
|
|
6
|
-
individual: {
|
|
7
|
-
secretId: 'AKID2A6oIZcT5TcWBetteARULxKSM1ResARl',
|
|
8
|
-
secretKey: 'INFtISN3VmocDZgYBZicIitpWyEG4f2B',
|
|
9
|
-
},
|
|
10
|
-
enterprise: {
|
|
11
|
-
secretId: 'AKIDRhqpgKn46uVvACzd7ORGTbaLtHSSEn8H',
|
|
12
|
-
secretKey: '95tV4Ql02wpY5QaaOzTlrjOr8OQFsHUW',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export function getSecret(type) {
|
|
16
|
-
return secretMap[type];
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=getSecret.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSecret.js","sourceRoot":"","sources":["../../../src/functions/tencent-cloud/getSecret.ts"],"names":[],"mappings":"AAUA,MAAM,SAAS,GAA+B;IAC5C,QAAQ,EAAE;QAER,QAAQ,EAAE,sCAAsC;QAChD,SAAS,EAAE,kCAAkC;KAC9C;IACD,UAAU,EAAE;QAEV,QAAQ,EAAE,sCAAsC;QAChD,SAAS,EAAE,kCAAkC;KAC9C;IACD,UAAU,EAAE;QAEV,QAAQ,EAAE,sCAAsC;QAChD,SAAS,EAAE,kCAAkC;KAC9C;CACF,CAAA;AA6BD,MAAM,UAAU,SAAS,CAAC,IAAgB;IACxC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NodeFileSystem } from '../../../../references/node.d';
|
|
2
|
-
import type { SystemDependencies } from '../../../../types/android-build.d';
|
|
3
|
-
import type { AndroidProjectPaths } from './androidProjectStrategy';
|
|
4
|
-
export interface ConfigStepResult {
|
|
5
|
-
success: boolean;
|
|
6
|
-
message?: string;
|
|
7
|
-
data?: any;
|
|
8
|
-
}
|
|
9
|
-
export declare function copyAppResources(appid: string, distPath: string, paths: AndroidProjectPaths, fs: NodeFileSystem): Promise<ConfigStepResult>;
|
|
10
|
-
export declare function configureDcloudControl(appid: string, appkey: string, paths: AndroidProjectPaths, fs: NodeFileSystem, deps: SystemDependencies): Promise<ConfigStepResult>;
|
|
11
|
-
export declare function configureStrings(appname: string, paths: AndroidProjectPaths, fs: NodeFileSystem, deps: SystemDependencies): Promise<ConfigStepResult>;
|
|
12
|
-
export declare function configureAndroidManifest(channel: string, appkey: string, paths: AndroidProjectPaths, fs: NodeFileSystem, deps: SystemDependencies): Promise<ConfigStepResult>;
|
|
13
|
-
export declare function configureBuildGradle(appid: string, versionName: string, versionCode: number, paths: AndroidProjectPaths, fs: NodeFileSystem): Promise<ConfigStepResult>;
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
export async function copyAppResources(appid, distPath, paths, fs) {
|
|
2
|
-
try {
|
|
3
|
-
const sourcePath = `${distPath}/build/app`;
|
|
4
|
-
const targetPath = paths.getResourceTargetPath(appid);
|
|
5
|
-
if (!fs.existsSync(sourcePath)) {
|
|
6
|
-
return {
|
|
7
|
-
success: false,
|
|
8
|
-
message: `应用资源目录不存在: ${sourcePath}`
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
fs.mkdirSync(targetPath, { recursive: true });
|
|
12
|
-
await fs.promises.cp(sourcePath, targetPath, { recursive: true });
|
|
13
|
-
return {
|
|
14
|
-
success: true,
|
|
15
|
-
message: `应用资源已复制到: ${targetPath}`
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
return {
|
|
20
|
-
success: false,
|
|
21
|
-
message: `复制应用资源失败: ${error}`
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export async function configureDcloudControl(appid, appkey, paths, fs, deps) {
|
|
26
|
-
try {
|
|
27
|
-
const controlXmlPath = paths.controlXmlPath;
|
|
28
|
-
if (!fs.existsSync(controlXmlPath)) {
|
|
29
|
-
return {
|
|
30
|
-
success: false,
|
|
31
|
-
message: `dcloud_control.xml 文件不存在: ${controlXmlPath}`
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const controlXmlContent = fs.readFileSync(controlXmlPath, 'utf8');
|
|
35
|
-
const controlXmlDoc = deps.xmlParser.parseFromString(controlXmlContent, 'text/xml');
|
|
36
|
-
const appElements = controlXmlDoc.getElementsByTagName('app');
|
|
37
|
-
if (appElements.length > 0) {
|
|
38
|
-
const appElement = appElements[0];
|
|
39
|
-
appElement.setAttribute('appid', appid);
|
|
40
|
-
if (appkey) {
|
|
41
|
-
appElement.setAttribute('appkey', appkey);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const updatedControlXml = deps.xmlSerializer.serializeToString(controlXmlDoc);
|
|
45
|
-
fs.writeFileSync(controlXmlPath, updatedControlXml);
|
|
46
|
-
return {
|
|
47
|
-
success: true,
|
|
48
|
-
message: `dcloud_control.xml 配置完成: appid=${appid}`
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
return {
|
|
53
|
-
success: false,
|
|
54
|
-
message: `配置 dcloud_control.xml 失败: ${error}`
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export async function configureStrings(appname, paths, fs, deps) {
|
|
59
|
-
try {
|
|
60
|
-
const stringsXmlPath = paths.stringsXmlPath;
|
|
61
|
-
if (!fs.existsSync(stringsXmlPath)) {
|
|
62
|
-
return {
|
|
63
|
-
success: false,
|
|
64
|
-
message: `strings.xml 文件不存在: ${stringsXmlPath}`
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
const stringsXmlContent = fs.readFileSync(stringsXmlPath, 'utf8');
|
|
68
|
-
const stringsXmlDoc = deps.xmlParser.parseFromString(stringsXmlContent, 'text/xml');
|
|
69
|
-
const stringElements = stringsXmlDoc.getElementsByTagName('string');
|
|
70
|
-
let appNameFound = false;
|
|
71
|
-
for (let i = 0; i < stringElements.length; i++) {
|
|
72
|
-
const stringElement = stringElements[i];
|
|
73
|
-
if (stringElement.getAttribute('name') === 'app_name') {
|
|
74
|
-
stringElement.textContent = appname;
|
|
75
|
-
appNameFound = true;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (!appNameFound) {
|
|
80
|
-
return {
|
|
81
|
-
success: false,
|
|
82
|
-
message: 'strings.xml 中未找到 app_name 元素'
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
const updatedStringsXml = deps.xmlSerializer.serializeToString(stringsXmlDoc);
|
|
86
|
-
fs.writeFileSync(stringsXmlPath, updatedStringsXml);
|
|
87
|
-
return {
|
|
88
|
-
success: true,
|
|
89
|
-
message: `strings.xml 配置完成: app_name=${appname}`
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
return {
|
|
94
|
-
success: false,
|
|
95
|
-
message: `配置 strings.xml 失败: ${error}`
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
export async function configureAndroidManifest(channel, appkey, paths, fs, deps) {
|
|
100
|
-
try {
|
|
101
|
-
const manifestXmlPath = paths.manifestXmlPath;
|
|
102
|
-
if (!fs.existsSync(manifestXmlPath)) {
|
|
103
|
-
return {
|
|
104
|
-
success: false,
|
|
105
|
-
message: `AndroidManifest.xml 文件不存在: ${manifestXmlPath}`
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
const manifestXmlContent = fs.readFileSync(manifestXmlPath, 'utf8');
|
|
109
|
-
const manifestXmlDoc = deps.xmlParser.parseFromString(manifestXmlContent, 'text/xml');
|
|
110
|
-
const applicationElements = manifestXmlDoc.getElementsByTagName('application');
|
|
111
|
-
if (applicationElements.length > 0) {
|
|
112
|
-
const applicationElement = applicationElements[0];
|
|
113
|
-
let channelMetaDataFound = false;
|
|
114
|
-
const metaDataElements = applicationElement.getElementsByTagName('meta-data');
|
|
115
|
-
for (let i = 0; i < metaDataElements.length; i++) {
|
|
116
|
-
const metaDataElement = metaDataElements[i];
|
|
117
|
-
if (metaDataElement.getAttribute('android:name') === 'DCLOUD_STREAMAPP_CHANNEL') {
|
|
118
|
-
metaDataElement.setAttribute('android:value', channel);
|
|
119
|
-
channelMetaDataFound = true;
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (appkey) {
|
|
124
|
-
let appkeyMetaDataFound = false;
|
|
125
|
-
for (let i = 0; i < metaDataElements.length; i++) {
|
|
126
|
-
const metaDataElement = metaDataElements[i];
|
|
127
|
-
if (metaDataElement.getAttribute('android:name') === 'dcloud_appkey') {
|
|
128
|
-
metaDataElement.setAttribute('android:value', appkey);
|
|
129
|
-
appkeyMetaDataFound = true;
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
const updatedManifestXml = deps.xmlSerializer.serializeToString(manifestXmlDoc);
|
|
136
|
-
fs.writeFileSync(manifestXmlPath, updatedManifestXml);
|
|
137
|
-
return {
|
|
138
|
-
success: true,
|
|
139
|
-
message: `AndroidManifest.xml 配置完成: channel=${channel}, appkey=${appkey}`
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
return {
|
|
144
|
-
success: false,
|
|
145
|
-
message: `配置 AndroidManifest.xml 失败: ${error}`
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
export async function configureBuildGradle(appid, versionName, versionCode, paths, fs) {
|
|
150
|
-
try {
|
|
151
|
-
const buildGradlePath = paths.buildGradlePath;
|
|
152
|
-
if (!fs.existsSync(buildGradlePath)) {
|
|
153
|
-
return {
|
|
154
|
-
success: false,
|
|
155
|
-
message: `build.gradle 文件不存在: ${buildGradlePath}`
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
let buildGradleContent = fs.readFileSync(buildGradlePath, 'utf8');
|
|
159
|
-
buildGradleContent = buildGradleContent.replace(/applicationId\s+["'][^"']*["']/, `applicationId "${appid}"`);
|
|
160
|
-
buildGradleContent = buildGradleContent.replace(/versionName\s+["'][^"']*["']/, `versionName "${versionName}"`);
|
|
161
|
-
buildGradleContent = buildGradleContent.replace(/versionCode\s+\d+/, `versionCode ${versionCode}`);
|
|
162
|
-
fs.writeFileSync(buildGradlePath, buildGradleContent);
|
|
163
|
-
return {
|
|
164
|
-
success: true,
|
|
165
|
-
message: `build.gradle 配置完成: applicationId=${appid}, versionName=${versionName}, versionCode=${versionCode}`
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
return {
|
|
170
|
-
success: false,
|
|
171
|
-
message: `配置 build.gradle 失败: ${error}`
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
//# sourceMappingURL=androidProjectConfigSteps.js.map
|