// sanitizer removes unused fields from data
const sanitizer = (item, fieldsToSend) => Object.keys(item).reduce((sanitizedItem, key) => {
    if (fieldsToSend.indexOf(key) === -1)
        return sanitizedItem;
    return Object.assign(Object.assign({}, sanitizedItem), { 
        // @ts-ignore
        [key]: item[key] });
}, {});
export default sanitizer;
//# sourceMappingURL=sanitizer.js.map