List all keys

pull/296/head
Anton Medvedev 2 months ago
parent 34ce8a70f0
commit f3af6a086d
No known key found for this signature in database

@ -9,8 +9,10 @@ Object.prototype.__keys = function () {
if (this instanceof String) return
if (typeof this === 'object' && this !== null)
Object.keys(this)
.filter(x => /^\w+$/.test(x))
.forEach(x => __keys.add('.' + x))
.forEach(x => /^\w+$/.test(x) ?
__keys.add('.' + x) :
__keys.add('.[' + JSON.stringify(x) + ']')
)
}
function apply(fn, ...args) {

Loading…
Cancel
Save