111
jihongshun
8 天以前 0c741cdda7ef9935a20d3090dfea97e1ce8ae754
1
2
3
4
5
6
7
8
9
10
11
12
export function isJSON(str) {
    if (typeof str == 'string') {
        try {
            JSON.parse(str)
            return true
        } catch (e) {
            return false
        }
    } else {
        return false
    }
}