frontend/.pnpm-store/v3/files/de/be27ddeac0d67e8393e2bb1eb56404e08430ec5eabfa8064fe68e1dc10e7094b1da4e6ce7fa6994ad8d0aa06ea7261f3dbf5ab10dad6bac7d34c0ba8a16f1c

21 lines
643 B
Plaintext

import { map } from './map';
export function pluck(...properties) {
const length = properties.length;
if (length === 0) {
throw new Error('list of properties cannot be empty.');
}
return map((x) => {
let currentProp = x;
for (let i = 0; i < length; i++) {
const p = currentProp === null || currentProp === void 0 ? void 0 : currentProp[properties[i]];
if (typeof p !== 'undefined') {
currentProp = p;
}
else {
return undefined;
}
}
return currentProp;
});
}
//# sourceMappingURL=pluck.js.map