mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-29 18:58:05 +08:00
[Fix-16786][Datasource] Fix jdbc connect parameters json validation question (#16787)
This commit is contained in:
parent
53efdaa6c8
commit
a68c2a6aa2
@ -19,17 +19,11 @@
|
||||
* Verify if it is in json format
|
||||
*/
|
||||
const isJson = (str: string) => {
|
||||
if (typeof str === 'string') {
|
||||
try {
|
||||
const obj = JSON.parse(str)
|
||||
if (typeof obj === 'object' && obj) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
const obj = JSON.parse(str)
|
||||
return !!(typeof obj === 'object' && obj && !Array.isArray(obj))
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user