1 | import type { Config } from './generateCode.js'
|
2 |
|
3 | export const title = (title: string) => {
|
4 | const titleDecorated = `// ${title}\n// ${`-`.repeat(title.length)}\n`
|
5 | return titleDecorated
|
6 | }
|
7 | export const typeTitle = (config: Config, typeName: string) => {
|
8 |
|
9 |
|
10 | const hasItems = config.typeMapByKind[`GraphQL${typeName}Type`]?.length > 0
|
11 | const title = `${typeName} Types`
|
12 | const titleDecorated = `// ${title}\n// ${`-`.repeat(title.length)}\n`
|
13 | if (hasItems) {
|
14 | return titleDecorated
|
15 | } else {
|
16 | return `${titleDecorated}\n// -- None --\n`
|
17 | }
|
18 | }
|