Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/doveadm.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
import { getVitepressMd } from './markdown.js'
import { loadData, normalizeArrayData } from './utility.js'
import { logger } from './logger.js'
import camelCase from 'camelcase'
import cleanDeep from 'clean-deep'
import slugify from '@sindresorhus/slugify'

/* List of Doveadm argument value types. */
export const doveadm_arg_types = {
export const doveadm_arg_types = new Proxy({
ARRAY: 1,
BOOL: 2,
INTEGER: 3,
STRING: 4,
SEARCH_QUERY: 5, // Search query is an ARG_ARRAY
ISTREAM: 6,
}
}, {
get(target, prop) {
if (prop in target || typeof prop === 'symbol') {
return target[prop]
}
const err = new Error(`Invalid doveadm_arg_types key: ${String(prop)}`)
const stack = err.stack.split('\n')
const caller = stack[2] ? stack[2].trim().replace(/^at /, '') : 'unknown location'

logger.fatal(`${err.message}\n Invalid access at ${caller}`)
}
})

/* List of Doveadm flag value types. */
export const doveadm_flag_types = {
Expand Down
Loading