Every line of 'lodash map' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
11 function __map(f: Arity2, list: List<a>): List<b> { 12 const itemCount = list.length 13 const newList = Array(itemCount) 14 15 for (let i = 0; i < itemCount; ++i) newList[i] = f(list[i], i) 16 17 return newList 18 }</b></a>
16 function map(list) { 17 return list.Links.Members.map(member => { 18 var url = member.href.split('/'), 19 id = url.pop(); 20 if (!id) { id = url.pop(); } 21 setTimeout(self.read.bind(self, id), 0); 22 return { id }; 23 }); 24 }
123 function map (lst, f) { 124 requires(lst === null || lst instanceof List); 125 requires(spec(f, x => true, x => pure())); 126 ensures(pure()); 127 ensures(res => res === null || res instanceof List); 128 129 if (lst === null) return null; 130 return new List(f(lst.head), map(lst.tail, f)); 131 }
29 function mapObjToArray(obj, key = 'name') { 30 return _.map(obj, (v, k) => Object.assign(v, {[key]: k})); 31 }
1642 function map (xs, f) { 1643 if (xs.map) return xs.map(f); 1644 var res = []; 1645 for (var i = 0; i < xs.length; i++) { 1646 res.push(f(xs[i], i)); 1647 } 1648 return res; 1649 }
14 map(mapFn) { 15 return this.__doCollectionTransform(map(item => mapFn(item, item, ...this.__selfParam))); 16 }
74 function map_( 75 ma: StreamEither, 76 f: (a: A) => B 77 ): StreamEither { 78 return S.stream.map(ma, ea => { 79 if (Ei.isLeft(ea)) { 80 return Ei.left(ea.left); 81 } else { 82 return Ei.right(f(ea.right)); 83 } 84 }); 85 }
13 function map (array, func) { 14 return array.reduce((acc, curr) => { 15 acc.push(func(curr)); 16 return acc; 17 }, []); 18 }
29 function toList() { 30 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 31 args[_key] = arguments[_key]; 32 } 33 34 return args.map(function (v) { 35 return { 36 text: v, 37 value: v 38 }; 39 }); 40 }
31 export function map(source: vscode.ProviderResult, f: (t: T) => U): U[] | vscode.ProviderResult { 32 if (isThenable(source)) { 33 return mapThenable(source, f); 34 } 35 if (!source) { 36 return source; 37 } 38 return source.map(f); 39 }