Browse Source

[Fix-16786][Datasource] Fix jdbc connect parameters json validation question (#16787)

dev
小可耐 3 weeks ago committed by GitHub
parent
commit
a68c2a6aa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      dolphinscheduler-ui/src/utils/json.ts

8
dolphinscheduler-ui/src/utils/json.ts

@ -19,18 +19,12 @@
* 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
}
return !!(typeof obj === 'object' && obj && !Array.isArray(obj))
} catch (e) {
return false
}
}
}
export default isJson

Loading…
Cancel
Save