18 lines
402 B
JavaScript
18 lines
402 B
JavaScript
export function normalizeText(value) {
|
|
return String(value || '').trim()
|
|
}
|
|
|
|
export function isPlainObject(value) {
|
|
return Boolean(value) && typeof value === 'object' && !Array.isArray(value)
|
|
}
|
|
|
|
export function readConfigJson(value) {
|
|
if (isPlainObject(value?.configJson)) {
|
|
return value.configJson
|
|
}
|
|
if (isPlainObject(value?.config_json)) {
|
|
return value.config_json
|
|
}
|
|
return {}
|
|
}
|