refactor(audit): reuse list shells and split models
This commit is contained in:
17
web/src/views/scripts/auditViewDataUtils.js
Normal file
17
web/src/views/scripts/auditViewDataUtils.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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 {}
|
||||
}
|
||||
Reference in New Issue
Block a user