graphql-codegen-modules-gen
Advanced tools
Comparing version 1.7.0 to 1.8.0
{ | ||
"name": "graphql-codegen-modules-gen", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -132,17 +132,14 @@ import { | ||
const list = enums[key]; | ||
let keyWOEnum = key.replace("Enum", ""); | ||
let enumFileData = `import { ${key} } from '$graphql/_gen/clientTypes'; | ||
export function getList${key}() { | ||
\tlet items: { key: ${key}; value: string }[] = []; | ||
export const ${keyWOEnum}List: Record<string, ${key}> = { | ||
\t${list | ||
.map((c) => { | ||
return `items.push({ key: ${key}.${toPascalCase( | ||
return `'${toPascalCase(c.toLowerCase())}' : ${key}.${toPascalCase( | ||
c.toLowerCase() | ||
)}, value: '${toPascalCase(c.toLowerCase())}' });`; | ||
)},`; | ||
}) | ||
.join("\n\t")} | ||
\treturn items; | ||
} | ||
.join("\n\t")} | ||
}; | ||
`; | ||
@@ -155,6 +152,8 @@ // Write this file only if it doesn't exist! | ||
if ( | ||
!existsSync(join(modulePath, "_enums", "ui", "lists", `List${key}.ts`)) | ||
!existsSync( | ||
join(modulePath, "_enums", "ui", "lists", `${keyWOEnum}List.ts`) | ||
) | ||
) { | ||
writeFileSync( | ||
join(modulePath, "_enums", "ui", "lists", `List${key}.ts`), | ||
join(modulePath, "_enums", "ui", "lists", `${keyWOEnum}List.ts`), | ||
enumFileData | ||
@@ -161,0 +160,0 @@ ); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30919
792