Skip to content

Commit b8901c4

Browse files
committed
_
Signed-off-by: Sora Morimoto <[email protected]>
1 parent c0b6cfd commit b8901c4

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

cli/process-option.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const processFlags = (flags) => {
1616
const isNoFlag = flags.includes("--no-");
1717

1818
const strArr = lodash.compact(
19-
lodash.split(flags, " ").map((str) => str.replace(/,/g, "")),
19+
flags.split(" ").map((str) => str.replace(/,/g, "")),
2020
);
2121

2222
for (const str of strArr) {

src/schema-parser/schema-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SchemaUtils {
2727

2828
getRequiredProperties = (schema) => {
2929
return lodash.uniq(
30-
(schema && lodash.isArray(schema.required) && schema.required) || [],
30+
(schema && Array.isArray(schema.required) && schema.required) || [],
3131
);
3232
};
3333

src/swagger-schema-resolver.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,7 @@ class SwaggerSchemaResolver {
181181
}
182182

183183
lodash.each(originalRouteParams, (originalRouteParam) => {
184-
const existUsageParam = lodash.find(
185-
usageRouteParams,
184+
const existUsageParam = usageRouteParams.find(
186185
(param) =>
187186
originalRouteParam.in === param.in &&
188187
originalRouteParam.name === param.name,

src/templates-worker.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ class TemplatesWorker {
6161

6262
cropExtension = (path) =>
6363
this.config.templateExtensions.reduce(
64-
(path, ext) =>
65-
lodash.endsWith(path, ext) ? path.replace(ext, "") : path,
64+
(path, ext) => (path.endsWith(ext) ? path.replace(ext, "") : path),
6665
path,
6766
);
6867

@@ -79,8 +78,7 @@ class TemplatesWorker {
7978

8079
requireFnFromTemplate = async (packageOrPath) => {
8180
const isPath =
82-
lodash.startsWith(packageOrPath, "./") ||
83-
lodash.startsWith(packageOrPath, "../");
81+
packageOrPath.startsWith("./") || packageOrPath.startsWith("../");
8482

8583
if (isPath) {
8684
return await import(
@@ -112,7 +110,7 @@ class TemplatesWorker {
112110

113111
if (fileContent) {
114112
this.logger.log(
115-
`"${lodash.lowerCase(name)}" template found in "${templatePaths.custom}"`,
113+
`"${name.toLowerCase()}" template found in "${templatePaths.custom}"`,
116114
);
117115
return fileContent;
118116
}
@@ -124,16 +122,14 @@ class TemplatesWorker {
124122
} else {
125123
if (templatePaths.custom) {
126124
this.logger.warn(
127-
`"${lodash.lowerCase(name)}" template not found in "${
125+
`"${name.toLowerCase()}" template not found in "${
128126
templatePaths.custom
129127
}"`,
130128
"\nCode generator will use the default template",
131129
);
132130
} else {
133131
this.logger.log(
134-
`Code generator will use the default template for "${lodash.lowerCase(
135-
name,
136-
)}"`,
132+
`Code generator will use the default template for "${name.toLowerCase()}"`,
137133
);
138134
}
139135
}
@@ -178,11 +174,10 @@ class TemplatesWorker {
178174
getTemplateContent = (path) => {
179175
const foundTemplatePathKey = lodash
180176
.keys(this.config.templatePaths)
181-
.find((key) => lodash.startsWith(path, `@${key}`));
177+
.find((key) => path.startsWith(`@${key}`));
182178

183179
const rawPath = resolve(
184-
lodash.replace(
185-
path,
180+
path.replace(
186181
`@${foundTemplatePathKey}`,
187182
this.config.templatePaths[foundTemplatePathKey],
188183
),

src/type-name-formatter.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ class TypeNameFormatter {
5959

6060
const fixedModelName = this.fixModelName(name, { type: schemaType });
6161

62-
const formattedName = lodash.replace(
63-
lodash.startCase(`${typePrefix}_${fixedModelName}_${typeSuffix}`),
64-
/\s/g,
65-
"",
66-
);
62+
const formattedName = lodash
63+
.startCase(`${typePrefix}_${fixedModelName}_${typeSuffix}`)
64+
.replace(
65+
/\s/g,
66+
"",
67+
);
6768
const formattedResultName =
6869
this.config.hooks.onFormatTypeName(formattedName, name, schemaType) ||
6970
formattedName;

0 commit comments

Comments
 (0)