api-farmer 0.0.24 → 0.0.25
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.
|
@@ -61,9 +61,11 @@ function transformEntity({ path, method, base, uncountableNouns }) {
|
|
|
61
61
|
return entity;
|
|
62
62
|
}
|
|
63
63
|
word = word.replace(/\.([a-z])/g, (_, p) => p.toUpperCase());
|
|
64
|
-
|
|
64
|
+
const isUncountableNoun = uncountableNouns.includes(word);
|
|
65
|
+
word = pascalCase(word);
|
|
66
|
+
word = isUncountableNoun ? word : pluralize.singular(word);
|
|
65
67
|
if (method === "get" && index === words.length - 1) {
|
|
66
|
-
word =
|
|
68
|
+
word = isUncountableNoun ? `${word}List` : pluralize.plural(word);
|
|
67
69
|
}
|
|
68
70
|
return `${entity}${word}`;
|
|
69
71
|
}, "");
|
package/dist/cli.cjs
CHANGED
|
@@ -174,9 +174,11 @@ function transformEntity({ path, method, base, uncountableNouns }) {
|
|
|
174
174
|
return entity;
|
|
175
175
|
}
|
|
176
176
|
word = word.replace(/\.([a-z])/g, (_, p) => p.toUpperCase());
|
|
177
|
-
|
|
177
|
+
const isUncountableNoun = uncountableNouns.includes(word);
|
|
178
|
+
word = (0, import_rattail2.pascalCase)(word);
|
|
179
|
+
word = isUncountableNoun ? word : import_pluralize.default.singular(word);
|
|
178
180
|
if (method === "get" && index === words.length - 1) {
|
|
179
|
-
word =
|
|
181
|
+
word = isUncountableNoun ? `${word}List` : import_pluralize.default.plural(word);
|
|
180
182
|
}
|
|
181
183
|
return `${entity}${word}`;
|
|
182
184
|
}, "");
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import { Command } from "commander";
|
|
|
8
8
|
var program = new Command();
|
|
9
9
|
program.version(getCliVersion());
|
|
10
10
|
program.action(async () => {
|
|
11
|
-
const { generate } = await import("./generate-
|
|
11
|
+
const { generate } = await import("./generate-UUTBYLAG.js");
|
|
12
12
|
return generate();
|
|
13
13
|
});
|
|
14
14
|
program.parse();
|
package/dist/index.cjs
CHANGED
|
@@ -93,9 +93,11 @@ function transformEntity({ path, method, base, uncountableNouns }) {
|
|
|
93
93
|
return entity;
|
|
94
94
|
}
|
|
95
95
|
word = word.replace(/\.([a-z])/g, (_, p) => p.toUpperCase());
|
|
96
|
-
|
|
96
|
+
const isUncountableNoun = uncountableNouns.includes(word);
|
|
97
|
+
word = (0, import_rattail.pascalCase)(word);
|
|
98
|
+
word = isUncountableNoun ? word : import_pluralize.default.singular(word);
|
|
97
99
|
if (method === "get" && index === words.length - 1) {
|
|
98
|
-
word =
|
|
100
|
+
word = isUncountableNoun ? `${word}List` : import_pluralize.default.plural(word);
|
|
99
101
|
}
|
|
100
102
|
return `${entity}${word}`;
|
|
101
103
|
}, "");
|
package/dist/index.js
CHANGED