统一格式化参数的方法

This commit is contained in:
fofolee
2025-01-06 09:43:48 +08:00
parent d98966a5b0
commit 2dbd6f0c50
16 changed files with 130 additions and 144 deletions

View File

@@ -67,8 +67,7 @@ import VariableInput from "components/composer/ui/VariableInput.vue";
import NumberInput from "components/composer/ui/NumberInput.vue";
import ArrayEditor from "components/composer/ui/ArrayEditor.vue";
import {
stringifyWithType,
stringifyObject,
stringifyArgv,
parseToHasType,
parseFunction,
} from "js/composer/formatString";
@@ -129,11 +128,7 @@ export default defineComponent({
},
generateCode(funcName, argvs) {
const newArgvs = argvs
.map((argv) => {
return typeof argv === "string"
? stringifyWithType(argv)
: stringifyObject(argv);
})
.map((argv) => stringifyArgv(argv))
.filter((item) => item != null && item !== "");
console.log(newArgvs);
return `${funcName}(${newArgvs.join(",")})`;