Created
May 19, 2017 06:48
-
-
Save rohmanhm/a60cf6d36b440f426b742f9250e638af to your computer and use it in GitHub Desktop.
computedStyle to object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function serializeComputedStyle (computed) { | |
const result = {} | |
Object.keys(computed).forEach(key => { | |
if (!Number(key) && !(Number(key) <= 0)) { | |
result[key] = computed[key] | |
} | |
}) | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment