Skip to content

Instantly share code, notes, and snippets.

@rohmanhm
Created May 19, 2017 06:48
Show Gist options
  • Save rohmanhm/a60cf6d36b440f426b742f9250e638af to your computer and use it in GitHub Desktop.
Save rohmanhm/a60cf6d36b440f426b742f9250e638af to your computer and use it in GitHub Desktop.
computedStyle to object
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