inertia-sails
Version:
The Sails adapter for Inertia.
13 lines (11 loc) • 299 B
JavaScript
/**
* @typedef {import('../types').InertiaProps} InertiaProps
*/
/**
* @param {InertiaProps} props
* @param {string[]} [only]
* @returns {InertiaProps}
*/
module.exports = function getPartialData(props, only = []) {
return Object.assign({}, ...only.map((key) => ({ [key]: props[key] })))
}