mirror of
https://github.com/cupcakearmy/morphus.git
synced 2025-09-06 00:00:40 +00:00
stuff
This commit is contained in:
@@ -2,9 +2,10 @@ import { config, StorageType } from '../dist/src/config.js'
|
||||
|
||||
const schema = config._def
|
||||
|
||||
function stringAsMarkdownCode(string) {
|
||||
return '`' + string + '`'
|
||||
}
|
||||
const asInlineCode = (s) => '`' + s + '`'
|
||||
const formatInline = (s, empty = '') => (s === undefined ? empty : asInlineCode(s))
|
||||
const formatEnv = (s) => formatInline(s, 'not supported')
|
||||
const formatDefault = (s) => formatInline(s, '')
|
||||
|
||||
for (const storage of Object.values(StorageType)) {
|
||||
const storageType = schema[storage]
|
||||
@@ -13,7 +14,21 @@ for (const storage of Object.values(StorageType)) {
|
||||
| ---------------- | ------------------ | ------- | ------------------------ |
|
||||
`
|
||||
for (const [key, value] of Object.entries(storageType)) {
|
||||
table += `| \`${storage}.${key}\` | \`${value.env}\` | ${value.default} | ${value.doc} |\n`
|
||||
table += `| \`${storage}.${key}\` | ${formatEnv(value.env)} | ${formatDefault(value.default)} | ${value.doc} |\n`
|
||||
}
|
||||
|
||||
console.log(table)
|
||||
}
|
||||
|
||||
{
|
||||
let table = `
|
||||
| Config | Environment | Default | Description |
|
||||
| ------- | ----------- | ------- | ------------ |
|
||||
`
|
||||
|
||||
for (const [key, value] of Object.entries(schema)) {
|
||||
if (Object.values(StorageType).includes(key)) continue
|
||||
table += `| ${asInlineCode(key)} | ${formatEnv(value.env)} | ${formatDefault(value.default)} | ${value.doc} |\n`
|
||||
}
|
||||
|
||||
console.log(table)
|
||||
|
Reference in New Issue
Block a user