7460aa65eaed08b9df459dbd4d4eceebad3f79eeb875514b88a6ca1eb14b58ab.json 753 B

1
  1. {"ast":null,"code":"import { map } from './map';\nexport function pluck(...properties) {\n const length = properties.length;\n if (length === 0) {\n throw new Error('list of properties cannot be empty.');\n }\n return source => map(plucker(properties, length))(source);\n}\nfunction plucker(props, length) {\n const mapper = x => {\n let currentProp = x;\n for (let i = 0; i < length; i++) {\n const p = currentProp != null ? currentProp[props[i]] : undefined;\n if (p !== void 0) {\n currentProp = p;\n } else {\n return undefined;\n }\n }\n return currentProp;\n };\n return mapper;\n}\n//# sourceMappingURL=pluck.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}