minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / operators / pluck.js
1 import { map } from './map';
2 export function pluck(...properties) {
3     const length = properties.length;
4     if (length === 0) {
5         throw new Error('list of properties cannot be empty.');
6     }
7     return (source) => map(plucker(properties, length))(source);
8 }
9 function plucker(props, length) {
10     const mapper = (x) => {
11         let currentProp = x;
12         for (let i = 0; i < length; i++) {
13             const p = currentProp != null ? currentProp[props[i]] : undefined;
14             if (p !== void 0) {
15                 currentProp = p;
16             }
17             else {
18                 return undefined;
19             }
20         }
21         return currentProp;
22     };
23     return mapper;
24 }
25 //# sourceMappingURL=pluck.js.map