Skip to content

Instantly share code, notes, and snippets.

@wkentdag
Last active September 22, 2016 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkentdag/9dac7d7154831145ad3b368263fa9d66 to your computer and use it in GitHub Desktop.
Save wkentdag/9dac7d7154831145ad3b368263fa9d66 to your computer and use it in GitHub Desktop.
let relevant = ['ID', 'author', 'date', 'modified', 'title', 'URL', 'content', 'excerpt', 'slug', 'status', 'type', 'comment_count', 'featured_image', 'tags', 'categories', 'attachments']
return Object.keys(post).filter(prop => relevant.includes(prop)).map(prop => {
switch (prop) {
case 'foo':
break
default:
console.log(prop)
return post[prop]
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment