From e6ffaf5f321aeea8bb6531b183be16053bef1aec Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sun, 18 Mar 2018 04:03:24 -0400 Subject: [PATCH] tidy --- src/keys.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keys.js b/src/keys.js index 7a97c3f..7bd0d10 100644 --- a/src/keys.js +++ b/src/keys.js @@ -8,17 +8,17 @@ let BUFFER = Symbol() let array let recurse = obj => { - let temp switch (typeof obj === 'object' && obj !== null && Object.getPrototypeOf(obj)) { case Array.prototype: array.push(ARRAY, obj.length) for (let i = 0; i < obj.length; i++) i in obj ? recurse(obj[i]) : array.push(HOLE) break - case Object.prototype: - temp = [...Object.getOwnPropertyNames(obj).sort(), ...Object.getOwnPropertySymbols(obj)] + case Object.prototype: { + let temp = [...Object.getOwnPropertyNames(obj).sort(), ...Object.getOwnPropertySymbols(obj)] array.push(OBJECT, temp.length, ...temp) temp.forEach(key => recurse(obj[key])) break + } case RegExp.prototype: array.push(REGEXP, obj.toString()) break