mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
fix: sources json view
This commit is contained in:
@@ -3,7 +3,15 @@ import beautify from 'js-beautify'
|
||||
import highlight from '../lib/highlight'
|
||||
import JsonViewer from '../lib/JsonViewer'
|
||||
import Settings from '../Settings/Settings'
|
||||
import { evalCss, ajax, isEmpty, escape, trim, isStr } from '../lib/util'
|
||||
import {
|
||||
evalCss,
|
||||
ajax,
|
||||
isEmpty,
|
||||
escape,
|
||||
trim,
|
||||
isStr,
|
||||
stringifyAll
|
||||
} from '../lib/util'
|
||||
|
||||
export default class Sources extends Tool {
|
||||
constructor() {
|
||||
@@ -256,7 +264,10 @@ export default class Sources extends Tool {
|
||||
let val = this._data.val
|
||||
|
||||
try {
|
||||
if (isStr(val)) val = JSON.parse(val)
|
||||
if (isStr(val)) {
|
||||
val = JSON.parse(val)
|
||||
val = stringifyAll(val)
|
||||
}
|
||||
/* eslint-disable no-empty */
|
||||
} catch (e) {}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Logger } from './util'
|
||||
|
||||
let logger
|
||||
|
||||
export default (logger = new Logger(
|
||||
export default logger = new Logger(
|
||||
'[Eruda]',
|
||||
ENV === 'production' ? 'warn' : 'debug'
|
||||
))
|
||||
)
|
||||
|
||||
logger.formatter = function(type, argList) {
|
||||
argList.unshift(this.name)
|
||||
|
||||
Reference in New Issue
Block a user