From 07cd6f513561ed3b15d77af8c4c6ea629d24c459 Mon Sep 17 00:00:00 2001 From: zWing <371657110@qq.com> Date: Fri, 28 Jun 2024 03:43:35 +0000 Subject: [PATCH] fix: fix code style --- src/code-gen-process.js | 51 ++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/src/code-gen-process.js b/src/code-gen-process.js index c2d96afe..7c6664e2 100644 --- a/src/code-gen-process.js +++ b/src/code-gen-process.js @@ -209,29 +209,54 @@ class CodeGenProcess { Ts: this.config.Ts, formatDescription: this.schemaParserFabric.schemaFormatters.formatDescription.bind( - this.schemaParserFabric.schemaFormatters, - ), + this.schemaParserFabric.schemaFormatters, + ), internalCase: internalCase, classNameCase: pascalCase, pascalCase: pascalCase, - getInlineParseContent: this.schemaParserFabric.getInlineParseContent.bind(this.schemaParserFabric), - getParseContent: this.schemaParserFabric.getParseContent.bind(this.schemaParserFabric), - getComponentByRef: this.schemaComponentsMap.get.bind(this.schemaComponentsMap), - parseSchema: this.schemaParserFabric.parseSchema.bind(this.schemaParserFabric), - checkAndAddNull: this.schemaParserFabric.schemaUtils.safeAddNullToType.bind(this.schemaParserFabric.schemaUtils), + getInlineParseContent: + this.schemaParserFabric.getInlineParseContent.bind( + this.schemaParserFabric, + ), + getParseContent: this.schemaParserFabric.getParseContent.bind( + this.schemaParserFabric, + ), + getComponentByRef: this.schemaComponentsMap.get.bind( + this.schemaComponentsMap, + ), + parseSchema: this.schemaParserFabric.parseSchema.bind( + this.schemaParserFabric, + ), + checkAndAddNull: + this.schemaParserFabric.schemaUtils.safeAddNullToType.bind( + this.schemaParserFabric.schemaUtils, + ), safeAddNullToType: - this.schemaParserFabric.schemaUtils.safeAddNullToType.bind(this.schemaParserFabric.schemaUtils), + this.schemaParserFabric.schemaUtils.safeAddNullToType.bind( + this.schemaParserFabric.schemaUtils, + ), isNeedToAddNull: - this.schemaParserFabric.schemaUtils.isNullMissingInType.bind(this.schemaParserFabric.schemaUtils), - inlineExtraFormatters: this.schemaParserFabric.schemaFormatters.inline.bind(this.schemaParserFabric.schemaFormatters), - formatters: this.schemaParserFabric.schemaFormatters.base.bind(this.schemaParserFabric.schemaFormatters), - formatModelName: this.typeNameFormatter.format.bind(this.typeNameFormatter), + this.schemaParserFabric.schemaUtils.isNullMissingInType.bind( + this.schemaParserFabric.schemaUtils, + ), + inlineExtraFormatters: + this.schemaParserFabric.schemaFormatters.inline.bind( + this.schemaParserFabric.schemaFormatters, + ), + formatters: this.schemaParserFabric.schemaFormatters.base.bind( + this.schemaParserFabric.schemaFormatters, + ), + formatModelName: this.typeNameFormatter.format.bind( + this.typeNameFormatter, + ), fmtToJSDocLine: function fmtToJSDocLine(line, { eol = true }) { return ` * ${line}${eol ? "\n" : ""}`; }, NameResolver: NameResolver, _, - require: this.templatesWorker.requireFnFromTemplate.bind(this.templatesWorker), + require: this.templatesWorker.requireFnFromTemplate.bind( + this.templatesWorker, + ), }, config: this.config, };