Skip to content

Commit 8d06b0c

Browse files
committed
chore: iterate
1 parent 319dbd0 commit 8d06b0c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/common.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ export const ROOT_DIR = path.resolve(process.cwd(), '..');
3030

3131
// Build `GENERATORS` from the `clients.config.json` file
3232
export const GENERATORS = Object.entries(clientsConfig).reduce(
33-
(current, [language, { clients, folder, ...gen }]) => {
34-
for (const client of clients) {
35-
let output = folder;
33+
(current, [language, opts]) => {
34+
if (typeof opts === 'string'){
35+
return current;
36+
}
37+
38+
for (const client of opts.clients) {
39+
let output = opts.folder;
3640
let key = '';
3741
let clientName = '';
3842

@@ -47,7 +51,7 @@ export const GENERATORS = Object.entries(clientsConfig).reduce(
4751

4852
current[key] = {
4953
additionalProperties: {},
50-
...gen,
54+
...opts,
5155
output,
5256
client: clientName,
5357
language: language as Language,

0 commit comments

Comments
 (0)