UNPKG

@nuxt/content

Version:

Write your content inside your Nuxt app

7 lines (6 loc) 223 B
export function pick(keys) { return (obj) => { obj = obj || {}; return (keys || []).filter((key) => typeof obj[key] !== "undefined").reduce((newObj, key) => Object.assign(newObj, { [key]: obj[key] }), {}); }; }