天下无坑

天下无坑


阅读类库代码dump()

console.dump = function(o, exclude = []){
    // exclude['number','string','boolean','null','undefined','object','function']
    let functions = []
    for(let k in o) {
        let type = typeof o[k]
        if (exclude.includes(type)) continue
        if(type == 'function') {
            let mathes = /[^(]+\(([^)]*)?\)/gm.exec(Function.prototype.toString.call(o[k]));
            functions.push(mathes['input'])
        } else {
            console.log(k, type, o[k])
        }
    }
    console.table(functions)
}

页面列表

ITEM_HTML