/// declare var $: any, jQuery: any; interface IFoodOrganic { name: string; organic: boolean; } interface IFoodType { name: string; type: string; } interface IFoodCombined { name: string; organic: boolean; type: string; } interface IStoogesQuote { name: string; quotes: string[]; } interface IStoogesAge { name: string; age: number; } interface IStoogesCombined { name: string; age: number; quotes: string[]; } interface IKey { dir: string; code: number; } interface IDictionary { [index: string]: T; } var foodsOrganic: IFoodOrganic[] = [ { name: 'banana', organic: true }, { name: 'beet', organic: false }, ]; var foodsType: IFoodType[] = [ { name: 'apple', type: 'fruit' }, { name: 'banana', type: 'fruit' }, { name: 'beet', type: 'vegetable' } ]; var foodsCombined: IFoodCombined[] = [ { 'name': 'apple', 'organic': false, 'type': 'fruit' }, { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } ]; var stoogesQuotes: IStoogesQuote[] = [ { 'name': 'curly', 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] }, { 'name': 'moe', 'quotes': ['Spread out!', 'You knucklehead!'] } ]; var stoogesAges: IStoogesAge[] = [ { 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 } ]; var stoogesAgesDict: IDictionary = { first: { 'name': 'moe', 'age': 40 }, second: { 'name': 'larry', 'age': 50 } }; var stoogesCombined: IStoogesCombined[] = [ { 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] }, { 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] } ]; var keys: IKey[] = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code': 100 } ]; class Dog { constructor(public name: string) { } public bark() { console.log('Woof, woof!'); } } var result: any; var any: any; interface TResult { a: number; b: string; c: boolean; } // _.MapCache var testMapCache: _.MapCache; result = <(key: string) => boolean>testMapCache.delete; result = <(key: string) => any>testMapCache.get; result = <(key: string) => boolean>testMapCache.has; result = <(key: string, value: any) => _.Dictionary>testMapCache.set; // _ namespace TestWrapper { { let result: _.LoDashImplicitWrapper; result = _(''); } { let result: _.LoDashImplicitWrapper; result = _(42); } { let result: _.LoDashImplicitWrapper; result = _(true); } { let result: _.LoDashImplicitArrayWrapper; result = _(['']); } { let result: _.LoDashImplicitObjectWrapper<{a: string}>; result = _<{a: string}>({a: ''}); } } //Wrapped array shortcut methods result = _([1, 2, 3, 4]).pop(); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).push(5, 6, 7); result = _([1, 2, 3, 4]).shift(); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).sort((a, b) => 1); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).splice(1); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).splice(1, 2, 5, 6); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).unshift(5, 6); /********* * Array * *********/ // _.chunk namespace TestChunk { let array: TResult[]; let list: _.List; { let result: TResult[][]; result = _.chunk(array); result = _.chunk(array, 42); result = _.chunk(list); result = _.chunk(list, 42); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).chunk(); result = _(array).chunk(42); result = _(list).chunk(); result = _(list).chunk(42); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().chunk(); result = _(array).chain().chunk(42); result = _(list).chain().chunk(); result = _(list).chain().chunk(42); } } // _.compact namespace TestCompact { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.compact(); result = _.compact(array); result = _.compact(list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).compact(); result = _(list).compact(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().compact(); result = _(list).chain().compact(); } } // _.difference namespace TestDifference { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.difference(array); result = _.difference(array, array); result = _.difference(array, list, array); result = _.difference(array, array, list, array); result = _.difference(list); result = _.difference(list, list); result = _.difference(list, array, list); result = _.difference(list, list, array, list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).difference(); result = _(array).difference(array); result = _(array).difference(list, array); result = _(array).difference(array, list, array); result = _(list).difference(); result = _(list).difference(list); result = _(list).difference(array, list); result = _(list).difference(list, array, list); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().difference(); result = _(array).chain().difference(array); result = _(array).chain().difference(list, array); result = _(array).chain().difference(array, list, array); result = _(list).chain().difference(); result = _(list).chain().difference(list); result = _(list).chain().difference(array, list); result = _(list).chain().difference(list, array, list); } } // _.differenceBy namespace TestDifferenceBy { let array: TResult[]; let list: _.List; let iteratee: (value: TResult) => any; { let result: TResult[]; result = _.differenceBy(array, array); result = _.differenceBy(array, list, array); result = _.differenceBy(array, array, list, array); result = _.differenceBy(array, list, array, list, array); result = _.differenceBy(array, array, list, array, list, array); result = _.differenceBy(array, list, array, list, array, list, array); result = _.differenceBy(array, array, iteratee); result = _.differenceBy(array, list, array, iteratee); result = _.differenceBy(array, array, list, array, iteratee); result = _.differenceBy(array, list, array, list, array, iteratee); result = _.differenceBy(array, array, list, array, list, array, iteratee); result = _.differenceBy(array, list, array, list, array, list, array, iteratee); result = _.differenceBy(array, array, 'a'); result = _.differenceBy(array, list, array, 'a'); result = _.differenceBy(array, array, list, array, 'a'); result = _.differenceBy(array, list, array, list, array, 'a'); result = _.differenceBy(array, array, list, array, list, array, 'a'); result = _.differenceBy(array, list, array, list, array, list, array, 'a'); result = _.differenceBy(array, array, {a: 1}); result = _.differenceBy(array, list, array, {a: 1}); result = _.differenceBy(array, array, list, array, {a: 1}); result = _.differenceBy(array, list, array, list, array, {a: 1}); result = _.differenceBy(array, array, list, array, list, array, {a: 1}); result = _.differenceBy(array, list, array, list, array, list, array, {a: 1}); result = _.differenceBy(list, list); result = _.differenceBy(list, array, list); result = _.differenceBy(list, list, array, list); result = _.differenceBy(list, array, list, array, list); result = _.differenceBy(list, list, array, list, array, list); result = _.differenceBy(list, array, list, array, list, array, list); result = _.differenceBy(list, list, iteratee); result = _.differenceBy(list, array, list, iteratee); result = _.differenceBy(list, list, array, list, iteratee); result = _.differenceBy(list, array, list, array, list, iteratee); result = _.differenceBy(list, list, array, list, array, list, iteratee); result = _.differenceBy(list, array, list, array, list, array, list, iteratee); result = _.differenceBy(list, list, 'a'); result = _.differenceBy(list, array, list, 'a'); result = _.differenceBy(list, list, array, list, 'a'); result = _.differenceBy(list, array, list, array, list, 'a'); result = _.differenceBy(list, list, array, list, array, list, 'a'); result = _.differenceBy(list, array, list, array, list, array, list, 'a'); result = _.differenceBy(list, list, {a: 1}); result = _.differenceBy(list, array, list, {a: 1}); result = _.differenceBy(list, list, array, list, {a: 1}); result = _.differenceBy(list, array, list, array, list, {a: 1}); result = _.differenceBy(list, list, array, list, array, list, {a: 1}); result = _.differenceBy(list, array, list, array, list, array, list, {a: 1}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).differenceBy(array); result = _(array).differenceBy(list, array); result = _(array).differenceBy(array, list, array); result = _(array).differenceBy(list, array, list, array); result = _(array).differenceBy(array, list, array, list, array); result = _(array).differenceBy(list, array, list, array, list, array); result = _(array).differenceBy(array, iteratee); result = _(array).differenceBy(list, array, iteratee); result = _(array).differenceBy(array, list, array, iteratee); result = _(array).differenceBy(list, array, list, array, iteratee); result = _(array).differenceBy(array, list, array, list, array, iteratee); result = _(array).differenceBy(list, array, list, array, list, array, iteratee); result = _(array).differenceBy(array, 'a'); result = _(array).differenceBy(list, array, 'a'); result = _(array).differenceBy(array, list, array, 'a'); result = _(array).differenceBy(list, array, list, array, 'a'); result = _(array).differenceBy(array, list, array, list, array, 'a'); result = _(array).differenceBy(list, array, list, array, list, array, 'a'); result = _(array).differenceBy(array, {a: 1}); result = _(array).differenceBy(list, array, {a: 1}); result = _(array).differenceBy(array, list, array, {a: 1}); result = _(array).differenceBy(list, array, list, array, {a: 1}); result = _(array).differenceBy(array, list, array, list, array, {a: 1}); result = _(array).differenceBy(list, array, list, array, list, array, {a: 1}); result = _(list).differenceBy(list); result = _(list).differenceBy(array, list); result = _(list).differenceBy(list, array, list); result = _(list).differenceBy(array, list, array, list); result = _(list).differenceBy(list, array, list, array, list); result = _(list).differenceBy(array, list, array, list, array, list); result = _(list).differenceBy(list, iteratee); result = _(list).differenceBy(array, list, iteratee); result = _(list).differenceBy(list, array, list, iteratee); result = _(list).differenceBy(array, list, array, list, iteratee); result = _(list).differenceBy(list, array, list, array, list, iteratee); result = _(list).differenceBy(array, list, array, list, array, list, iteratee); result = _(list).differenceBy(list, 'a'); result = _(list).differenceBy(array, list, 'a'); result = _(list).differenceBy(list, array, list, 'a'); result = _(list).differenceBy(array, list, array, list, 'a'); result = _(list).differenceBy(list, array, list, array, list, 'a'); result = _(list).differenceBy(array, list, array, list, array, list, 'a'); result = _(list).differenceBy(list, {a: 1}); result = _(list).differenceBy(array, list, {a: 1}); result = _(list).differenceBy(list, array, list, {a: 1}); result = _(list).differenceBy(array, list, array, list, {a: 1}); result = _(list).differenceBy(list, array, list, array, list, {a: 1}); result = _(list).differenceBy(array, list, array, list, array, list, {a: 1}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().differenceBy(array); result = _(array).chain().differenceBy(list, array); result = _(array).chain().differenceBy(array, list, array); result = _(array).chain().differenceBy(list, array, list, array); result = _(array).chain().differenceBy(array, list, array, list, array); result = _(array).chain().differenceBy(list, array, list, array, list, array); result = _(array).chain().differenceBy(array, iteratee); result = _(array).chain().differenceBy(list, array, iteratee); result = _(array).chain().differenceBy(array, list, array, iteratee); result = _(array).chain().differenceBy(list, array, list, array, iteratee); result = _(array).chain().differenceBy(array, list, array, list, array, iteratee); result = _(array).chain().differenceBy(list, array, list, array, list, array, iteratee); result = _(array).chain().differenceBy(array, 'a'); result = _(array).chain().differenceBy(list, array, 'a'); result = _(array).chain().differenceBy(array, list, array, 'a'); result = _(array).chain().differenceBy(list, array, list, array, 'a'); result = _(array).chain().differenceBy(array, list, array, list, array, 'a'); result = _(array).chain().differenceBy(list, array, list, array, list, array, 'a'); result = _(array).chain().differenceBy(array, {a: 1}); result = _(array).chain().differenceBy(list, array, {a: 1}); result = _(array).chain().differenceBy(array, list, array, {a: 1}); result = _(array).chain().differenceBy(list, array, list, array, {a: 1}); result = _(array).chain().differenceBy(array, list, array, list, array, {a: 1}); result = _(array).chain().differenceBy(list, array, list, array, list, array, {a: 1}); result = _(list).chain().differenceBy(list); result = _(list).chain().differenceBy(array, list); result = _(list).chain().differenceBy(list, array, list); result = _(list).chain().differenceBy(array, list, array, list); result = _(list).chain().differenceBy(list, array, list, array, list); result = _(list).chain().differenceBy(array, list, array, list, array, list); result = _(list).chain().differenceBy(list, iteratee); result = _(list).chain().differenceBy(array, list, iteratee); result = _(list).chain().differenceBy(list, array, list, iteratee); result = _(list).chain().differenceBy(array, list, array, list, iteratee); result = _(list).chain().differenceBy(list, array, list, array, list, iteratee); result = _(list).chain().differenceBy(array, list, array, list, array, list, iteratee); result = _(list).chain().differenceBy(list, 'a'); result = _(list).chain().differenceBy(array, list, 'a'); result = _(list).chain().differenceBy(list, array, list, 'a'); result = _(list).chain().differenceBy(array, list, array, list, 'a'); result = _(list).chain().differenceBy(list, array, list, array, list, 'a'); result = _(list).chain().differenceBy(array, list, array, list, array, list, 'a'); result = _(list).chain().differenceBy(list, {a: 1}); result = _(list).chain().differenceBy(array, list, {a: 1}); result = _(list).chain().differenceBy(list, array, list, {a: 1}); result = _(list).chain().differenceBy(array, list, array, list, {a: 1}); result = _(list).chain().differenceBy(list, array, list, array, list, {a: 1}); result = _(list).chain().differenceBy(array, list, array, list, array, list, {a: 1}); } } // _.drop { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.drop(array); result = _.drop(array, 42); result = _.drop(list); result = _.drop(list, 42); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).drop(); result = _(array).drop(42); result = _(list).drop(); result = _(list).drop(42); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().drop(); result = _(array).chain().drop(42); result = _(list).chain().drop(); result = _(list).chain().drop(42); } } // _.dropRight namespace TestDropRight { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.dropRight(array); result = _.dropRight(array, 42); result = _.dropRight(list); result = _.dropRight(list, 42); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRight(); result = _(array).dropRight(42); result = _(list).dropRight(); result = _(list).dropRight(42); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRight(); result = _(array).chain().dropRight(42); result = _(list).chain().dropRight(); result = _(list).chain().dropRight(42); } } // _.dropRightWhile namespace TestDropRightWhile { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index: number, collection: _.List) => boolean; { let result: TResult[]; result = _.dropRightWhile(array); result = _.dropRightWhile(array, predicateFn); result = _.dropRightWhile(array, predicateFn, any); result = _.dropRightWhile(array, ''); result = _.dropRightWhile(array, '', any); result = _.dropRightWhile<{a: number;}, TResult>(array, {a: 42}); result = _.dropRightWhile(list); result = _.dropRightWhile(list, predicateFn); result = _.dropRightWhile(list, predicateFn, any); result = _.dropRightWhile(list, ''); result = _.dropRightWhile(list, '', any); result = _.dropRightWhile<{a: number;}, TResult>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).dropRightWhile(); result = _(array).dropRightWhile(predicateFn); result = _(array).dropRightWhile(predicateFn, any); result = _(array).dropRightWhile(''); result = _(array).dropRightWhile('', any); result = _(array).dropRightWhile<{a: number;}>({a: 42}); result = _(list).dropRightWhile(); result = _(list).dropRightWhile(predicateFn); result = _(list).dropRightWhile(predicateFn, any); result = _(list).dropRightWhile(''); result = _(list).dropRightWhile('', any); result = _(list).dropRightWhile<{a: number;}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropRightWhile(); result = _(array).chain().dropRightWhile(predicateFn); result = _(array).chain().dropRightWhile(predicateFn, any); result = _(array).chain().dropRightWhile(''); result = _(array).chain().dropRightWhile('', any); result = _(array).chain().dropRightWhile<{a: number;}>({a: 42}); result = _(list).chain().dropRightWhile(); result = _(list).chain().dropRightWhile(predicateFn); result = _(list).chain().dropRightWhile(predicateFn, any); result = _(list).chain().dropRightWhile(''); result = _(list).chain().dropRightWhile('', any); result = _(list).chain().dropRightWhile<{a: number;}, TResult>({a: 42}); } } // _.dropWhile namespace TestDropWhile { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index: number, collection: _.List) => boolean; { let result: TResult[]; result = _.dropWhile(array); result = _.dropWhile(array, predicateFn); result = _.dropWhile(array, predicateFn, any); result = _.dropWhile(array, ''); result = _.dropWhile(array, '', any); result = _.dropWhile<{a: number;}, TResult>(array, {a: 42}); result = _.dropWhile(list); result = _.dropWhile(list, predicateFn); result = _.dropWhile(list, predicateFn, any); result = _.dropWhile(list, ''); result = _.dropWhile(list, '', any); result = _.dropWhile<{a: number;}, TResult>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).dropWhile(); result = _(array).dropWhile(predicateFn); result = _(array).dropWhile(predicateFn, any); result = _(array).dropWhile(''); result = _(array).dropWhile('', any); result = _(array).dropWhile<{a: number;}>({a: 42}); result = _(list).dropWhile(); result = _(list).dropWhile(predicateFn); result = _(list).dropWhile(predicateFn, any); result = _(list).dropWhile(''); result = _(list).dropWhile('', any); result = _(list).dropWhile<{a: number;}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().dropWhile(); result = _(array).chain().dropWhile(predicateFn); result = _(array).chain().dropWhile(predicateFn, any); result = _(array).chain().dropWhile(''); result = _(array).chain().dropWhile('', any); result = _(array).chain().dropWhile<{a: number;}>({a: 42}); result = _(list).chain().dropWhile(); result = _(list).chain().dropWhile(predicateFn); result = _(list).chain().dropWhile(predicateFn, any); result = _(list).chain().dropWhile(''); result = _(list).chain().dropWhile('', any); result = _(list).chain().dropWhile<{a: number;}, TResult>({a: 42}); } } // _.fill namespace TestFill { let array: number[]; let list: _.List; { let result: number[]; result = _.fill(array, 42); result = _.fill(array, 42, 0); result = _.fill(array, 42, 0, 10); } { let result: _.List; result = _.fill(list, 42); result = _.fill(list, 42, 0); result = _.fill(list, 42, 0, 10); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).fill(42); result = _(array).fill(42, 0); result = _(array).fill(42, 0, 10); } { let result: _.LoDashImplicitObjectWrapper<_.List>; result = _(list).fill(42); result = _(list).fill(42, 0); result = _(list).fill(42, 0, 10); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().fill(42); result = _(array).chain().fill(42, 0); result = _(array).chain().fill(42, 0, 10); } { let result: _.LoDashExplicitObjectWrapper<_.List>; result = _(list).chain().fill(42); result = _(list).chain().fill(42, 0); result = _(list).chain().fill(42, 0, 10); } } // _.findIndex namespace TestFindIndex { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index?: number, collection?: _.List) => boolean; { let result: number; result = _.findIndex(array); result = _.findIndex(array, predicateFn); result = _.findIndex(array, predicateFn, any); result = _.findIndex(array, ''); result = _.findIndex(array, '', any); result = _.findIndex<{a: number}, TResult>(array, {a: 42}); result = _.findIndex(list); result = _.findIndex(list, predicateFn); result = _.findIndex(list, predicateFn, any); result = _.findIndex(list, ''); result = _.findIndex(list, '', any); result = _.findIndex<{a: number}, TResult>(list, {a: 42}); result = _(array).findIndex(); result = _(array).findIndex(predicateFn); result = _(array).findIndex(predicateFn, any); result = _(array).findIndex(''); result = _(array).findIndex('', any); result = _(array).findIndex<{a: number}>({a: 42}); result = _(list).findIndex(); result = _(list).findIndex(predicateFn); result = _(list).findIndex(predicateFn, any); result = _(list).findIndex(''); result = _(list).findIndex('', any); result = _(list).findIndex<{a: number}>({a: 42}); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().findIndex(); result = _(array).chain().findIndex(predicateFn); result = _(array).chain().findIndex(predicateFn, any); result = _(array).chain().findIndex(''); result = _(array).chain().findIndex('', any); result = _(array).chain().findIndex<{a: number}>({a: 42}); result = _(list).chain().findIndex(); result = _(list).chain().findIndex(predicateFn); result = _(list).chain().findIndex(predicateFn, any); result = _(list).chain().findIndex(''); result = _(list).chain().findIndex('', any); result = _(list).chain().findIndex<{a: number}>({a: 42}); } } // _.findLastIndex namespace TestFindLastIndex { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index?: number, collection?: _.List) => boolean; { let result: number; result = _.findLastIndex(array); result = _.findLastIndex(array, predicateFn); result = _.findLastIndex(array, predicateFn, any); result = _.findLastIndex(array, ''); result = _.findLastIndex(array, '', any); result = _.findLastIndex<{a: number}, TResult>(array, {a: 42}); result = _.findLastIndex(list); result = _.findLastIndex(list, predicateFn); result = _.findLastIndex(list, predicateFn, any); result = _.findLastIndex(list, ''); result = _.findLastIndex(list, '', any); result = _.findLastIndex<{a: number}, TResult>(list, {a: 42}); result = _(array).findLastIndex(); result = _(array).findLastIndex(predicateFn); result = _(array).findLastIndex(predicateFn, any); result = _(array).findLastIndex(''); result = _(array).findLastIndex('', any); result = _(array).findLastIndex<{a: number}>({a: 42}); result = _(list).findLastIndex(); result = _(list).findLastIndex(predicateFn); result = _(list).findLastIndex(predicateFn, any); result = _(list).findLastIndex(''); result = _(list).findLastIndex('', any); result = _(list).findLastIndex<{a: number}>({a: 42}); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().findLastIndex(); result = _(array).chain().findLastIndex(predicateFn); result = _(array).chain().findLastIndex(predicateFn, any); result = _(array).chain().findLastIndex(''); result = _(array).chain().findLastIndex('', any); result = _(array).chain().findLastIndex<{a: number}>({a: 42}); result = _(list).chain().findLastIndex(); result = _(list).chain().findLastIndex(predicateFn); result = _(list).chain().findLastIndex(predicateFn, any); result = _(list).chain().findLastIndex(''); result = _(list).chain().findLastIndex('', any); result = _(list).chain().findLastIndex<{a: number}>({a: 42}); } } // _.first namespace TestFirst { let array: TResult[]; let list: _.List; { let result: string; result = _.first('abc'); result = _('abc').first(); } { let result: TResult; result = _.first(array); result = _.first(list); result = _(array).first(); result = _(list).first(); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().first(); } { let result: _.LoDashExplicitObjectWrapper; result = _(array).chain().first<_.LoDashExplicitObjectWrapper>(); result = _(list).chain().first<_.LoDashExplicitObjectWrapper>(); } } // _.flatten namespace TestFlatten { { let result: string[]; result = _.flatten('abc'); } { let result: number[]; result = _.flatten([1, 2, 3]); result = _.flatten([1, [2, 3]]); result = _.flatten([1, [2, [3]]], true); result = _.flatten([1, [2, [3]], [[4]]], true); result = _.flatten({0: 1, 1: 2, 2: 3, length: 3}); result = _.flatten({0: 1, 1: [2, 3], length: 2}); result = _.flatten({0: 1, 1: [2, [3]], length: 2}, true); result = _.flatten({0: 1, 1: [2, [3]], 2: [[4]], length: 3}, true); } { let result: _.RecursiveArray; result = _.flatten([1, [2, [3]]]); result = _.flatten([1, [2, [3]], [[4]]]); result = _.flatten({0: 1, 1: [2, [3]], length: 2}); result = _.flatten({0: 1, 1: [2, [3]], 2: [[4]], length: 3}); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').flatten(); } { let result: _.LoDashImplicitArrayWrapper; result = _([1, 2, 3]).flatten(); result = _([1, [2, 3]]).flatten(); result = _([1, [2, [3]]]).flatten(true); result = _([1, [2, [3]], [[4]]]).flatten(true); result = _({0: 1, 1: 2, 2: 3, length: 3}).flatten(); result = _({0: 1, 1: [2, 3], length: 2}).flatten(); result = _({0: 1, 1: [2, [3]], length: 2}).flatten(true); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flatten(true); } { let result: _.LoDashImplicitArrayWrapper; result = _([1, [2, [3]]]).flatten(); result = _([1, [2, [3]], [[4]]]).flatten(); result = _({0: 1, 1: [2, [3]], length: 2}).flatten(); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flatten(); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().flatten(); } { let result: _.LoDashExplicitArrayWrapper; result = _([1, 2, 3]).chain().flatten(); result = _([1, [2, 3]]).chain().flatten(); result = _([1, [2, [3]]]).chain().flatten(true); result = _([1, [2, [3]], [[4]]]).chain().flatten(true); result = _({0: 1, 1: 2, 2: 3, length: 3}).chain().flatten(); result = _({0: 1, 1: [2, 3], length: 2}).chain().flatten(); result = _({0: 1, 1: [2, [3]], length: 2}).chain().flatten(true); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flatten(true); } { let result: _.LoDashExplicitArrayWrapper; result = _([1, [2, [3]]]).chain().flatten(); result = _([1, [2, [3]], [[4]]]).chain().flatten(); result = _({0: 1, 1: [2, [3]], length: 2}).chain().flatten(); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flatten(); } } // _.flattenDeep namespace TestFlattenDeep { { let result: string[]; result = _.flattenDeep('abc'); } { let result: number[]; result = _.flattenDeep([1, 2, 3]); result = _.flattenDeep([1, [2, 3]]); result = _.flattenDeep([1, [2, [3]]]); result = _.flattenDeep([1, [2, [3]], [[4]]]); result = _.flattenDeep({0: 1, 1: 2, 2: 3, length: 3}); result = _.flattenDeep({0: 1, 1: [2, 3], length: 2}); result = _.flattenDeep({0: 1, 1: [2, [3]], length: 2}); result = _.flattenDeep({0: 1, 1: [2, [3]], 2: [[4]], length: 3}); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').flattenDeep(); } { let result: _.LoDashImplicitArrayWrapper; result = _([1, 2, 3]).flattenDeep(); result = _([1, [2, 3]]).flattenDeep(); result = _([1, [2, [3]]]).flattenDeep(); result = _([1, [2, [3]], [[4]]]).flattenDeep(); result = _({0: 1, 1: 2, 2: 3, length: 3}).flattenDeep(); result = _({0: 1, 1: [2, 3], length: 2}).flattenDeep(); result = _({0: 1, 1: [2, [3]], length: 2}).flattenDeep(); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flattenDeep(); } { let result: _.LoDashImplicitArrayWrapper; result = _([1, [2, [3]]]).flattenDeep(); result = _([1, [2, [3]], [[4]]]).flattenDeep(); result = _({0: 1, 1: [2, [3]], length: 2}).flattenDeep(); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).flattenDeep(); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().flattenDeep(); } { let result: _.LoDashExplicitArrayWrapper; result = _([1, 2, 3]).chain().flattenDeep(); result = _([1, [2, 3]]).chain().flattenDeep(); result = _([1, [2, [3]]]).chain().flattenDeep(); result = _([1, [2, [3]], [[4]]]).chain().flattenDeep(); result = _({0: 1, 1: 2, 2: 3, length: 3}).chain().flattenDeep(); result = _({0: 1, 1: [2, 3], length: 2}).chain().flattenDeep(); result = _({0: 1, 1: [2, [3]], length: 2}).chain().flattenDeep(); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flattenDeep(); } { let result: _.LoDashExplicitArrayWrapper; result = _([1, [2, [3]]]).chain().flattenDeep(); result = _([1, [2, [3]], [[4]]]).chain().flattenDeep(); result = _({0: 1, 1: [2, [3]], length: 2}).chain().flattenDeep(); result = _({0: 1, 1: [2, [3]], 2: [[4]], length: 3}).chain().flattenDeep(); } } // _.head namespace TestHead { let array: TResult[]; let list: _.List; { let result: string; result = _.head('abc'); result = _('abc').head(); } { let result: TResult; result = _.head(array); result = _.head(list); result = _(array).head(); result = _(list).head(); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().head(); } { let result: _.LoDashExplicitObjectWrapper; result = _(array).chain().head<_.LoDashExplicitObjectWrapper>(); result = _(list).chain().head<_.LoDashExplicitObjectWrapper>(); } } // _.indexOf namespace TestIndexOf { let array: TResult[]; let list: _.List; let value: TResult; { let result: number; result = _.indexOf(array, value); result = _.indexOf(array, value, true); result = _.indexOf(array, value, 42); result = _.indexOf(list, value); result = _.indexOf(list, value, true); result = _.indexOf(list, value, 42); result = _(array).indexOf(value); result = _(array).indexOf(value, true); result = _(array).indexOf(value, 42); result = _(list).indexOf(value); result = _(list).indexOf(value, true); result = _(list).indexOf(value, 42); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().indexOf(value); result = _(array).chain().indexOf(value, true); result = _(array).chain().indexOf(value, 42); result = _(list).chain().indexOf(value); result = _(list).chain().indexOf(value, true); result = _(list).chain().indexOf(value, 42); } } // _.sortedIndexOf namespace TestIndexOf { let array: TResult[]; let list: _.List; let value: TResult; { let result: number; result = _.sortedIndexOf(array, value); result = _.sortedIndexOf(list, value); result = _(array).sortedIndexOf(value); result = _(list).sortedIndexOf(value); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().sortedIndexOf(value); result = _(list).chain().sortedIndexOf(value); } } //_.initial namespace TestInitial { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.initial(array); result = _.initial(list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).initial(); result = _(list).initial(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().initial(); result = _(list).chain().initial(); } } // _.intersection namespace TestIntersection { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.intersection(array, list); result = _.intersection(list, array, list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).intersection(array); result = _(array).intersection(list, array); result = _(list).intersection(array); result = _(list).intersection(list, array); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().intersection(array); result = _(array).chain().intersection(list, array); result = _(list).chain().intersection(array); result = _(list).chain().intersection(list, array); } } // _.join namespace TestJoin { let array = [1, 2]; let list = {0: 1, 1: 2, length: 2}; { let result: string; result = _.join('abc'); result = _.join('abc', '_'); result = _.join(array); result = _.join(array, '_'); result = _.join(list); result = _.join(list, '_'); result = _('abc').join(); result = _('abc').join('_'); result = _(array).join(); result = _(array).join('_'); result = _(list).join(); result = _(list).join('_'); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().join(); result = _('abc').chain().join('_'); result = _(array).chain().join(); result = _(array).chain().join('_'); result = _(list).chain().join(); result = _(list).chain().join('_'); } } // _.last namespace TestLast { let array: TResult[]; let list: _.List; { let result: string; result = _.last('abc'); result = _('abc').last(); } { let result: TResult; result = _.last(array); result = _.last(list); result = _(array).last(); result = _(list).last(); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().last(); } { let result: _.LoDashExplicitObjectWrapper; result = _(array).chain().last<_.LoDashExplicitObjectWrapper>(); } { let result: _.LoDashExplicitObjectWrapper; result = _(list).chain().last<_.LoDashExplicitObjectWrapper>(); } } // _.lastIndexOf namespace TestLastIndexOf { let array: TResult[]; let list: _.List; let value: TResult; { let result: number; result = _.lastIndexOf(array, value); result = _.lastIndexOf(array, value, true); result = _.lastIndexOf(array, value, 42); result = _.lastIndexOf(list, value); result = _.lastIndexOf(list, value, true); result = _.lastIndexOf(list, value, 42); result = _(array).lastIndexOf(value); result = _(array).lastIndexOf(value, true); result = _(array).lastIndexOf(value, 42); result = _(list).lastIndexOf(value); result = _(list).lastIndexOf(value, true); result = _(list).lastIndexOf(value, 42); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().lastIndexOf(value); result = _(array).chain().lastIndexOf(value, true); result = _(array).chain().lastIndexOf(value, 42); result = _(list).chain().lastIndexOf(value); result = _(list).chain().lastIndexOf(value, true); result = _(list).chain().lastIndexOf(value, 42); } } // _.pull namespace TestPull { let array: TResult[]; let list: _.List; let value: TResult; { let result: TResult[]; result = _.pull(array); result = _.pull(array, value); result = _.pull(array, value, value); result = _.pull(array, value, value, value); } { let result: _.List; result = _.pull(list); result = _.pull(list, value); result = _.pull(list, value, value); result = _.pull(list, value, value, value); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).pull(); result = _(array).pull(value); result = _(array).pull(value, value); result = _(array).pull(value, value, value); } { let result: _.LoDashImplicitObjectWrapper<_.List>; result = _(list).pull(); result = _(list).pull(value); result = _(list).pull(value, value); result = _(list).pull(value, value, value); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pull(); result = _(array).chain().pull(value); result = _(array).chain().pull(value, value); result = _(array).chain().pull(value, value, value); } { let result: _.LoDashExplicitObjectWrapper<_.List>; result = _(list).chain().pull(); result = _(list).chain().pull(value); result = _(list).chain().pull(value, value); result = _(list).chain().pull(value, value, value); } } // _.pullAt namespace TestPullAt { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.pullAt(array); result = _.pullAt(array, 1); result = _.pullAt(array, [2, 3], 1); result = _.pullAt(array, 4, [2, 3], 1); result = _.pullAt(list); result = _.pullAt(list, 1); result = _.pullAt(list, [2, 3], 1); result = _.pullAt(list, 4, [2, 3], 1); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).pullAt(); result = _(array).pullAt(1); result = _(array).pullAt([2, 3], 1); result = _(array).pullAt(4, [2, 3], 1); result = _(list).pullAt(); result = _(list).pullAt(1); result = _(list).pullAt([2, 3], 1); result = _(list).pullAt(4, [2, 3], 1); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().pullAt(); result = _(array).chain().pullAt(1); result = _(array).chain().pullAt([2, 3], 1); result = _(array).chain().pullAt(4, [2, 3], 1); result = _(list).chain().pullAt(); result = _(list).chain().pullAt(1); result = _(list).chain().pullAt([2, 3], 1); result = _(list).chain().pullAt(4, [2, 3], 1); } } // _.remove namespace TestRemove { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index?: number, collection?: _.List) => boolean; { let result: TResult[]; result = _.remove(array); result = _.remove(array, predicateFn); result = _.remove(array, predicateFn, any); result = _.remove(array, ''); result = _.remove(array, '', any); result = _.remove<{a: number}, TResult>(array, {a: 42}); result = _.remove(list); result = _.remove(list, predicateFn); result = _.remove(list, predicateFn, any); result = _.remove(list, ''); result = _.remove(list, '', any); result = _.remove<{a: number}, TResult>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).remove(); result = _(array).remove(predicateFn); result = _(array).remove(predicateFn, any); result = _(array).remove(''); result = _(array).remove('', any); result = _(array).remove<{a: number}>({a: 42}); result = _(list).remove(); result = _(list).remove(predicateFn); result = _(list).remove(predicateFn, any); result = _(list).remove(''); result = _(list).remove('', any); result = _(list).remove<{a: number}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().remove(); result = _(array).chain().remove(predicateFn); result = _(array).chain().remove(predicateFn, any); result = _(array).chain().remove(''); result = _(array).chain().remove('', any); result = _(array).chain().remove<{a: number}>({a: 42}); result = _(list).chain().remove(); result = _(list).chain().remove(predicateFn); result = _(list).chain().remove(predicateFn, any); result = _(list).chain().remove(''); result = _(list).chain().remove('', any); result = _(list).chain().remove<{a: number}, TResult>({a: 42}); } } // _.tail namespace TestTail { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.tail(array); result = _.tail(list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).tail(); result = _(list).tail(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().tail(); result = _(list).chain().tail(); } } // _.slice namespace TestSlice { let array: TResult[]; { let result: TResult[]; result = _.slice(array); result = _.slice(array, 42); result = _.slice(array, 42, 42); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).slice(); result = _(array).slice(42); result = _(array).slice(42, 42); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().slice(); result = _(array).chain().slice(42); result = _(array).chain().slice(42, 42); } } // _.sortedIndex namespace TestSortedIndex { type SampleType = {a: number; b: string; c: boolean;}; let array: SampleType[]; let list: _.List; let value: SampleType; let stringIterator: (x: string) => number; let arrayIterator: (x: SampleType) => number; let listIterator: (x: SampleType) => number; { let result: number; result = _.sortedIndex('', ''); result = _.sortedIndex(array, value); result = _.sortedIndex(list, value); result = _('').sortedIndex(''); result = _(array).sortedIndex(value); result = _(list).sortedIndex(value); } { let result: _.LoDashExplicitWrapper; result = _('').chain().sortedIndex(''); result = _(array).chain().sortedIndex(value); result = _(list).chain().sortedIndex(value); } } // _.sortedIndexBy namespace TestSortedIndexBy { type SampleType = {a: number; b: string; c: boolean;}; let array: SampleType[]; let list: _.List; let value: SampleType; let stringIterator: (x: string) => number; let arrayIterator: (x: SampleType) => number; let listIterator: (x: SampleType) => number; { let result: number; result = _.sortedIndexBy('', '', stringIterator); result = _.sortedIndexBy('', '', stringIterator); result = _.sortedIndexBy(array, value, arrayIterator); result = _.sortedIndexBy(array, value, ''); result = _.sortedIndexBy(array, value, {a: 42}); result = _.sortedIndexBy(array, value, arrayIterator); result = _.sortedIndexBy<{a: number}, SampleType>(array, value, {a: 42}); result = _.sortedIndexBy(list, value, listIterator); result = _.sortedIndexBy(list, value, ''); result = _.sortedIndexBy(list, value, {a: 42}); result = _.sortedIndexBy(list, value, listIterator); result = _.sortedIndexBy<{a: number}, SampleType>(list, value, {a: 42}); result = _('').sortedIndexBy('', stringIterator); result = _(array).sortedIndexBy(value, arrayIterator); result = _(array).sortedIndexBy(value, ''); result = _(array).sortedIndexBy<{a: number}>(value, {a: 42}); result = _(list).sortedIndexBy(value, listIterator); result = _(list).sortedIndexBy(value, ''); result = _(list).sortedIndexBy(value, {a: 42}); result = _(list).sortedIndexBy(value, listIterator); result = _(list).sortedIndexBy<{a: number}, SampleType>(value, {a: 42}); } { let result: _.LoDashExplicitWrapper; result = _('').chain().sortedIndexBy('', stringIterator); result = _(array).chain().sortedIndexBy(value, arrayIterator); result = _(array).chain().sortedIndexBy(value, ''); result = _(array).chain().sortedIndexBy<{a: number}>(value, {a: 42}); result = _(list).chain().sortedIndexBy(value, listIterator); result = _(list).chain().sortedIndexBy(value, ''); result = _(list).chain().sortedIndexBy(value, {a: 42}); result = _(list).chain().sortedIndexBy(value, listIterator); result = _(list).chain().sortedIndexBy<{a: number}, SampleType>(value, {a: 42}); } } // _.sortedLastIndex namespace TestSortedLastIndex { type SampleType = {a: number; b: string; c: boolean;}; let array: SampleType[]; let list: _.List; let value: SampleType; let stringIterator: (x: string) => number; let arrayIterator: (x: SampleType) => number; let listIterator: (x: SampleType) => number; { let result: number; result = _.sortedLastIndex('', ''); result = _.sortedLastIndex(array, value); result = _.sortedLastIndex(list, value); result = _('').sortedLastIndex(''); result = _(array).sortedLastIndex(value); result = _(list).sortedLastIndex(value); } { let result: _.LoDashExplicitWrapper; result = _('').chain().sortedLastIndex(''); result = _(array).chain().sortedLastIndex(value); result = _(list).chain().sortedLastIndex(value); } } // _.sortedLastIndexBy namespace TestSortedLastIndexBy { type SampleType = {a: number; b: string; c: boolean;}; let array: SampleType[]; let list: _.List; let value: SampleType; let stringIterator: (x: string) => number; let arrayIterator: (x: SampleType) => number; let listIterator: (x: SampleType) => number; { let result: number; result = _.sortedLastIndexBy('', '', stringIterator); result = _.sortedLastIndexBy('', '', stringIterator); result = _.sortedLastIndexBy(array, value, arrayIterator); result = _.sortedLastIndexBy(array, value, ''); result = _.sortedLastIndexBy(array, value, {a: 42}); result = _.sortedLastIndexBy(array, value, arrayIterator); result = _.sortedLastIndexBy<{a: number}, SampleType>(array, value, {a: 42}); result = _.sortedLastIndexBy(list, value, listIterator); result = _.sortedLastIndexBy(list, value, ''); result = _.sortedLastIndexBy(list, value, {a: 42}); result = _.sortedLastIndexBy(list, value, listIterator); result = _.sortedLastIndexBy<{a: number}, SampleType>(list, value, {a: 42}); result = _('').sortedLastIndexBy('', stringIterator); result = _(array).sortedLastIndexBy(value, arrayIterator); result = _(array).sortedLastIndexBy(value, ''); result = _(array).sortedLastIndexBy<{a: number}>(value, {a: 42}); result = _(list).sortedLastIndexBy(value, listIterator); result = _(list).sortedLastIndexBy(value, ''); result = _(list).sortedLastIndexBy(value, {a: 42}); result = _(list).sortedLastIndexBy(value, listIterator); result = _(list).sortedLastIndexBy<{a: number}, SampleType>(value, {a: 42}); } { let result: _.LoDashExplicitWrapper; result = _('').chain().sortedLastIndexBy('', stringIterator); result = _(array).chain().sortedLastIndexBy(value, arrayIterator); result = _(array).chain().sortedLastIndexBy(value, ''); result = _(array).chain().sortedLastIndexBy<{a: number}>(value, {a: 42}); result = _(list).chain().sortedLastIndexBy(value, listIterator); result = _(list).chain().sortedLastIndexBy(value, ''); result = _(list).chain().sortedLastIndexBy(value, {a: 42}); result = _(list).chain().sortedLastIndexBy(value, listIterator); result = _(list).chain().sortedLastIndexBy<{a: number}, SampleType>(value, {a: 42}); } } // _.tail namespace TestTail { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.tail(array); result = _.tail(list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).tail(); result = _(list).tail(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().tail(); result = _(list).chain().tail(); } } // _.take namespace TestTake { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.take(array); result = _.take(array, 42); result = _.take(list); result = _.take(list, 42); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).take(); result = _(array).take(42); result = _(list).take(); result = _(list).take(42); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().take(); result = _(array).chain().take(42); result = _(list).chain().take(); result = _(list).chain().take(42); } } // _.takeRight namespace TestTakeRight { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.takeRight(array); result = _.takeRight(array, 42); result = _.takeRight(list); result = _.takeRight(list, 42); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRight(); result = _(array).takeRight(42); result = _(list).takeRight(); result = _(list).takeRight(42); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRight(); result = _(array).chain().takeRight(42); result = _(list).chain().takeRight(); result = _(list).chain().takeRight(42); } } // _.takeRightWhile namespace TestTakeRightWhile { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index: number, collection: _.List) => boolean; { let result: TResult[]; result = _.takeRightWhile(array); result = _.takeRightWhile(array, predicateFn); result = _.takeRightWhile(array, predicateFn, any); result = _.takeRightWhile(array, ''); result = _.takeRightWhile(array, '', any); result = _.takeRightWhile<{a: number;}, TResult>(array, {a: 42}); result = _.takeRightWhile(list); result = _.takeRightWhile(list, predicateFn); result = _.takeRightWhile(list, predicateFn, any); result = _.takeRightWhile(list, ''); result = _.takeRightWhile(list, '', any); result = _.takeRightWhile<{a: number;}, TResult>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).takeRightWhile(); result = _(array).takeRightWhile(predicateFn); result = _(array).takeRightWhile(predicateFn, any); result = _(array).takeRightWhile(''); result = _(array).takeRightWhile('', any); result = _(array).takeRightWhile<{a: number;}>({a: 42}); result = _(list).takeRightWhile(); result = _(list).takeRightWhile(predicateFn); result = _(list).takeRightWhile(predicateFn, any); result = _(list).takeRightWhile(''); result = _(list).takeRightWhile('', any); result = _(list).takeRightWhile<{a: number;}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeRightWhile(); result = _(array).chain().takeRightWhile(predicateFn); result = _(array).chain().takeRightWhile(predicateFn, any); result = _(array).chain().takeRightWhile(''); result = _(array).chain().takeRightWhile('', any); result = _(array).chain().takeRightWhile<{a: number;}>({a: 42}); result = _(list).chain().takeRightWhile(); result = _(list).chain().takeRightWhile(predicateFn); result = _(list).chain().takeRightWhile(predicateFn, any); result = _(list).chain().takeRightWhile(''); result = _(list).chain().takeRightWhile('', any); result = _(list).chain().takeRightWhile<{a: number;}, TResult>({a: 42}); } } // _.takeWhile namespace TestTakeWhile { let array: TResult[]; let list: _.List; let predicateFn: (value: TResult, index: number, collection: _.List) => boolean; { let result: TResult[]; result = _.takeWhile(array); result = _.takeWhile(array, predicateFn); result = _.takeWhile(array, predicateFn, any); result = _.takeWhile(array, ''); result = _.takeWhile(array, '', any); result = _.takeWhile<{a: number;}, TResult>(array, {a: 42}); result = _.takeWhile(list); result = _.takeWhile(list, predicateFn); result = _.takeWhile(list, predicateFn, any); result = _.takeWhile(list, ''); result = _.takeWhile(list, '', any); result = _.takeWhile<{a: number;}, TResult>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).takeWhile(); result = _(array).takeWhile(predicateFn); result = _(array).takeWhile(predicateFn, any); result = _(array).takeWhile(''); result = _(array).takeWhile('', any); result = _(array).takeWhile<{a: number;}>({a: 42}); result = _(list).takeWhile(); result = _(list).takeWhile(predicateFn); result = _(list).takeWhile(predicateFn, any); result = _(list).takeWhile(''); result = _(list).takeWhile('', any); result = _(list).takeWhile<{a: number;}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().takeWhile(); result = _(array).chain().takeWhile(predicateFn); result = _(array).chain().takeWhile(predicateFn, any); result = _(array).chain().takeWhile(''); result = _(array).chain().takeWhile('', any); result = _(array).chain().takeWhile<{a: number;}>({a: 42}); result = _(list).chain().takeWhile(); result = _(list).chain().takeWhile(predicateFn); result = _(list).chain().takeWhile(predicateFn, any); result = _(list).chain().takeWhile(''); result = _(list).chain().takeWhile('', any); result = _(list).chain().takeWhile<{a: number;}, TResult>({a: 42}); } } // _.union namespace TestUnion { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.union(); result = _.union(array); result = _.union(array, list); result = _.union(array, list, array); result = _.union(list); result = _.union(list, array); result = _.union(list, array, list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).union(); result = _(array).union(list); result = _(array).union(list, array); result = _(array).union(); result = _(array).union(list); result = _(array).union(list, array); result = _(list).union(); result = _(list).union(array); result = _(list).union(array, list); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().union(); result = _(array).chain().union(list); result = _(array).chain().union(list, array); result = _(array).chain().union(); result = _(array).chain().union(list); result = _(array).chain().union(list, array); result = _(list).chain().union(); result = _(list).chain().union(array); result = _(list).chain().union(array, list); } } // _.unionBy namespace TestUnionBy { let array: TResult[]; let list: _.List; let iteratee: (value: TResult) => any; { let result: TResult[]; result = _.unionBy(array, array); result = _.unionBy(array, list, array); result = _.unionBy(array, array, list, array); result = _.unionBy(array, list, array, list, array); result = _.unionBy(array, array, list, array, list, array); result = _.unionBy(array, array, iteratee); result = _.unionBy(array, list, array, iteratee); result = _.unionBy(array, array, list, array, iteratee); result = _.unionBy(array, list, array, list, array, iteratee); result = _.unionBy(array, array, list, array, list, array, iteratee); result = _.unionBy(array, array, 'a'); result = _.unionBy(array, list, array, 'a'); result = _.unionBy(array, array, list, array, 'a'); result = _.unionBy(array, list, array, list, array, 'a'); result = _.unionBy(array, array, list, array, list, array, 'a'); result = _.unionBy(array, array, {a: 1}); result = _.unionBy(array, list, array, {a: 1}); result = _.unionBy(array, array, list, array, {a: 1}); result = _.unionBy(array, list, array, list, array, {a: 1}); result = _.unionBy(array, list, array, list, array, list, {a: 1}); result = _.unionBy(list, list); result = _.unionBy(list, array, list); result = _.unionBy(list, list, array, list); result = _.unionBy(list, array, list, array, list); result = _.unionBy(list, list, array, list, array, list); result = _.unionBy(list, list, iteratee); result = _.unionBy(list, array, list, iteratee); result = _.unionBy(list, list, array, list, iteratee); result = _.unionBy(list, array, list, array, list, iteratee); result = _.unionBy(list, list, array, list, array, list, iteratee); result = _.unionBy(list, list, 'a'); result = _.unionBy(list, array, list, 'a'); result = _.unionBy(list, list, array, list, 'a'); result = _.unionBy(list, array, list, array, list, 'a'); result = _.unionBy(list, list, array, list, array, list, 'a'); result = _.unionBy(list, list, {a: 1}); result = _.unionBy(list, array, list, {a: 1}); result = _.unionBy(list, list, array, list, {a: 1}); result = _.unionBy(list, array, list, array, list, {a: 1}); result = _.unionBy(list, array, list, array, list, array, {a: 1}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).unionBy(array); result = _(array).unionBy(list, array); result = _(array).unionBy(array, list, array); result = _(array).unionBy(list, array, list, array); result = _(array).unionBy(array, list, array, list, array); result = _(array).unionBy(array, iteratee); result = _(array).unionBy(list, array, iteratee); result = _(array).unionBy(array, list, array, iteratee); result = _(array).unionBy(list, array, list, array, iteratee); result = _(array).unionBy(array, list, array, list, array, iteratee); result = _(array).unionBy(array, 'a'); result = _(array).unionBy(list, array, 'a'); result = _(array).unionBy(array, list, array, 'a'); result = _(array).unionBy(list, array, list, array, 'a'); result = _(array).unionBy(array, list, array, list, array, 'a'); result = _(array).unionBy(array, {a: 1}); result = _(array).unionBy(list, array, {a: 1}); result = _(array).unionBy(array, list, array, {a: 1}); result = _(array).unionBy(list, array, list, array, {a: 1}); result = _(array).unionBy(list, array, list, array, list, {a: 1}); result = _(list).unionBy(list); result = _(list).unionBy(array, list); result = _(list).unionBy(list, array, list); result = _(list).unionBy(array, list, array, list); result = _(list).unionBy(list, array, list, array, list); result = _(list).unionBy(list, iteratee); result = _(list).unionBy(array, list, iteratee); result = _(list).unionBy(list, array, list, iteratee); result = _(list).unionBy(array, list, array, list, iteratee); result = _(list).unionBy(list, array, list, array, list, iteratee); result = _(list).unionBy(list, 'a'); result = _(list).unionBy(array, list, 'a'); result = _(list).unionBy(list, array, list, 'a'); result = _(list).unionBy(array, list, array, list, 'a'); result = _(list).unionBy(list, array, list, array, list, 'a'); result = _(list).unionBy(list, {a: 1}); result = _(list).unionBy(array, list, {a: 1}); result = _(list).unionBy(list, array, list, {a: 1}); result = _(list).unionBy(array, list, array, list, {a: 1}); result = _(list).unionBy(array, list, array, list, array, {a: 1}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().unionBy(array); result = _(array).chain().unionBy(list, array); result = _(array).chain().unionBy(array, list, array); result = _(array).chain().unionBy(list, array, list, array); result = _(array).chain().unionBy(array, list, array, list, array); result = _(array).chain().unionBy(array, iteratee); result = _(array).chain().unionBy(list, array, iteratee); result = _(array).chain().unionBy(array, list, array, iteratee); result = _(array).chain().unionBy(list, array, list, array, iteratee); result = _(array).chain().unionBy(array, list, array, list, array, iteratee); result = _(array).chain().unionBy(array, 'a'); result = _(array).chain().unionBy(list, array, 'a'); result = _(array).chain().unionBy(array, list, array, 'a'); result = _(array).chain().unionBy(list, array, list, array, 'a'); result = _(array).chain().unionBy(array, list, array, list, array, 'a'); result = _(array).chain().unionBy(array, {a: 1}); result = _(array).chain().unionBy(list, array, {a: 1}); result = _(array).chain().unionBy(array, list, array, {a: 1}); result = _(array).chain().unionBy(list, array, list, array, {a: 1}); result = _(array).chain().unionBy(list, array, list, array, list, {a: 1}); result = _(list).chain().unionBy(list); result = _(list).chain().unionBy(array, list); result = _(list).chain().unionBy(list, array, list); result = _(list).chain().unionBy(array, list, array, list); result = _(list).chain().unionBy(list, array, list, array, list); result = _(list).chain().unionBy(list, iteratee); result = _(list).chain().unionBy(array, list, iteratee); result = _(list).chain().unionBy(list, array, list, iteratee); result = _(list).chain().unionBy(array, list, array, list, iteratee); result = _(list).chain().unionBy(list, array, list, array, list, iteratee); result = _(list).chain().unionBy(list, 'a'); result = _(list).chain().unionBy(array, list, 'a'); result = _(list).chain().unionBy(list, array, list, 'a'); result = _(list).chain().unionBy(array, list, array, list, 'a'); result = _(list).chain().unionBy(list, array, list, array, list, 'a'); result = _(list).chain().unionBy(list, {a: 1}); result = _(list).chain().unionBy(array, list, {a: 1}); result = _(list).chain().unionBy(list, array, list, {a: 1}); result = _(list).chain().unionBy(array, list, array, list, {a: 1}); result = _(list).chain().unionBy(array, list, array, list, array, {a: 1}); } } // _.uniq namespace TestUniq { type SampleObject = {a: number; b: string; c: boolean}; let array: SampleObject[]; let list: _.List; let stringIterator: (value: string, index: number, collection: string) => string; let listIterator: (value: SampleObject, index: number, collection: _.List) => number; { let result: string[]; result = _.uniq('abc'); } { let result: SampleObject[]; result = _.uniq(array); result = _.uniq(list); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').uniq(); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).uniq(); result = _(list).uniq(); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().uniq(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().uniq(); result = _(list).chain().uniq(); } } // _.uniqBy namespace TestUniqBy { type SampleObject = {a: number; b: string; c: boolean}; let array: SampleObject[]; let list: _.List; let stringIterator: (value: string, index: number, collection: string) => string; let listIterator: (value: SampleObject, index: number, collection: _.List) => number; { let result: string[]; result = _.uniqBy('abc', stringIterator); result = _.uniqBy('abc', stringIterator); } { let result: SampleObject[]; result = _.uniqBy(array, listIterator); result = _.uniqBy(array, listIterator); result = _.uniqBy(array, 'a'); result = _.uniqBy(array, {a: 42}); result = _.uniqBy<{a: number}, SampleObject>(array, {a: 42}); result = _.uniqBy(list, listIterator); result = _.uniqBy(list, listIterator); result = _.uniqBy(list, 'a'); result = _.uniqBy(list, {a: 42}); result = _.uniqBy<{a: number}, SampleObject>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').uniqBy(stringIterator); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).uniqBy(listIterator); result = _(array).uniqBy('a'); result = _(array).uniqBy<{a: number}>({a: 42}); result = _(list).uniqBy(listIterator); result = _(list).uniqBy(listIterator); result = _(list).uniqBy('a'); result = _(list).uniqBy({a: 42}); result = _(list).uniqBy<{a: number}, SampleObject>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().uniqBy(stringIterator); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().uniqBy(listIterator); result = _(array).chain().uniqBy('a'); result = _(array).chain().uniqBy<{a: number}>({a: 42}); result = _(list).chain().uniqBy(listIterator); result = _(list).chain().uniqBy(listIterator); result = _(list).chain().uniqBy('a'); result = _(list).chain().uniqBy({a: 42}); result = _(list).chain().uniqBy<{a: number}, SampleObject>({a: 42}); } } // _.sortedUniq namespace TestSortedUniq { type SampleObject = {a: number; b: string; c: boolean}; let array: SampleObject[]; let list: _.List; let stringIterator: (value: string, index: number, collection: string) => string; let listIterator: (value: SampleObject, index: number, collection: _.List) => number; { let result: string[]; result = _.sortedUniq('abc'); } { let result: SampleObject[]; result = _.sortedUniq(array); result = _.sortedUniq(list); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').sortedUniq(); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).sortedUniq(); result = _(list).sortedUniq(); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().sortedUniq(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().sortedUniq(); result = _(list).chain().sortedUniq(); } } // _.sortedUniqBy namespace TestSortedUniqBy { type SampleObject = {a: number; b: string; c: boolean}; let array: SampleObject[]; let list: _.List; let stringIterator: (value: string, index: number, collection: string) => string; let listIterator: (value: SampleObject, index: number, collection: _.List) => number; { let result: string[]; result = _.sortedUniqBy('abc', stringIterator); result = _.sortedUniqBy('abc', stringIterator); } { let result: SampleObject[]; result = _.sortedUniqBy(array, listIterator); result = _.sortedUniqBy(array, listIterator); result = _.sortedUniqBy(array, 'a'); result = _.sortedUniqBy(array, {a: 42}); result = _.sortedUniqBy<{a: number}, SampleObject>(array, {a: 42}); result = _.sortedUniqBy(list, listIterator); result = _.sortedUniqBy(list, listIterator); result = _.sortedUniqBy(list, 'a'); result = _.sortedUniqBy(list, {a: 42}); result = _.sortedUniqBy<{a: number}, SampleObject>(list, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').sortedUniqBy(stringIterator); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).sortedUniqBy(listIterator); result = _(array).sortedUniqBy('a'); result = _(array).sortedUniqBy<{a: number}>({a: 42}); result = _(list).sortedUniqBy(listIterator); result = _(list).sortedUniqBy(listIterator); result = _(list).sortedUniqBy('a'); result = _(list).sortedUniqBy({a: 42}); result = _(list).sortedUniqBy<{a: number}, SampleObject>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().sortedUniqBy(stringIterator); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().sortedUniqBy(listIterator); result = _(array).chain().sortedUniqBy('a'); result = _(array).chain().sortedUniqBy<{a: number}>({a: 42}); result = _(list).chain().sortedUniqBy(listIterator); result = _(list).chain().sortedUniqBy(listIterator); result = _(list).chain().sortedUniqBy('a'); result = _(list).chain().sortedUniqBy({a: 42}); result = _(list).chain().sortedUniqBy<{a: number}, SampleObject>({a: 42}); } } // _.upzip namespace TestUnzip { let array = [['a', 'b'], [1, 2], [true, false]]; let list: _.List<_.List> = { 0: {0: 'a', 1: 'b', length: 2}, 1: {0: 1, 1: 2, length: 2}, 2: {0: true, 1: false, length: 2}, length: 3 }; { let result: (string|number|boolean)[][]; result = _.unzip(array); result = _.unzip(list); } { let result: _.LoDashImplicitArrayWrapper<(string|number|boolean)[]>; result = _(array).unzip(); result = _(list).unzip(); } { let result: _.LoDashExplicitArrayWrapper<(string|number|boolean)[]>; result = _(array).chain().unzip(); result = _(list).chain().unzip(); } } // _.unzipWith { let testUnzipWithArray: (number[]|_.List)[]; let testUnzipWithList: _.List>; let testUnzipWithIterator: {(prev: TResult, curr: number, index?: number, list?: number[]): TResult}; let result: TResult[]; result = _.unzipWith(testUnzipWithArray); result = _.unzipWith(testUnzipWithArray, testUnzipWithIterator); result = _.unzipWith(testUnzipWithArray, testUnzipWithIterator, any); result = _.unzipWith(testUnzipWithList); result = _.unzipWith(testUnzipWithList, testUnzipWithIterator); result = _.unzipWith(testUnzipWithList, testUnzipWithIterator, any); result = _(testUnzipWithArray).unzipWith(testUnzipWithIterator).value(); result = _(testUnzipWithArray).unzipWith(testUnzipWithIterator, any).value(); result = _(testUnzipWithList).unzipWith(testUnzipWithIterator).value(); result = _(testUnzipWithList).unzipWith(testUnzipWithIterator, any).value(); } // _.without namespace TestWithout { let array: number[]; let list: _.List; { let result: number[]; result = _.without(array); result = _.without(array, 1); result = _.without(array, 1, 2); result = _.without(array, 1, 2, 3); result = _.without(list); result = _.without(list, 1); result = _.without(list, 1, 2); result = _.without(list, 1, 2, 3); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).without(); result = _(array).without(1); result = _(array).without(1, 2); result = _(array).without(1, 2, 3); result = _(list).without(); result = _(list).without(1); result = _(list).without(1, 2); result = _(list).without(1, 2, 3); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().without(); result = _(array).chain().without(1); result = _(array).chain().without(1, 2); result = _(array).chain().without(1, 2, 3); result = _(list).chain().without(); result = _(list).chain().without(1); result = _(list).chain().without(1, 2); result = _(list).chain().without(1, 2, 3); } } // _.xor namespace TestXor { let array: TResult[]; let list: _.List; { let result: TResult[]; result = _.xor(); result = _.xor(array); result = _.xor(array, list); result = _.xor(array, list, array); result = _.xor(list); result = _.xor(list, array); result = _.xor(list, array, list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).xor(); result = _(array).xor(list); result = _(array).xor(list, array); result = _(list).xor(); result = _(list).xor(array); result = _(list).xor(array, list); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().xor(); result = _(array).chain().xor(list); result = _(array).chain().xor(list, array); result = _(list).chain().xor(); result = _(list).chain().xor(array); result = _(list).chain().xor(array, list); } } // _.zip namespace TestZip { let array: TResult[]; let list: _.List; { let result: TResult[][]; result = _.zip(array); result = _.zip(array, list); result = _.zip(array, list, array); result = _.zip(list); result = _.zip(list, array); result = _.zip(list, array, list); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).zip(list); result = _(array).zip(list, array); result = _(list).zip(array); result = _(list).zip(array, list); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().zip(list); result = _(array).chain().zip(list, array); result = _(list).chain().zip(array); result = _(list).chain().zip(array, list); } } // _.zipObject namespace TestZipObject { let arrayOfKeys: string[]; let arrayOfValues: number[]; let arrayOfKeyValuePairs: (string|number)[][] let listOfKeys: _.List; let listOfValues: _.List; let listOfKeyValuePairs: _.List<_.List>; { let result: _.Dictionary; result = _.zipObject<_.Dictionary>(arrayOfKeys); result = _.zipObject<_.Dictionary>(listOfKeys); } { let result: _.Dictionary; result = _.zipObject<_.Dictionary>(arrayOfKeys, arrayOfValues); result = _.zipObject<_.Dictionary>(arrayOfKeys, listOfValues); result = _.zipObject<_.Dictionary>(listOfKeys, listOfValues); result = _.zipObject<_.Dictionary>(listOfKeys, arrayOfValues); result = _.zipObject>(arrayOfKeys, arrayOfValues); result = _.zipObject>(arrayOfKeys, listOfValues); result = _.zipObject>(listOfKeys, listOfValues); result = _.zipObject>(listOfKeys, arrayOfValues); result = _.zipObject<_.Dictionary>(arrayOfKeyValuePairs); result = _.zipObject<_.Dictionary>(listOfKeyValuePairs); } { let result: _.Dictionary; result = _.zipObject(arrayOfKeys); result = _.zipObject(arrayOfKeys, arrayOfValues); result = _.zipObject(arrayOfKeys, listOfValues); result = _.zipObject(listOfKeys); result = _.zipObject(listOfKeys, listOfValues); result = _.zipObject(listOfKeys, arrayOfValues); result = _.zipObject<_.Dictionary>(arrayOfKeyValuePairs); result = _.zipObject<_.Dictionary>(listOfKeyValuePairs); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(arrayOfKeys).zipObject<_.Dictionary>(); result = _(listOfKeys).zipObject<_.Dictionary>(); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(arrayOfKeys).zipObject<_.Dictionary>(arrayOfValues); result = _(arrayOfKeys).zipObject<_.Dictionary>(listOfValues); result = _(listOfKeys).zipObject<_.Dictionary>(listOfValues); result = _(listOfKeys).zipObject<_.Dictionary>(arrayOfValues); result = _(arrayOfKeys).zipObject>(arrayOfValues); result = _(arrayOfKeys).zipObject>(listOfValues); result = _(listOfKeys).zipObject>(listOfValues); result = _(listOfKeys).zipObject>(arrayOfValues); result = _(listOfKeys).zipObject<_.Dictionary>(arrayOfKeyValuePairs); result = _(listOfKeys).zipObject<_.Dictionary>(listOfKeyValuePairs); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(arrayOfKeys).zipObject(); result = _(arrayOfKeys).zipObject(arrayOfValues); result = _(arrayOfKeys).zipObject(listOfValues); result = _(listOfKeys).zipObject(); result = _(listOfKeys).zipObject(listOfValues); result = _(listOfKeys).zipObject(arrayOfValues); result = _(listOfKeys).zipObject(arrayOfKeyValuePairs); result = _(listOfKeys).zipObject(listOfKeyValuePairs); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(arrayOfKeys).chain().zipObject<_.Dictionary>(); result = _(listOfKeys).chain().zipObject<_.Dictionary>(); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(arrayOfKeys).chain().zipObject<_.Dictionary>(arrayOfValues); result = _(arrayOfKeys).chain().zipObject<_.Dictionary>(listOfValues); result = _(listOfKeys).chain().zipObject<_.Dictionary>(listOfValues); result = _(listOfKeys).chain().zipObject<_.Dictionary>(arrayOfValues); result = _(arrayOfKeys).chain().zipObject>(arrayOfValues); result = _(arrayOfKeys).chain().zipObject>(listOfValues); result = _(listOfKeys).chain().zipObject>(listOfValues); result = _(listOfKeys).chain().zipObject>(arrayOfValues); result = _(listOfKeys).chain().zipObject<_.Dictionary>(arrayOfKeyValuePairs); result = _(listOfKeys).chain().zipObject<_.Dictionary>(listOfKeyValuePairs); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(arrayOfKeys).chain().zipObject(); result = _(arrayOfKeys).chain().zipObject(arrayOfValues); result = _(arrayOfKeys).chain().zipObject(listOfValues); result = _(listOfKeys).chain().zipObject(); result = _(listOfKeys).chain().zipObject(listOfValues); result = _(listOfKeys).chain().zipObject(arrayOfValues); result = _(listOfKeys).chain().zipObject(arrayOfKeyValuePairs); result = _(listOfKeys).chain().zipObject(listOfKeyValuePairs); } } // _.zipWith interface TestZipWithFn { (a1: number, a2: number): number; } var testZipWithFn: TestZipWithFn; result = _.zipWith([1, 2]); result = _.zipWith([1, 2], testZipWithFn); result = _.zipWith([1, 2], testZipWithFn, any); result = _.zipWith([1, 2], [1, 2], testZipWithFn, any); result = _.zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn, any); result = _([1, 2]).zipWith().value(); result = _([1, 2]).zipWith(testZipWithFn).value(); result = _([1, 2]).zipWith(testZipWithFn, any).value(); result = _([1, 2]).zipWith([1, 2], testZipWithFn, any).value(); result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn, any).value(); /********* * Chain * *********/ // _.chain namespace TestChain { { let result: _.LoDashExplicitWrapper; result = _.chain(''); result = _('').chain(); result = _.chain('').chain(); result = _('').chain().chain(); } { let result: _.LoDashExplicitWrapper; result = _.chain(42); result = _(42).chain(); } { let result: _.LoDashExplicitWrapper; result = _.chain(true); result = _(true).chain(); } { let result: _.LoDashExplicitArrayWrapper; result = _.chain(['']); result = _(['']).chain(); } { let result: _.LoDashExplicitObjectWrapper<{a: string}>; result = _.chain<{a: string}>({a: ''}); result = _<{a: string}>({a: ''}).chain(); } } // _.tap namespace TestTap { { let interceptor: (value: string) => void; let result: string; _.tap('', interceptor); _.tap('', interceptor, any); } { let interceptor: (value: string[]) => void; let result: _.LoDashImplicitArrayWrapper; _.tap([''], interceptor); _.tap([''], interceptor, any); } { let interceptor: (value: {a: string}) => void; let result: _.LoDashImplicitObjectWrapper<{a: string}>; _.tap({a: ''}, interceptor); _.tap({a: ''}, interceptor, any); } { let interceptor: (value: string) => void; let result: _.LoDashImplicitWrapper; _.chain('').tap(interceptor, any); _.chain('').tap(interceptor, any); _('').tap(interceptor); _('').tap(interceptor, any); } { let interceptor: (value: string[]) => void; let result: _.LoDashImplicitArrayWrapper; _.chain(['']).tap(interceptor); _.chain(['']).tap(interceptor, any); _(['']).tap(interceptor); _(['']).tap(interceptor, any); } { let interceptor: (value: {a: string}) => void; let result: _.LoDashImplicitObjectWrapper<{a: string}>; _.chain({a: ''}).tap(interceptor); _.chain({a: ''}).tap(interceptor, any); _({a: ''}).tap(interceptor); _({a: ''}).tap(interceptor, any); } { let interceptor: (value: string) => void; let result: _.LoDashExplicitWrapper; _.chain('').tap(interceptor, any); _.chain('').tap(interceptor, any); _('').chain().tap(interceptor); _('').chain().tap(interceptor, any); } { let interceptor: (value: string[]) => void; let result: _.LoDashExplicitArrayWrapper; _.chain(['']).tap(interceptor); _.chain(['']).tap(interceptor, any); _(['']).chain().tap(interceptor); _(['']).chain().tap(interceptor, any); } { let interceptor: (value: {a: string}) => void; let result: _.LoDashExplicitObjectWrapper<{a: string}>; _.chain({a: ''}).tap(interceptor); _.chain({a: ''}).tap(interceptor, any); _({a: ''}).chain().tap(interceptor); _({a: ''}).chain().tap(interceptor, any); } } // _.thru namespace TestThru { interface Interceptor { (value: T): T; } { let interceptor: Interceptor; let result: number; result = _.thru(1, interceptor); result = _.thru(1, interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashImplicitWrapper; result = _(1).thru(interceptor); result = _(1).thru(interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashImplicitWrapper; result = _('').thru(interceptor); result = _('').thru(interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashImplicitWrapper; result = _(true).thru(interceptor); result = _(true).thru(interceptor, any); } { let interceptor: Interceptor<{a: string}>; let result: _.LoDashImplicitObjectWrapper<{a: string}>; result = _({a: ''}).thru<{a: string}>(interceptor); result = _({a: ''}).thru<{a: string}>(interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashImplicitArrayWrapper; result = _([1, 2, 3]).thru(interceptor); result = _([1, 2, 3]).thru(interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashExplicitWrapper; result = _(1).chain().thru(interceptor); result = _(1).chain().thru(interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashExplicitWrapper; result = _('').chain().thru(interceptor); result = _('').chain().thru(interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashExplicitWrapper; result = _(true).chain().thru(interceptor); result = _(true).chain().thru(interceptor, any); } { let interceptor: Interceptor<{a: string}>; let result: _.LoDashExplicitObjectWrapper<{a: string}>; result = _({a: ''}).chain().thru<{a: string}>(interceptor); result = _({a: ''}).chain().thru<{a: string}>(interceptor, any); } { let interceptor: Interceptor; let result: _.LoDashExplicitArrayWrapper; result = _([1, 2, 3]).chain().thru(interceptor); result = _([1, 2, 3]).chain().thru(interceptor, any); } } // _.prototype.commit namespace TestCommit { { let result: _.LoDashImplicitWrapper; result = _(42).commit(); } { let result: _.LoDashImplicitArrayWrapper; result = _([]).commit(); } { let result: _.LoDashImplicitObjectWrapper; result = _({}).commit(); } { let result: _.LoDashExplicitWrapper; result = _(42).chain().commit(); } { let result: _.LoDashExplicitArrayWrapper; result = _([]).chain().commit(); } { let result: _.LoDashExplicitObjectWrapper; result = _({}).chain().commit(); } } // _.prototype.concat namespace TestConcat { { let result: _.LoDashImplicitArrayWrapper; result = _(1).concat(2); result = _(1).concat(2, 3); result = _(1).concat(2, 3, 4); result = _(1).concat(2); result = _(1).concat(2, 3); result = _(1).concat(2, 3, 4); } { let result: _.LoDashImplicitArrayWrapper; result = _(['']).concat(['']); result = _(['']).concat([''], ['']); result = _(['']).concat([''], [''], ['']); result = _(['']).concat(['']); result = _(['']).concat([''], ['']); result = _(['']).concat([''], [''], ['']); } { let result: _.LoDashImplicitArrayWrapper<{a: string}>; result = _({a: ''}).concat<{a: string}>({a: ''}); result = _({a: ''}).concat<{a: string}>({a: ''}, {a: ''}); result = _({a: ''}).concat<{a: string}>({a: ''}, {a: ''}, {a: ''}); result = _({a: ''}).concat({a: ''}); result = _({a: ''}).concat({a: ''}, {a: ''}); result = _({a: ''}).concat({a: ''}, {a: ''}, {a: ''}); } { let result: _.LoDashExplicitArrayWrapper; result = _(1).chain().concat(2); result = _(1).chain().concat(2, 3); result = _(1).chain().concat(2, 3, 4); result = _(1).chain().concat(2); result = _(1).chain().concat(2, 3); result = _(1).chain().concat(2, 3, 4); } { let result: _.LoDashExplicitArrayWrapper; result = _(['']).chain().concat(['']); result = _(['']).chain().concat([''], ['']); result = _(['']).chain().concat([''], [''], ['']); result = _(['']).chain().concat(['']); result = _(['']).chain().concat([''], ['']); result = _(['']).chain().concat([''], [''], ['']); } { let result: _.LoDashExplicitArrayWrapper<{a: string}>; result = _({a: ''}).chain().concat<{a: string}>({a: ''}); result = _({a: ''}).chain().concat<{a: string}>({a: ''}, {a: ''}); result = _({a: ''}).chain().concat<{a: string}>({a: ''}, {a: ''}, {a: ''}); result = _({a: ''}).chain().concat({a: ''}); result = _({a: ''}).chain().concat({a: ''}, {a: ''}); result = _({a: ''}).chain().concat({a: ''}, {a: ''}, {a: ''}); } } // _.prototype.plant namespace TestPlant { { let result: _.LoDashImplicitWrapper; result = _(any).plant(42); } { let result: _.LoDashImplicitStringWrapper; result = _(any).plant(''); } { let result: _.LoDashImplicitWrapper; result = _(any).plant(true); } { let result: _.LoDashImplicitNumberArrayWrapper; result = _(any).plant([42]); } { let result: _.LoDashImplicitArrayWrapper; result = _(any).plant([]); } { let result: _.LoDashImplicitObjectWrapper<{}>; result = _(any).plant<{}>({}); } { let result: _.LoDashExplicitWrapper; result = _(any).chain().plant(42); } { let result: _.LoDashExplicitStringWrapper; result = _(any).chain().plant(''); } { let result: _.LoDashExplicitWrapper; result = _(any).chain().plant(true); } { let result: _.LoDashExplicitNumberArrayWrapper; result = _(any).chain().plant([42]); } { let result: _.LoDashExplicitArrayWrapper; result = _(any).chain().plant([]); } { let result: _.LoDashExplicitObjectWrapper<{}>; result = _(any).chain().plant<{}>({}); } } // _.prototype.reverse namespace TestReverse { { let result: _.LoDashImplicitArrayWrapper; result: _([42]).reverse(); } { let result: _.LoDashExplicitArrayWrapper; result: _([42]).chain().reverse(); } } // _.prototype.toJSON namespace TestToJSON { { let result: string; result = _('').toJSON(); result = _('').chain().toJSON(); } { let result: number; result = _(42).toJSON(); result = _(42).chain().toJSON(); } { let result: boolean; result = _(true).toJSON(); result = _(true).chain().toJSON(); } { let result: string[]; result = _([]).toJSON(); result = _([]).chain().toJSON(); } { let result: {a: string}; result = _({a: ''}).toJSON(); result = _({a: ''}).chain().toJSON(); } } // _.prototype.toString namespace TestToString { let result: string; result = _('').toString(); result = _(42).toString(); result = _(true).toString(); result = _(['']).toString(); result = _({}).toString(); result = _('').chain().toString(); result = _(42).chain().toString(); result = _(true).chain().toString(); result = _(['']).chain().toString(); result = _({}).chain().toString(); } // _.prototype.value namespace TestValue { { let result: string; result = _('').value(); result = _('').chain().value(); } { let result: number; result = _(42).value(); result = _(42).chain().value(); } { let result: boolean; result = _(true).value(); result = _(true).chain().value(); } { let result: string[]; result = _([]).value(); result = _([]).chain().value(); } { let result: {a: string}; result = _({a: ''}).value(); result = _({a: ''}).chain().value(); } } // _.prototype.valueOf namespace TestValueOf { { let result: string; result = _('').valueOf(); result = _('').chain().valueOf(); } { let result: number; result = _(42).valueOf(); result = _(42).chain().valueOf(); } { let result: boolean; result = _(true).valueOf(); result = _(true).chain().valueOf(); } { let result: string[]; result = _([]).valueOf(); result = _([]).chain().valueOf(); } { let result: {a: string}; result = _({a: ''}).valueOf(); result = _({a: ''}).chain().valueOf(); } } /************** * Collection * **************/ // _.at namespace TestAt { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; { let result: TResult[]; result = _.at(array, 0, '1', [2], ['3'], [4, '5']); result = _.at(list, 0, '1', [2], ['3'], [4, '5']); result = _.at(dictionary, 0, '1', [2], ['3'], [4, '5']); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).at(0, '1', [2], ['3'], [4, '5']); result = _(list).at(0, '1', [2], ['3'], [4, '5']); result = _(dictionary).at(0, '1', [2], ['3'], [4, '5']); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().at(0, '1', [2], ['3'], [4, '5']); result = _(list).chain().at(0, '1', [2], ['3'], [4, '5']); result = _(dictionary).chain().at(0, '1', [2], ['3'], [4, '5']); } } // _.countBy namespace TestCountBy { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let numericDictionary: _.NumericDictionary; let stringIterator: (value: string, index: number, collection: string) => any; let listIterator: (value: TResult, index: number, collection: _.List) => any; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary) => any; { let result: _.Dictionary; result = _.countBy(''); result = _.countBy('', stringIterator); result = _.countBy('', stringIterator, any); result = _.countBy(array); result = _.countBy(array, listIterator); result = _.countBy(array, listIterator, any); result = _.countBy(array, ''); result = _.countBy(array, '', any); result = _.countBy<{a: number}, TResult>(array, {a: 42}); result = _.countBy(array, {a: 42}); result = _.countBy(list); result = _.countBy(list, listIterator); result = _.countBy(list, listIterator, any); result = _.countBy(list, ''); result = _.countBy(list, '', any); result = _.countBy<{a: number}, TResult>(list, {a: 42}); result = _.countBy(list, {a: 42}); result = _.countBy(dictionary); result = _.countBy(dictionary, dictionaryIterator); result = _.countBy(dictionary, dictionaryIterator, any); result = _.countBy(dictionary, ''); result = _.countBy(dictionary, '', any); result = _.countBy<{a: number}, TResult>(dictionary, {a: 42}); result = _.countBy(dictionary, {a: 42}); result = _.countBy(numericDictionary); result = _.countBy(numericDictionary, numericDictionaryIterator); result = _.countBy(numericDictionary, numericDictionaryIterator, any); result = _.countBy(numericDictionary, ''); result = _.countBy(numericDictionary, '', any); result = _.countBy<{a: number}, TResult>(numericDictionary, {a: 42}); result = _.countBy(numericDictionary, {a: 42}); } { let resutl: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _('').countBy(); result = _('').countBy(stringIterator); result = _('').countBy(stringIterator, any); result = _(array).countBy(); result = _(array).countBy(listIterator); result = _(array).countBy(listIterator, any); result = _(array).countBy(''); result = _(array).countBy('', any); result = _(array).countBy<{a: number}>({a: 42}); result = _(array).countBy({a: 42}); result = _(list).countBy(); result = _(list).countBy(listIterator); result = _(list).countBy(listIterator, any); result = _(list).countBy(''); result = _(list).countBy('', any); result = _(list).countBy<{a: number}>({a: 42}); result = _(list).countBy({a: 42}); result = _(dictionary).countBy(); result = _(dictionary).countBy(dictionaryIterator); result = _(dictionary).countBy(dictionaryIterator, any); result = _(dictionary).countBy(''); result = _(dictionary).countBy('', any); result = _(dictionary).countBy<{a: number}>({a: 42}); result = _(dictionary).countBy({a: 42}); result = _(numericDictionary).countBy(); result = _(numericDictionary).countBy(numericDictionaryIterator); result = _(numericDictionary).countBy(numericDictionaryIterator, any); result = _(numericDictionary).countBy(''); result = _(numericDictionary).countBy('', any); result = _(numericDictionary).countBy<{a: number}>({a: 42}); result = _(numericDictionary).countBy({a: 42}); } { let resutl: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _('').chain().countBy(); result = _('').chain().countBy(stringIterator); result = _('').chain().countBy(stringIterator, any); result = _(array).chain().countBy(); result = _(array).chain().countBy(listIterator); result = _(array).chain().countBy(listIterator, any); result = _(array).chain().countBy(''); result = _(array).chain().countBy('', any); result = _(array).chain().countBy<{a: number}>({a: 42}); result = _(array).chain().countBy({a: 42}); result = _(list).chain().countBy(); result = _(list).chain().countBy(listIterator); result = _(list).chain().countBy(listIterator, any); result = _(list).chain().countBy(''); result = _(list).chain().countBy('', any); result = _(list).chain().countBy<{a: number}>({a: 42}); result = _(list).chain().countBy({a: 42}); result = _(dictionary).chain().countBy(); result = _(dictionary).chain().countBy(dictionaryIterator); result = _(dictionary).chain().countBy(dictionaryIterator, any); result = _(dictionary).chain().countBy(''); result = _(dictionary).chain().countBy('', any); result = _(dictionary).chain().countBy<{a: number}>({a: 42}); result = _(dictionary).chain().countBy({a: 42}); result = _(numericDictionary).chain().countBy(); result = _(numericDictionary).chain().countBy(numericDictionaryIterator); result = _(numericDictionary).chain().countBy(numericDictionaryIterator, any); result = _(numericDictionary).chain().countBy(''); result = _(numericDictionary).chain().countBy('', any); result = _(numericDictionary).chain().countBy<{a: number}>({a: 42}); result = _(numericDictionary).chain().countBy({a: 42}); } } // _.each namespace TestEach { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let stringIterator: (char: string, index: number, string: string) => any; let listIterator: (value: TResult, index: number, collection: _.List) => any; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string; _.each('', stringIterator); _.each('', stringIterator, any); } { let result: TResult[]; _.each(array, listIterator); _.each(array, listIterator, any); } { let result: _.List; _.each(list, listIterator); _.each(list, listIterator, any); } { let result: _.Dictionary; _.each(dictionary, dictionaryIterator); _.each(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').each(stringIterator); _('').each(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).each(listIterator); _(array).each(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).each(listIterator); _(list).each(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).each(dictionaryIterator); _(dictionary).each(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().each(stringIterator); _('').chain().each(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().each(listIterator); _(array).chain().each(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().each(listIterator); _(list).chain().each(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().each(dictionaryIterator); _(dictionary).chain().each(dictionaryIterator, any); } } // _.eachRight namespace TestEachRight { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let stringIterator: (char: string, index: number, string: string) => any; let listIterator: (value: TResult, index: number, collection: _.List) => any; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string; _.eachRight('', stringIterator); _.eachRight('', stringIterator, any); } { let result: TResult[]; _.eachRight(array, listIterator); _.eachRight(array, listIterator, any); } { let result: _.List; _.eachRight(list, listIterator); _.eachRight(list, listIterator, any); } { let result: _.Dictionary; _.eachRight(dictionary, dictionaryIterator); _.eachRight(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').eachRight(stringIterator); _('').eachRight(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).eachRight(listIterator); _(array).eachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).eachRight(listIterator); _(list).eachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).eachRight(dictionaryIterator); _(dictionary).eachRight(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().eachRight(stringIterator); _('').chain().eachRight(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().eachRight(listIterator); _(array).chain().eachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().eachRight(listIterator); _(list).chain().eachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().eachRight(dictionaryIterator); _(dictionary).chain().eachRight(dictionaryIterator, any); } } // _.every namespace TestEvery { type SampleObject = {a: number; b: string; c: boolean;}; let array: SampleObject[]; let list: _.List; let dictionary: _.Dictionary; let numericDictionary: _.NumericDictionary; let listIterator: (value: SampleObject, index: number, collection: _.List) => boolean; let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary) => boolean; let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary) => boolean; { let result: boolean; result = _.every(array); result = _.every(array, listIterator); result = _.every(array, 'a'); result = _.every(array, ['a', 42]); result = _.every<{a: number}, SampleObject>(array, {a: 42}); result = _.every(list); result = _.every(list, listIterator); result = _.every(list, 'a'); result = _.every(list, ['a', 42]); result = _.every<{a: number}, SampleObject>(list, {a: 42}); result = _.every(dictionary); result = _.every(dictionary, dictionaryIterator); result = _.every(dictionary, 'a'); result = _.every(dictionary, ['a', 42]); result = _.every<{a: number}, SampleObject>(dictionary, {a: 42}); result = _.every(numericDictionary); result = _.every(numericDictionary, numericDictionaryIterator); result = _.every(numericDictionary, 'a'); result = _.every(numericDictionary, ['a', 42]); result = _.every<{a: number}, SampleObject>(numericDictionary, {a: 42}); result = _(array).every(); result = _(array).every(listIterator); result = _(array).every('a'); result = _(array).every(['a', 42]); result = _(array).every<{a: number}>({a: 42}); result = _(list).every(); result = _(list).every(listIterator); result = _(list).every('a'); result = _(list).every(['a', 42]); result = _(list).every<{a: number}>({a: 42}); result = _(dictionary).every(); result = _(dictionary).every(dictionaryIterator); result = _(dictionary).every('a'); result = _(dictionary).every(['a', 42]); result = _(dictionary).every<{a: number}>({a: 42}); result = _(numericDictionary).every(); result = _(numericDictionary).every(numericDictionaryIterator); result = _(numericDictionary).every('a'); result = _(numericDictionary).every(['a', 42]); result = _(numericDictionary).every<{a: number}>({a: 42}); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().every(); result = _(array).chain().every(listIterator); result = _(array).chain().every('a'); result = _(array).chain().every(['a', 42]); result = _(array).chain().every<{a: number}>({a: 42}); result = _(list).chain().every(); result = _(list).chain().every(listIterator); result = _(list).chain().every('a'); result = _(list).chain().every(['a', 42]); result = _(list).chain().every<{a: number}>({a: 42}); result = _(dictionary).chain().every(); result = _(dictionary).chain().every(dictionaryIterator); result = _(dictionary).chain().every('a'); result = _(dictionary).chain().every(['a', 42]); result = _(dictionary).chain().every<{a: number}>({a: 42}); result = _(numericDictionary).chain().every(); result = _(numericDictionary).chain().every(numericDictionaryIterator); result = _(numericDictionary).chain().every('a'); result = _(numericDictionary).chain().every(['a', 42]); result = _(numericDictionary).chain().every<{a: number}>({a: 42}); } } // _.filter namespace TestFilter { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let stringIterator: (char: string, index: number, string: string) => any; let listIterator: (value: TResult, index: number, collection: _.List) => any; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string[]; result = _.filter('', stringIterator); result = _.filter('', stringIterator, any); } { let result: TResult[]; result = _.filter(array, listIterator); result = _.filter(array, listIterator, any); result = _.filter(array, ''); result = _.filter(array, '', any); result = _.filter<{a: number}, TResult>(array, {a: 42}); result = _.filter(list, listIterator); result = _.filter(list, listIterator, any); result = _.filter(list, ''); result = _.filter(list, '', any); result = _.filter<{a: number}, TResult>(list, {a: 42}); result = _.filter(dictionary, dictionaryIterator); result = _.filter(dictionary, dictionaryIterator, any); result = _.filter(dictionary, ''); result = _.filter(dictionary, '', any); result = _.filter<{a: number}, TResult>(dictionary, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _('').filter(stringIterator); result = _('').filter(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).filter(listIterator); result = _(array).filter(listIterator, any); result = _(array).filter(''); result = _(array).filter('', any); result = _(array).filter<{a: number}>({a: 42}); result = _(list).filter(listIterator); result = _(list).filter(listIterator, any); result = _(list).filter(''); result = _(list).filter('', any); result = _(list).filter<{a: number}, TResult>({a: 42}); result = _(dictionary).filter(dictionaryIterator); result = _(dictionary).filter(dictionaryIterator, any); result = _(dictionary).filter(''); result = _(dictionary).filter('', any); result = _(dictionary).filter<{a: number}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _('').chain().filter(stringIterator); result = _('').chain().filter(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().filter(listIterator); result = _(array).chain().filter(listIterator, any); result = _(array).chain().filter(''); result = _(array).chain().filter('', any); result = _(array).chain().filter<{a: number}>({a: 42}); result = _(list).chain().filter(listIterator); result = _(list).chain().filter(listIterator, any); result = _(list).chain().filter(''); result = _(list).chain().filter('', any); result = _(list).chain().filter<{a: number}, TResult>({a: 42}); result = _(dictionary).chain().filter(dictionaryIterator); result = _(dictionary).chain().filter(dictionaryIterator, any); result = _(dictionary).chain().filter(''); result = _(dictionary).chain().filter('', any); result = _(dictionary).chain().filter<{a: number}, TResult>({a: 42}); } } // _.find namespace TestFind { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: TResult, index: number, collection: _.List) => boolean; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => boolean; let result: TResult; result = _.find(array); result = _.find(array, listIterator); result = _.find(array, listIterator, any); result = _.find(array, ''); result = _.find<{a: number}, TResult>(array, {a: 42}); result = _.find(list); result = _.find(list, listIterator); result = _.find(list, listIterator, any); result = _.find(list, ''); result = _.find<{a: number}, TResult>(list, {a: 42}); result = _.find(dictionary); result = _.find(dictionary, dictionaryIterator); result = _.find(dictionary, dictionaryIterator, any); result = _.find(dictionary, ''); result = _.find<{a: number}, TResult>(dictionary, {a: 42}); result = _(array).find(); result = _(array).find(listIterator); result = _(array).find(listIterator, any); result = _(array).find(''); result = _(array).find<{a: number}>({a: 42}); result = _(list).find(); result = _(list).find(listIterator); result = _(list).find(listIterator, any); result = _(list).find(''); result = _(list).find<{a: number}, TResult>({a: 42}); result = _(dictionary).find(); result = _(dictionary).find(dictionaryIterator); result = _(dictionary).find(dictionaryIterator, any); result = _(dictionary).find(''); result = _(dictionary).find<{a: number}, TResult>({a: 42}); } result = _.findLast([1, 2, 3, 4], function (num) { return num % 2 == 0; }); result = _.findLast(foodsCombined, { 'type': 'vegetable' }); result = _.findLast(foodsCombined, 'organic'); result = _([1, 2, 3, 4]).findLast(function (num) { return num % 2 == 0; }); result = _(foodsCombined).findLast({ 'type': 'vegetable' }); result = _(foodsCombined).findLast('organic'); // _.flatMap namespace TestFlatMap { let numArray: (number|number[])[] = [1, [2, 3]]; let objArray: ({a: number}|{a: number}[])[] = [{a: 1}, [{a: 2}, {a: 3}]]; let numList: _.List = {0: 1, 1: [2, 3], length: 2}; let objList: _.List<{a: number}|{a: number}[]> = {0: {a: 1}, 1: [{a: 2}, {a: 3}], length: 2}; let numDictionary: _.Dictionary = {a: 1, b: [2, 3]}; let objDictionary: _.Dictionary<{a: number}|{a: number}[]> = {a: {a: 1}, b: [{a: 2}, {a: 3}]}; let numNumericDictionary: _.NumericDictionary = {0: 1, 1: [2, 3]}; let objNumericDictionary: _.NumericDictionary<{a: number}|{a: number}[]> = {0: {a: 1}, 1: [{a: 2}, {a: 3}]}; let stringIterator: (value: string, index: number, collection: _.List) => string|string[]; let listIterator: (value: number, index: number, collection: _.List) => number|number[]; let dictionaryIterator: (value: number, key: number, collection: _.Dictionary) => number|number[]; let numericDictionaryIterator: (value: number, key: number, collection: _.NumericDictionary) => number|number[]; { let result: string[]; result = _.flatMap('abc'); result = _.flatMap('abc'); result = _.flatMap('abc', stringIterator); result = _.flatMap('abc', stringIterator); } { let result: number[]; result = _.flatMap(numArray); result = _.flatMap(numArray); result = _.flatMap(numArray, listIterator); result = _.flatMap(numArray, listIterator); result = _.flatMap<({a: number}|{a: number}[])[], number>(objArray, 'a'); result = _.flatMap(objArray, 'a'); result = _.flatMap(numList); result = _.flatMap(numList); result = _.flatMap(numList, listIterator); result = _.flatMap(numList, listIterator); result = _.flatMap<_.List<{a: number}|{a: number}[]>, number>(objList, 'a'); result = _.flatMap(objList, 'a'); result = _.flatMap(numDictionary); result = _.flatMap(numDictionary); result = _.flatMap(numDictionary, dictionaryIterator); result = _.flatMap(numDictionary, dictionaryIterator); result = _.flatMap<_.Dictionary<{a: number}|{a: number}[]>, number>(objDictionary, 'a'); result = _.flatMap(objDictionary, 'a'); result = _.flatMap(numNumericDictionary); result = _.flatMap(numNumericDictionary); result = _.flatMap(numNumericDictionary, numericDictionaryIterator); result = _.flatMap(numNumericDictionary, numericDictionaryIterator); result = _.flatMap<_.NumericDictionary<{a: number}|{a: number}[]>, number>(objNumericDictionary, 'a'); result = _.flatMap(objNumericDictionary, 'a'); } { let result: boolean[]; result = _.flatMap<({a: number}|{a: number}[])[], boolean>(objArray, ['a', 42]); result = _.flatMap(objArray, ['a', 42]); result = _.flatMap<{a: number}, ({a: number}|{a: number}[])[]>(objArray, {'a': 42}); result = _.flatMap<({a: number}|{a: number}[])[], boolean>(objArray, {'a': 42}); result = _.flatMap(objArray, {'a': 42}); result = _.flatMap<_.List<{a: number}|{a: number}[]>, boolean>(objList, ['a', 42]); result = _.flatMap(objList, ['a', 42]); result = _.flatMap<{a: number}, _.List<{a: number}|{a: number}[]>>(objList, {'a': 42}); result = _.flatMap<_.List<{a: number}|{a: number}[]>, boolean>(objList, {'a': 42}); result = _.flatMap(objList, {'a': 42}); result = _.flatMap<_.Dictionary<{a: number}|{a: number}[]>, boolean>(objDictionary, ['a', 42]); result = _.flatMap(objDictionary, ['a', 42]); result = _.flatMap<{a: number}, _.Dictionary<{a: number}|{a: number}[]>>(objDictionary, {'a': 42}); result = _.flatMap<_.Dictionary<{a: number}|{a: number}[]>, boolean>(objDictionary, {'a': 42}); result = _.flatMap(objDictionary, {'a': 42}); result = _.flatMap<_.NumericDictionary<{a: number}|{a: number}[]>, boolean>(objNumericDictionary, ['a', 42]); result = _.flatMap(objNumericDictionary, ['a', 42]); result = _.flatMap<{a: number}, _.NumericDictionary<{a: number}|{a: number}[]>>(objNumericDictionary, {'a': 42}); result = _.flatMap<_.NumericDictionary<{a: number}|{a: number}[]>, boolean>(objNumericDictionary, {'a': 42}); result = _.flatMap(objNumericDictionary, {'a': 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').flatMap(); result = _('abc').flatMap(stringIterator); } { let result: _.LoDashImplicitArrayWrapper; result = _(numArray).flatMap(); result = _(numArray).flatMap(listIterator); result = _(objArray).flatMap('a'); result = _(numList).flatMap(); result = _(numList).flatMap(listIterator); result = _(objList).flatMap('a'); result = _(numDictionary).flatMap(); result = _(numDictionary).flatMap(dictionaryIterator); result = _(objDictionary).flatMap('a'); result = _(numNumericDictionary).flatMap(); result = _(numNumericDictionary).flatMap(numericDictionaryIterator); result = _(objNumericDictionary).flatMap('a'); } { let result: _.LoDashImplicitArrayWrapper; result = _(objArray).flatMap(['a', 42]); result = _(objArray).flatMap<{a: number}>({a: 42}); result = _(objList).flatMap(['a', 42]); result = _(objList).flatMap<{a: number}>({a: 42}); result = _(objDictionary).flatMap(['a', 42]); result = _(objDictionary).flatMap<{a: number}>({a: 42}); result = _(objNumericDictionary).flatMap(['a', 42]); result = _(objNumericDictionary).flatMap<{a: number}>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().flatMap(); result = _('abc').chain().flatMap(stringIterator); } { let result: _.LoDashExplicitArrayWrapper; result = _(numArray).chain().flatMap(); result = _(numArray).chain().flatMap(listIterator); result = _(objArray).chain().flatMap('a'); result = _(numList).chain().flatMap(); result = _(numList).chain().flatMap(listIterator); result = _(objList).chain().flatMap('a'); result = _(numDictionary).chain().flatMap(); result = _(numDictionary).chain().flatMap(dictionaryIterator); result = _(objDictionary).chain().flatMap('a'); result = _(numNumericDictionary).chain().flatMap(); result = _(numNumericDictionary).chain().flatMap(numericDictionaryIterator); result = _(objNumericDictionary).chain().flatMap('a'); } { let result: _.LoDashExplicitArrayWrapper; result = _(objArray).chain().flatMap(['a', 42]); result = _(objArray).chain().flatMap<{a: number}>({a: 42}); result = _(objList).chain().flatMap(['a', 42]); result = _(objList).chain().flatMap<{a: number}>({a: 42}); result = _(objDictionary).chain().flatMap(['a', 42]); result = _(objDictionary).chain().flatMap<{a: number}>({a: 42}); result = _(objNumericDictionary).chain().flatMap(['a', 42]); result = _(objNumericDictionary).chain().flatMap<{a: number}>({a: 42}); } } // _.forEach namespace TestForEach { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let stringIterator: (char: string, index: number, string: string) => any; let listIterator: (value: TResult, index: number, collection: _.List) => any; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string; _.forEach('', stringIterator); _.forEach('', stringIterator, any); } { let result: TResult[]; _.forEach(array, listIterator); _.forEach(array, listIterator, any); } { let result: _.List; _.forEach(list, listIterator); _.forEach(list, listIterator, any); } { let result: _.Dictionary; _.forEach(dictionary, dictionaryIterator); _.forEach(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').forEach(stringIterator); _('').forEach(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).forEach(listIterator); _(array).forEach(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).forEach(listIterator); _(list).forEach(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).forEach(dictionaryIterator); _(dictionary).forEach(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().forEach(stringIterator); _('').chain().forEach(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().forEach(listIterator); _(array).chain().forEach(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().forEach(listIterator); _(list).chain().forEach(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().forEach(dictionaryIterator); _(dictionary).chain().forEach(dictionaryIterator, any); } } // _.forEachRight namespace TestForEachRight { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let stringIterator: (char: string, index: number, string: string) => any; let listIterator: (value: TResult, index: number, collection: _.List) => any; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string; _.forEachRight('', stringIterator); _.forEachRight('', stringIterator, any); } { let result: TResult[]; _.forEachRight(array, listIterator); _.forEachRight(array, listIterator, any); } { let result: _.List; _.forEachRight(list, listIterator); _.forEachRight(list, listIterator, any); } { let result: _.Dictionary; _.forEachRight(dictionary, dictionaryIterator); _.forEachRight(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').forEachRight(stringIterator); _('').forEachRight(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).forEachRight(listIterator); _(array).forEachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).forEachRight(listIterator); _(list).forEachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).forEachRight(dictionaryIterator); _(dictionary).forEachRight(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().forEachRight(stringIterator); _('').chain().forEachRight(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().forEachRight(listIterator); _(array).chain().forEachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().forEachRight(listIterator); _(list).chain().forEachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().forEachRight(dictionaryIterator); _(dictionary).chain().forEachRight(dictionaryIterator, any); } } // _.groupBy namespace TestGroupBy { type SampleType = {a: number; b: string; c: boolean;}; let array: SampleType[]; let list: _.List; let dictionary: _.Dictionary; let stringIterator: (char: string, index: number, string: string) => number; let listIterator: (value: SampleType, index: number, collection: _.List) => number; let dictionaryIterator: (value: SampleType, key: string, collection: _.Dictionary) => number; { let result: _.Dictionary; result = _.groupBy(''); result = _.groupBy('', stringIterator); result = _.groupBy('', stringIterator, any); result = _.groupBy('', stringIterator); result = _.groupBy('', stringIterator, any); } { let result: _.Dictionary; result = _.groupBy(array); result = _.groupBy(array, listIterator); result = _.groupBy(array, listIterator, any); result = _.groupBy(array, ''); result = _.groupBy(array, '', any); result = _.groupBy(array, {a: 42}); result = _.groupBy(array, listIterator); result = _.groupBy(array, listIterator, any); result = _.groupBy(array, '', true); result = _.groupBy<{a: number}, SampleType>(array, {a: 42}); result = _.groupBy(list); result = _.groupBy(list, listIterator); result = _.groupBy(list, listIterator, any); result = _.groupBy(list, ''); result = _.groupBy(list, '', any); result = _.groupBy(list, {a: 42}); result = _.groupBy(list, listIterator); result = _.groupBy(list, listIterator, any); result = _.groupBy(list, '', true); result = _.groupBy<{a: number}, SampleType>(list, {a: 42}); result = _.groupBy(dictionary); result = _.groupBy(dictionary, dictionaryIterator); result = _.groupBy(dictionary, dictionaryIterator, any); result = _.groupBy(dictionary, ''); result = _.groupBy(dictionary, '', any); result = _.groupBy(dictionary, {a: 42}); result = _.groupBy(dictionary, dictionaryIterator); result = _.groupBy(dictionary, dictionaryIterator, any); result = _.groupBy(dictionary, '', true); result = _.groupBy<{a: number}, SampleType>(dictionary, {a: 42}); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _('').groupBy(); result = _('').groupBy(stringIterator); result = _('').groupBy(stringIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(array).groupBy(); result = _(array).groupBy(listIterator); result = _(array).groupBy(listIterator, any); result = _(array).groupBy(''); result = _(array).groupBy('', true); result = _(array).groupBy<{a: number}>({a: 42}); result = _(list).groupBy(); result = _(list).groupBy(listIterator); result = _(list).groupBy(listIterator, any); result = _(list).groupBy(''); result = _(list).groupBy('', any); result = _(list).groupBy({a: 42}); result = _(list).groupBy(listIterator); result = _(list).groupBy(listIterator, any); result = _(list).groupBy('', true); result = _(list).groupBy<{a: number}, SampleType>({a: 42}); result = _(dictionary).groupBy(); result = _(dictionary).groupBy(dictionaryIterator); result = _(dictionary).groupBy(dictionaryIterator, any); result = _(dictionary).groupBy(''); result = _(dictionary).groupBy('', any); result = _(dictionary).groupBy({a: 42}); result = _(dictionary).groupBy(dictionaryIterator); result = _(dictionary).groupBy(dictionaryIterator, any); result = _(dictionary).groupBy('', true); result = _(dictionary).groupBy<{a: number}, SampleType>({a: 42}); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _('').chain().groupBy(); result = _('').chain().groupBy(stringIterator); result = _('').chain().groupBy(stringIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(array).chain().groupBy(); result = _(array).chain().groupBy(listIterator); result = _(array).chain().groupBy(listIterator, any); result = _(array).chain().groupBy(''); result = _(array).chain().groupBy('', true); result = _(array).chain().groupBy<{a: number}>({a: 42}); result = _(list).chain().groupBy(); result = _(list).chain().groupBy(listIterator); result = _(list).chain().groupBy(listIterator, any); result = _(list).chain().groupBy(''); result = _(list).chain().groupBy('', any); result = _(list).chain().groupBy({a: 42}); result = _(list).chain().groupBy(listIterator); result = _(list).chain().groupBy(listIterator, any); result = _(list).chain().groupBy('', true); result = _(list).chain().groupBy<{a: number}, SampleType>({a: 42}); result = _(dictionary).chain().groupBy(); result = _(dictionary).chain().groupBy(dictionaryIterator); result = _(dictionary).chain().groupBy(dictionaryIterator, any); result = _(dictionary).chain().groupBy(''); result = _(dictionary).chain().groupBy('', any); result = _(dictionary).chain().groupBy({a: 42}); result = _(dictionary).chain().groupBy(dictionaryIterator); result = _(dictionary).chain().groupBy(dictionaryIterator, any); result = _(dictionary).chain().groupBy('', true); result = _(dictionary).chain().groupBy<{a: number}, SampleType>({a: 42}); } } // _.includes namespace TestIncludes { type SampleType = {a: string; b: number; c: boolean;}; let array: SampleType[]; let list: _.List; let dictionary: _.Dictionary; let target: SampleType; { let result: boolean; result = _.includes(array, target); result = _.includes(array, target, 42); result = _.includes(list, target); result = _.includes(list, target, 42); result = _.includes(dictionary, target); result = _.includes(dictionary, target, 42); result = _(array).includes(target); result = _(array).includes(target, 42); result = _(list).includes(target); result = _(list).includes(target, 42); result = _(dictionary).includes(target); result = _(dictionary).includes(target, 42); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().includes(target); result = _(array).chain().includes(target, 42); result = _(list).chain().includes(target); result = _(list).chain().includes(target, 42); result = _(dictionary).chain().includes(target); result = _(dictionary).chain().includes(target, 42); } } // _.keyBy namespace TestKeyBy { type SampleObject = {a: number; b: string; c: boolean;}; let array: SampleObject[]; let list: _.List; let dictionary: _.Dictionary; let numericDictionary: _.NumericDictionary; let stringIterator: (value: string, index: number, collection: string) => any; let listIterator: (value: SampleObject, index: number, collection: _.List) => any; let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary) => any; let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary) => any; { let result: _.Dictionary; result = _.keyBy('abcd'); result = _.keyBy('abcd', stringIterator); result = _.keyBy('abcd', stringIterator, any); } { let result: _.Dictionary; result = _.keyBy(array); result = _.keyBy(array, listIterator); result = _.keyBy(array, listIterator, any); result = _.keyBy(array, 'a'); result = _.keyBy(array, 'a', any); result = _.keyBy<{a: number}, SampleObject>(array, {a: 42}); result = _.keyBy(array, {a: 42}); result = _.keyBy(list); result = _.keyBy(list, listIterator); result = _.keyBy(list, listIterator, any); result = _.keyBy(list, 'a'); result = _.keyBy(list, 'a', any); result = _.keyBy<{a: number}, SampleObject>(list, {a: 42}); result = _.keyBy(list, {a: 42}); result = _.keyBy(numericDictionary); result = _.keyBy(numericDictionary, numericDictionaryIterator); result = _.keyBy(numericDictionary, numericDictionaryIterator, any); result = _.keyBy(numericDictionary, 'a'); result = _.keyBy(numericDictionary, 'a', any); result = _.keyBy<{a: number}, SampleObject>(numericDictionary, {a: 42}); result = _.keyBy(numericDictionary, {a: 42}); result = _.keyBy(dictionary); result = _.keyBy(dictionary, dictionaryIterator); result = _.keyBy(dictionary, dictionaryIterator, any); result = _.keyBy(dictionary, 'a'); result = _.keyBy(dictionary, 'a', any); result = _.keyBy<{a: number}, SampleObject>(dictionary, {a: 42}); result = _.keyBy(dictionary, {a: 42}); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _('abcd').keyBy(); result = _('abcd').keyBy(stringIterator); result = _('abcd').keyBy(stringIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(array).keyBy(); result = _(array).keyBy(listIterator); result = _(array).keyBy(listIterator, any); result = _(array).keyBy('a'); result = _(array).keyBy('a', any); result = _(array).keyBy<{a: number}>({a: 42}); result = _(list).keyBy(); result = _(list).keyBy(listIterator); result = _(list).keyBy(listIterator, any); result = _(list).keyBy('a'); result = _(list).keyBy('a', any); result = _(list).keyBy<{a: number}, SampleObject>({a: 42}); result = _(list).keyBy({a: 42}); result = _(numericDictionary).keyBy(); result = _(numericDictionary).keyBy(numericDictionaryIterator); result = _(numericDictionary).keyBy(numericDictionaryIterator, any); result = _(numericDictionary).keyBy('a'); result = _(numericDictionary).keyBy('a', any); result = _(numericDictionary).keyBy<{a: number}, SampleObject>({a: 42}); result = _(numericDictionary).keyBy({a: 42}); result = _(dictionary).keyBy(); result = _(dictionary).keyBy(dictionaryIterator); result = _(dictionary).keyBy(dictionaryIterator, any); result = _(dictionary).keyBy('a'); result = _(dictionary).keyBy('a', any); result = _(dictionary).keyBy<{a: number}, SampleObject>({a: 42}); result = _(dictionary).keyBy({a: 42}); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _('abcd').chain().keyBy(); result = _('abcd').chain().keyBy(stringIterator); result = _('abcd').chain().keyBy(stringIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(array).chain().keyBy(); result = _(array).chain().keyBy(listIterator); result = _(array).chain().keyBy(listIterator, any); result = _(array).chain().keyBy('a'); result = _(array).chain().keyBy('a', any); result = _(array).chain().keyBy<{a: number}>({a: 42}); result = _(list).chain().keyBy(); result = _(list).chain().keyBy(listIterator); result = _(list).chain().keyBy(listIterator, any); result = _(list).chain().keyBy('a'); result = _(list).chain().keyBy('a', any); result = _(list).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(list).chain().keyBy({a: 42}); result = _(numericDictionary).chain().keyBy(); result = _(numericDictionary).chain().keyBy(numericDictionaryIterator); result = _(numericDictionary).chain().keyBy(numericDictionaryIterator, any); result = _(numericDictionary).chain().keyBy('a'); result = _(numericDictionary).chain().keyBy('a', any); result = _(numericDictionary).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(numericDictionary).chain().keyBy({a: 42}); result = _(dictionary).chain().keyBy(); result = _(dictionary).chain().keyBy(dictionaryIterator); result = _(dictionary).chain().keyBy(dictionaryIterator, any); result = _(dictionary).chain().keyBy('a'); result = _(dictionary).chain().keyBy('a', any); result = _(dictionary).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(dictionary).chain().keyBy({a: 42}); } } //_.invoke namespace TestInvoke { let boolArray: boolean[] = [true, false]; let nestedDict: _.Dictionary> = { a: [0, 1, 2] } let numDict: _.Dictionary = { a: 1, b: 2, c: 3, d: 4 } let result: string; result = _.invoke(boolArray, "[1]"); result = _.invoke(boolArray, "[1]", 2); result = _.invoke(boolArray, [1, "toString"]); result = _.invoke(boolArray, [1, "toString"], 2); result = _.invoke(boolArray, "[1]"); result = _.invoke(boolArray, "[1]", 2); result = _.invoke(boolArray, [1, "toString"]); result = _.invoke(boolArray, [1, "toString"], 2); result = _.invoke(numDict, "a.toString"); result = _.invoke(numDict, "a.toString", 2); result = _.invoke(numDict, ["a", "toString"]); result = _.invoke(numDict, ["a", "toString"], 2); result = _.invoke(numDict, "a.toString"); result = _.invoke(numDict, "a.toString", 2); result = _.invoke(numDict, ["a", "toString"]); result = _.invoke(numDict, ["a", "toString"], 2); result = _.invoke(nestedDict, ["a[0].toString"]); result = _.invoke(nestedDict, ["a[0].toString"], 2); result = _.invoke(nestedDict, ["a", 0, "toString"]); result = _.invoke(nestedDict, ["a", 0, "toString"], 2); result = _.invoke, string>(nestedDict, ["a[0].toString"]); result = _.invoke, string>(nestedDict, ["a[0].toString"], 2); result = _.invoke, string>(nestedDict, ["a", 0, "toString"]); result = _.invoke, string>(nestedDict, ["a", 0, "toString"], 2); result = _(boolArray).invoke("[1]"); result = _(boolArray).invoke("[1]", 2); result = _(boolArray).invoke([1, "toString"]); result = _(boolArray).invoke([1, "toString"], 2); result = _(numDict).invoke("a.toString"); result = _(numDict).invoke("a.toString", 2); result = _(numDict).invoke(["a", "toString"]); result = _(numDict).invoke(["a", "toString"], 2); result = _(nestedDict).invoke("a[0].toString"); result = _(nestedDict).invoke("a[0].toString", 2); result = _(nestedDict).invoke(["a", 0, "toString"]); result = _(nestedDict).invoke(["a", 0, "toString"], 2); { let result: _.LoDashExplicitWrapper; result = _(boolArray).chain().invoke<_.LoDashExplicitWrapper>("[1]"); result = _(boolArray).chain().invoke<_.LoDashExplicitWrapper>("[1]", 2); result = _(boolArray).chain().invoke<_.LoDashExplicitWrapper>([1, "toString"]); result = _(boolArray).chain().invoke<_.LoDashExplicitWrapper>([1, "toString"], 2); result = _(numDict).chain().invoke<_.LoDashExplicitWrapper>("a.toString"); result = _(numDict).chain().invoke<_.LoDashExplicitWrapper>("a.toString", 2); result = _(numDict).chain().invoke<_.LoDashExplicitWrapper>(["a", "toString"]); result = _(numDict).chain().invoke<_.LoDashExplicitWrapper>(["a", "toString"], 2); result = _(nestedDict).chain().invoke<_.LoDashExplicitWrapper>("a[0].toString"); result = _(nestedDict).chain().invoke<_.LoDashExplicitWrapper>("a[0].toString", 2); result = _(nestedDict).chain().invoke<_.LoDashExplicitWrapper>(["a", 0, "toString"]); result = _(nestedDict).chain().invoke<_.LoDashExplicitWrapper>(["a", 0, "toString"], 2); } } //_.invokeMap namespace TestInvokeMap { let numArray = [4, 2, 1, 3] let numDict: _.Dictionary = { a: 1, b: 2, c: 3, d: 4 } let result: string[]; result = _.invokeMap(numArray, 'toString'); result = _.invokeMap(numArray, 'toString', 2); result = _.invokeMap(numArray, 'toString'); result = _.invokeMap(numArray, 'toString', 2); result = _(numArray).invokeMap('toString').value(); result = _(numArray).invokeMap('toString', 2).value(); result = _(numArray).chain().invokeMap('toString').value(); result = _(numArray).chain().invokeMap('toString', 2).value(); result = _.invokeMap(numArray, Number.prototype.toString); result = _.invokeMap(numArray, Number.prototype.toString, 2); result = _.invokeMap(numArray, Number.prototype.toString); result = _.invokeMap(numArray, Number.prototype.toString, 2); result = _(numArray).invokeMap(Number.prototype.toString).value(); result = _(numArray).invokeMap(Number.prototype.toString, 2).value(); result = _(numArray).chain().invokeMap(Number.prototype.toString).value(); result = _(numArray).chain().invokeMap(Number.prototype.toString, 2).value(); result = _.invokeMap(numDict, 'toString'); result = _.invokeMap(numDict, 'toString', 2); result = _.invokeMap(numDict, 'toString'); result = _.invokeMap(numDict, 'toString', 2); result = _(numDict).invokeMap('toString').value(); result = _(numDict).invokeMap('toString', 2).value(); result = _(numDict).chain().invokeMap('toString').value(); result = _(numDict).chain().invokeMap('toString', 2).value(); result = _.invokeMap(numDict, Number.prototype.toString); result = _.invokeMap(numDict, Number.prototype.toString, 2); result = _.invokeMap(numDict, Number.prototype.toString); result = _.invokeMap(numDict, Number.prototype.toString, 2); result = _(numDict).invokeMap(Number.prototype.toString).value(); result = _(numDict).invokeMap(Number.prototype.toString, 2).value(); result = _(numDict).chain().invokeMap(Number.prototype.toString).value(); result = _(numDict).chain().invokeMap(Number.prototype.toString, 2).value(); } // _.map namespace TestMap { let array: number[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: number, index: number, collection: _.List) => TResult; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => TResult; { let result: TResult[]; result = _.map(array); result = _.map(array, listIterator); result = _.map(array, listIterator, any); result = _.map(array, ''); result = _.map(list); result = _.map(list, listIterator); result = _.map(list, listIterator, any); result = _.map(list, ''); result = _.map(dictionary); result = _.map(dictionary, dictionaryIterator); result = _.map(dictionary, dictionaryIterator, any); result = _.map(dictionary, ''); } { let result: boolean[]; result = _.map(array, {}); result = _.map(list, {}); result = _.map(dictionary, {}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).map(); result = _(array).map(listIterator); result = _(array).map(listIterator, any); result = _(array).map(''); result = _(list).map(); result = _(list).map(listIterator); result = _(list).map(listIterator, any); result = _(list).map(''); result = _(dictionary).map(); result = _(dictionary).map(dictionaryIterator); result = _(dictionary).map(dictionaryIterator, any); result = _(dictionary).map(''); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).map<{}>({}); result = _(list).map<{}>({}); result = _(dictionary).map<{}>({}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().map(); result = _(array).chain().map(listIterator); result = _(array).chain().map(listIterator, any); result = _(array).chain().map(''); result = _(list).chain().map(); result = _(list).chain().map(listIterator); result = _(list).chain().map(listIterator, any); result = _(list).chain().map(''); result = _(dictionary).chain().map(); result = _(dictionary).chain().map(dictionaryIterator); result = _(dictionary).chain().map(dictionaryIterator, any); result = _(dictionary).chain().map(''); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().map<{}>({}); result = _(list).chain().map<{}>({}); result = _(dictionary).chain().map<{}>({}); } } // _.partition result = _.partition('abcd', (n) => n < 'c'); result = _.partition(['a', 'b', 'c', 'd'], (n) => n < 'c'); result = _.partition([1, 2, 3, 4], (n) => n < 3); result = _.partition({0: 1, 1: 2, 2: 3, 3: 4, length: 4}, (n) => n < 3); result = _.partition({a: 1, b: 2, c: 3, d: 4}, (n) => n < 3); result = <{a: number}[][]>_.partition<{a: number}, {a: number}>([{a: 1}, {a: 2}], {a: 2}); result = <{a: number}[][]>_.partition<{a: number}, {a: number}>({0: {a: 1}, 1: {a: 2}, length: 2}, {a: 2}); result = <{a: number}[][]>_.partition<{a: number}, {a: number}>({0: {a: 1}, 1: {a: 2}}, {a: 2}); result = <{a: number}[][]>_.partition<{a: number}>([{a: 1}, {a: 2}], 'a'); result = <{a: number}[][]>_.partition<{a: number}>([{a: 1}, {a: 2}], 'a', 2); result = <{a: number}[][]>_.partition<{a: number}>({0: {a: 1}, 1: {a: 2}, length: 2}, 'a'); result = <{a: number}[][]>_.partition<{a: number}>({0: {a: 1}, 1: {a: 2}, length: 2}, 'a', 2); result = <{a: number}[][]>_.partition<{a: number}>({0: {a: 1}, 1: {a: 2}}, 'a'); result = <{a: number}[][]>_.partition<{a: number}>({0: {a: 1}, 1: {a: 2}}, 'a', 2); result = _('abcd').partition((n) => n < 'c').value(); result = _(['a', 'b', 'c', 'd']).partition((n) => n < 'c').value(); result = _([1, 2, 3, 4]).partition((n) => n < 3).value(); result = _({0: 1, 1: 2, 2: 3, 3: 4, length: 4}).partition((n) => n < 3).value(); result = _({a: 1, b: 2, c: 3, d: 4}).partition((n) => n < 3).value(); result = <{a: number}[][]>_([{a: 1}, {a: 2}]).partition<{a: number}>({a: 2}).value(); result = <{a: number}[][]>_({0: {a: 1}, 1: {a: 2}, length: 2}).partition<{a: number}, {a: number}>({a: 2}).value(); result = <{a: number}[][]>_({0: {a: 1}, 1: {a: 2}}).partition<{a: number}, {a: number}>({a: 2}).value(); result = <{a: number}[][]>_([{a: 1}, {a: 2}]).partition('a').value(); result = <{a: number}[][]>_([{a: 1}, {a: 2}]).partition('a', 2).value(); result = <{a: number}[][]>_({0: {a: 1}, 1: {a: 2}}).partition<{a: number}>('a').value(); result = <{a: number}[][]>_({0: {a: 1}, 1: {a: 2}}).partition<{a: number}>('a', 2).value(); // TODO // _.map with iteratee shorthand // module TestMapInsteadOfPluck { // interface SampleObject { // d: {b: TResult}[]; // } // // let array: SampleObject[]; // let list: _.List; // let dictionary: _.Dictionary; // // { // let result: any[]; // // result = _.map(array, 'd.0.b'); // result = _.map(array, ['d', 0, 'b']); // // result = _.map(list, 'd.0.b'); // result = _.map(list, ['d', 0, 'b']); // // result = _.map(dictionary, 'd.0.b'); // result = _.map(dictionary, ['d', 0, 'b']); // } // // { // let result: TResult[]; // // result = _.map(array, 'd.0.b'); // result = _.map(array, ['d', 0, 'b']); // // result = _.map(list, 'd.0.b'); // result = _.map(list, ['d', 0, 'b']); // // result = _.map(dictionary, 'd.0.b'); // result = _.map(dictionary, ['d', 0, 'b']); // } // // { // let result: _.LoDashImplicitArrayWrapper; // // result = _(array).map('d.0.b'); // result = _(array).map(['d', 0, 'b']); // // result = _(list).map('d.0.b'); // result = _(list).map(['d', 0, 'b']); // // result = _(dictionary).map('d.0.b'); // result = _(dictionary).map(['d', 0, 'b']); // } // // { // let result: _.LoDashExplicitArrayWrapper; // // result = _(array).chain().map('d.0.b'); // result = _(array).chain().map(['d', 0, 'b']); // // result = _(list).chain().map('d.0.b'); // result = _(list).chain().map(['d', 0, 'b']); // // result = _(dictionary).chain().map('d.0.b'); // result = _(dictionary).chain().map(['d', 0, 'b']); // } // } interface ABC { [index: string]: number; a: number; b: number; c: number; } result = _.reduce([1, 2, 3], function (sum: number, num: number) { return sum + num; }); result = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) { r[key] = num * 3; return r; }, {}); result = _([1, 2, 3]).reduce(function (sum: number, num: number) { return sum + num; }); result = _({ 'a': 1, 'b': 2, 'c': 3 }).reduce(function (r: ABC, num: number, key: string) { r[key] = num * 3; return r; }, {}); result = _.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); // _.reject namespace TestReject { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let stringIterator: (char: string, index: number, string: string) => any; let listIterator: (value: TResult, index: number, collection: _.List) => any; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; { let result: string[]; result = _.reject('', stringIterator); result = _.reject('', stringIterator, any); } { let result: TResult[]; result = _.reject(array, listIterator); result = _.reject(array, listIterator, any); result = _.reject(array, ''); result = _.reject(array, '', any); result = _.reject<{a: number}, TResult>(array, {a: 42}); result = _.reject(list, listIterator); result = _.reject(list, listIterator, any); result = _.reject(list, ''); result = _.reject(list, '', any); result = _.reject<{a: number}, TResult>(list, {a: 42}); result = _.reject(dictionary, dictionaryIterator); result = _.reject(dictionary, dictionaryIterator, any); result = _.reject(dictionary, ''); result = _.reject(dictionary, '', any); result = _.reject<{a: number}, TResult>(dictionary, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _('').reject(stringIterator); result = _('').reject(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).reject(listIterator); result = _(array).reject(listIterator, any); result = _(array).reject(''); result = _(array).reject('', any); result = _(array).reject<{a: number}>({a: 42}); result = _(list).reject(listIterator); result = _(list).reject(listIterator, any); result = _(list).reject(''); result = _(list).reject('', any); result = _(list).reject<{a: number}, TResult>({a: 42}); result = _(dictionary).reject(dictionaryIterator); result = _(dictionary).reject(dictionaryIterator, any); result = _(dictionary).reject(''); result = _(dictionary).reject('', any); result = _(dictionary).reject<{a: number}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _('').chain().reject(stringIterator); result = _('').chain().reject(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().reject(listIterator); result = _(array).chain().reject(listIterator, any); result = _(array).chain().reject(''); result = _(array).chain().reject('', any); result = _(array).chain().reject<{a: number}>({a: 42}); result = _(list).chain().reject(listIterator); result = _(list).chain().reject(listIterator, any); result = _(list).chain().reject(''); result = _(list).chain().reject('', any); result = _(list).chain().reject<{a: number}, TResult>({a: 42}); result = _(dictionary).chain().reject(dictionaryIterator); result = _(dictionary).chain().reject(dictionaryIterator, any); result = _(dictionary).chain().reject(''); result = _(dictionary).chain().reject('', any); result = _(dictionary).chain().reject<{a: number}, TResult>({a: 42}); } } // _.sample namespace TestSample { let array: string[]; let list: _.List; let dictionary: _.Dictionary; let numericDictionary: _.NumericDictionary; { let result: string; result = _.sample('abc'); result = _.sample(array); result = _.sample(list); result = _.sample(dictionary); result = _.sample(numericDictionary); result = _.sample<{a: string}, string>({a: 'foo'}); result = _.sample({a: 'foo'}); result = _('abc').sample(); result = _(array).sample(); result = _(list).sample(); result = _(dictionary).sample(); result = _(numericDictionary).sample(); result = _({a: 'foo'}).sample(); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().sample(); result = _(array).chain().sample<_.LoDashExplicitWrapper>(); result = _(list).chain().sample<_.LoDashExplicitWrapper>(); result = _(dictionary).chain().sample<_.LoDashExplicitWrapper>(); result = _(numericDictionary).chain().sample<_.LoDashExplicitWrapper>(); result = _({a: 'foo'}).chain().sample<_.LoDashExplicitWrapper>(); } } // _.sampleSize namespace TestSampleSize { let array: string[]; let list: _.List; let dictionary: _.Dictionary; let numericDictionary: _.NumericDictionary; { let result: string[]; result = _.sampleSize('abc'); result = _.sampleSize('abc', 42); result = _.sampleSize(array); result = _.sampleSize(array, 42); result = _.sampleSize(list); result = _.sampleSize(list, 42); result = _.sampleSize(dictionary); result = _.sampleSize(dictionary, 42); result = _.sampleSize(numericDictionary); result = _.sampleSize(numericDictionary, 42); result = _.sampleSize<{a: string}, string>({a: 'foo'}); result = _.sampleSize<{a: string}, string>({a: 'foo'}, 42); result = _.sampleSize({a: 'foo'}); result = _.sampleSize({a: 'foo'}, 42); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').sampleSize(); result = _('abc').sampleSize(42); result = _(array).sampleSize(); result = _(array).sampleSize(42); result = _(list).sampleSize(); result = _(list).sampleSize(42); result = _(dictionary).sampleSize(); result = _(dictionary).sampleSize(42); result = _(numericDictionary).sampleSize(); result = _(numericDictionary).sampleSize(42); result = _({a: 'foo'}).sampleSize(); result = _({a: 'foo'}).sampleSize(42); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().sampleSize(); result = _('abc').chain().sampleSize(42); result = _(array).chain().sampleSize(); result = _(array).chain().sampleSize(42); result = _(list).chain().sampleSize(); result = _(list).chain().sampleSize(42); result = _(dictionary).chain().sampleSize(); result = _(dictionary).chain().sampleSize(42); result = _(numericDictionary).chain().sampleSize(); result = _(numericDictionary).chain().sampleSize(42); result = _({a: 'foo'}).chain().sampleSize(); result = _({a: 'foo'}).chain().sampleSize(42); } } // _.shuffle namespace TestShuffle { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; { let result: string[]; result = _.shuffle('abc'); } { let result: TResult[]; result = _.shuffle(array); result = _.shuffle(list); result = _.shuffle(dictionary); } { let result: _.LoDashImplicitArrayWrapper; result = _('abc').shuffle(); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).shuffle(); result = _(list).shuffle(); result = _(dictionary).shuffle(); } { let result: _.LoDashExplicitArrayWrapper; result = _('abc').chain().shuffle(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().shuffle(); result = _(list).chain().shuffle(); result = _(dictionary).chain().shuffle(); } } // _.size namespace TestSize { type SampleType = {a: string; b: number; c: boolean;}; let array: SampleType[]; let list: _.List; let dictionary: _.Dictionary; { let result: number; result = _.size(array); result = _.size(list); result = _.size(dictionary); result = _.size(''); result = _(array).size(); result = _(list).size(); result = _(dictionary).size(); result = _('').size(); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().size(); result = _(list).chain().size(); result = _(dictionary).chain().size(); result = _('').chain().size(); } } // _.some namespace TestSome { type SampleObject = {a: number; b: string; c: boolean;}; let array: SampleObject[]; let list: _.List; let dictionary: _.Dictionary; let numericDictionary: _.NumericDictionary; let sampleObject: SampleObject; let listIterator: (value: SampleObject, index: number, collection: _.List) => boolean; let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary) => boolean; let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary) => boolean; let objectIterator: (value: any, key: string, collection: any) => boolean; { let result: boolean; result = _.some(array); result = _.some(array, listIterator); result = _.some(array, 'a'); result = _.some(array, ['a', 42]); result = _.some<{a: number}, SampleObject>(array, {a: 42}); result = _.some(list); result = _.some(list, listIterator); result = _.some(list, 'a'); result = _.some(list, ['a', 42]); result = _.some<{a: number}, SampleObject>(list, {a: 42}); result = _.some(dictionary); result = _.some(dictionary, dictionaryIterator); result = _.some(dictionary, 'a'); result = _.some(dictionary, ['a', 42]); result = _.some<{a: number}, SampleObject>(dictionary, {a: 42}); result = _.some(numericDictionary); result = _.some(numericDictionary, numericDictionaryIterator); result = _.some(numericDictionary, 'a'); result = _.some(numericDictionary, ['a', 42]); result = _.some<{a: number}, SampleObject>(numericDictionary, {a: 42}); result = _.some(sampleObject); result = _.some(sampleObject, objectIterator); result = _.some(sampleObject, 'a'); result = _.some(sampleObject, ['a', 42]); result = _.some<{a: number}>(sampleObject, {a: 42}); result = _(array).some(); result = _(array).some(listIterator); result = _(array).some('a'); result = _(array).some(['a', 42]); result = _(array).some<{a: number}>({a: 42}); result = _(list).some(); result = _(list).some(listIterator); result = _(list).some('a'); result = _(list).some(['a', 42]); result = _(list).some<{a: number}>({a: 42}); result = _(dictionary).some(); result = _(dictionary).some(dictionaryIterator); result = _(dictionary).some('a'); result = _(dictionary).some(['a', 42]); result = _(dictionary).some<{a: number}>({a: 42}); result = _(numericDictionary).some(); result = _(numericDictionary).some(numericDictionaryIterator); result = _(numericDictionary).some('a'); result = _(numericDictionary).some(['a', 42]); result = _(numericDictionary).some<{a: number}>({a: 42}); result = _(sampleObject).some(); result = _(sampleObject).some(objectIterator); result = _(sampleObject).some('a'); result = _(sampleObject).some(['a', 42]); result = _(sampleObject).some<{a: number}>({a: 42}); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().some(); result = _(array).chain().some(listIterator); result = _(array).chain().some('a'); result = _(array).chain().some(['a', 42]); result = _(array).chain().some<{a: number}>({a: 42}); result = _(list).chain().some(); result = _(list).chain().some(listIterator); result = _(list).chain().some('a'); result = _(list).chain().some(['a', 42]); result = _(list).chain().some<{a: number}>({a: 42}); result = _(dictionary).chain().some(); result = _(dictionary).chain().some(dictionaryIterator); result = _(dictionary).chain().some('a'); result = _(dictionary).chain().some(['a', 42]); result = _(dictionary).chain().some<{a: number}>({a: 42}); result = _(numericDictionary).chain().some(); result = _(numericDictionary).chain().some(numericDictionaryIterator); result = _(numericDictionary).chain().some('a'); result = _(numericDictionary).chain().some(['a', 42]); result = _(numericDictionary).chain().some<{a: number}>({a: 42}); result = _(sampleObject).chain().some(); result = _(sampleObject).chain().some(objectIterator); result = _(sampleObject).chain().some('a'); result = _(sampleObject).chain().some(['a', 42]); result = _(sampleObject).chain().some<{a: number}>({a: 42}); } } // _.sortBy namespace TestSortBy { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: TResult, index: number, collection: _.List) => number; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => number; { let result: TResult[]; result = _.sortBy(array); result = _.sortBy(array, listIterator); result = _.sortBy(array, ''); result = _.sortBy<{a: number}, TResult>(array, {a: 42}); result = _.sortBy(list); result = _.sortBy(list, listIterator); result = _.sortBy(list, ''); result = _.sortBy<{a: number}, TResult>(list, {a: 42}); result = _.sortBy(dictionary); result = _.sortBy(dictionary, dictionaryIterator); result = _.sortBy(dictionary, ''); result = _.sortBy<{a: number}, TResult>(dictionary, {a: 42}); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).sortBy(); result = _(array).sortBy(listIterator); result = _(array).sortBy(''); result = _(array).sortBy<{a: number}>({a: 42}); result = _(list).sortBy(); result = _(list).sortBy(listIterator); result = _(list).sortBy(''); result = _(list).sortBy<{a: number}, TResult>({a: 42}); result = _(dictionary).sortBy(); result = _(dictionary).sortBy(dictionaryIterator); result = _(dictionary).sortBy(''); result = _(dictionary).sortBy<{a: number}, TResult>({a: 42}); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().sortBy(); result = _(array).chain().sortBy(listIterator); result = _(array).chain().sortBy(''); result = _(array).chain().sortBy<{a: number}>({a: 42}); result = _(list).chain().sortBy(); result = _(list).chain().sortBy(listIterator); result = _(list).chain().sortBy(''); result = _(list).chain().sortBy<{a: number}, TResult>({a: 42}); result = _(dictionary).chain().sortBy(); result = _(dictionary).chain().sortBy(dictionaryIterator); result = _(dictionary).chain().sortBy(''); result = _(dictionary).chain().sortBy<{a: number}, TResult>({a: 42}); } } result = _.sortBy(stoogesAges, function(stooge) { return Math.sin(stooge.age); }, function(stooge) { return stooge.name.slice(1); }); result = _.sortBy(stoogesAges, ['name', 'age']); result = _.sortBy(stoogesAges, 'name', function(stooge) { return Math.sin(stooge.age); }); result = _(foodsOrganic).sortBy('organic', (food) => food.name, { organic: true }).value(); // _.orderBy namespace TestorderBy { type SampleObject = {a: number; b: string; c: boolean}; let array: SampleObject[]; let list: _.List; let numericDictionary: _.NumericDictionary; let dictionary: _.Dictionary; let orders: boolean|string|(boolean|string)[]; { let iteratees: (value: string) => any|((value: string) => any)[]; let result: string[]; result = _.orderBy('acbd', iteratees); result = _.orderBy('acbd', iteratees, orders); } { let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[]; let result: SampleObject[]; result = _.orderBy<{a: number}, SampleObject>(array, iteratees); result = _.orderBy<{a: number}, SampleObject>(array, iteratees, orders); result = _.orderBy(array, iteratees); result = _.orderBy(array, iteratees, orders); result = _.orderBy<{a: number}, SampleObject>(list, iteratees); result = _.orderBy<{a: number}, SampleObject>(list, iteratees, orders); result = _.orderBy(list, iteratees); result = _.orderBy(list, iteratees, orders); result = _.orderBy<{a: number}, SampleObject>(numericDictionary, iteratees); result = _.orderBy<{a: number}, SampleObject>(numericDictionary, iteratees, orders); result = _.orderBy(numericDictionary, iteratees); result = _.orderBy(numericDictionary, iteratees, orders); result = _.orderBy<{a: number}, SampleObject>(dictionary, iteratees); result = _.orderBy<{a: number}, SampleObject>(dictionary, iteratees, orders); result = _.orderBy(dictionary, iteratees); result = _.orderBy(dictionary, iteratees, orders); } { let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[]; let result: _.LoDashImplicitArrayWrapper; result = _(array).orderBy<{a: number}>(iteratees); result = _(array).orderBy<{a: number}>(iteratees, orders); result = _(list).orderBy<{a: number}, SampleObject>(iteratees); result = _(list).orderBy<{a: number}, SampleObject>(iteratees, orders); result = _(list).orderBy(iteratees); result = _(list).orderBy(iteratees, orders); result = _(numericDictionary).orderBy<{a: number}, SampleObject>(iteratees); result = _(numericDictionary).orderBy<{a: number}, SampleObject>(iteratees, orders); result = _(numericDictionary).orderBy(iteratees); result = _(numericDictionary).orderBy(iteratees, orders); result = _(dictionary).orderBy<{a: number}, SampleObject>(iteratees); result = _(dictionary).orderBy<{a: number}, SampleObject>(iteratees, orders); result = _(dictionary).orderBy(iteratees); result = _(dictionary).orderBy(iteratees, orders); } { let iteratees: (value: SampleObject) => any|string|{a: number}|((value: SampleObject) => any|string|{a: number})[]; let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().orderBy<{a: number}>(iteratees); result = _(array).chain().orderBy<{a: number}>(iteratees, orders); result = _(list).chain().orderBy<{a: number}, SampleObject>(iteratees); result = _(list).chain().orderBy<{a: number}, SampleObject>(iteratees, orders); result = _(list).chain().orderBy(iteratees); result = _(list).chain().orderBy(iteratees, orders); result = _(numericDictionary).chain().orderBy<{a: number}, SampleObject>(iteratees); result = _(numericDictionary).chain().orderBy<{a: number}, SampleObject>(iteratees, orders); result = _(numericDictionary).chain().orderBy(iteratees); result = _(numericDictionary).chain().orderBy(iteratees, orders); result = _(dictionary).chain().orderBy<{a: number}, SampleObject>(iteratees); result = _(dictionary).chain().orderBy<{a: number}, SampleObject>(iteratees, orders); result = _(dictionary).chain().orderBy(iteratees); result = _(dictionary).chain().orderBy(iteratees, orders); } } /******** * Date * ********/ namespace TestNow { { let result: number; result = _.now(); result = _(42).now(); result = _([]).now(); result = _({}).now(); } { let result: _.LoDashExplicitWrapper; result = _(42).chain().now(); result = _([]).chain().now(); result = _({}).chain().now(); } } /************* * Functions * *************/ // _.after namespace TestAfter { interface Func { (a: string, b: number): boolean; } let func: Func; { let result: Func; _.after(42, func); } { let result: _.LoDashImplicitObjectWrapper; _(42).after(func); } { let result: _.LoDashExplicitObjectWrapper; _(42).chain().after(func); } } // _.ary namespace TestAry { type SampleFunc = (a: number, b: string) => boolean; let func: SampleFunc; { let result: SampleFunc; result = _.ary(func); result = _.ary(func, 2); result = _.ary(func); result = _.ary(func, 2); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).ary(); result = _(func).ary(2); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().ary(); result = _(func).chain().ary(2); } } // _.before namespace TestBefore { interface Func { (a: string, b: number): boolean; } let func: Func; { let result: Func; _.before(42, func); } { let result: _.LoDashImplicitObjectWrapper; _(42).before(func); } { let result: _.LoDashExplicitObjectWrapper; _(42).chain().before(func); } } // _.bind namespace TestBind { type SampleFunc = (a: number, b: string) => boolean; let func: SampleFunc { type SampleResult = (a: number, b: string) => boolean; let result: SampleResult; result = _.bind(func, any); result = _.bind(func, any); } { type SampleResult = (b: string) => boolean; let result: SampleResult; result = _.bind(func, any, 42); result = _.bind(func, any, 42); } { type SampleResult = () => boolean; let result: SampleResult; result = _.bind(func, any, 42, ''); result = _.bind(func, any, 42, ''); } { type SampleResult = (a: number, b: string) => boolean; let result: _.LoDashImplicitObjectWrapper; result = _(func).bind(any); } { type SampleResult = (b: string) => boolean; let result: _.LoDashImplicitObjectWrapper; result = _(func).bind(any, 42); } { type SampleResult = () => boolean; let result: _.LoDashImplicitObjectWrapper; result = _(func).bind(any, 42, ''); } { type SampleResult = (a: number, b: string) => boolean; let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().bind(any); } { type SampleResult = (b: string) => boolean; let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().bind(any, 42); } { type SampleResult = () => boolean; let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().bind(any, 42, ''); } } // _.bindAll namespace TestBindAll { interface SampleObject { a: Function; b: Function; c: Function; } let object: SampleObject; { let result: SampleObject; result = _.bindAll(object); result = _.bindAll(object, 'c'); result = _.bindAll(object, ['b'], 'c'); result = _.bindAll(object, 'a', ['b'], 'c'); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).bindAll(); result = _(object).bindAll('c'); result = _(object).bindAll(['b'], 'c'); result = _(object).bindAll('a', ['b'], 'c'); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().bindAll(); result = _(object).chain().bindAll('c'); result = _(object).chain().bindAll(['b'], 'c'); result = _(object).chain().bindAll('a', ['b'], 'c'); } } // _.bindKey namespace TestBindKey { let object: { foo: (a: number, b: string) => boolean; } { type SampleResult = (a: number, b: string) => boolean; let result: SampleResult; result = _.bindKey(object, 'foo'); result = _.bindKey(object, 'foo'); } { type SampleResult = (b: string) => boolean; let result: SampleResult; result = _.bindKey(object, 'foo', 42); result = _.bindKey(object, 'foo', 42); } { type SampleResult = () => boolean; let result: SampleResult; result = _.bindKey(object, 'foo', 42, ''); result = _.bindKey(object, 'foo', 42, ''); } { type SampleResult = (a: number, b: string) => boolean; let result: _.LoDashImplicitObjectWrapper; result = _(object).bindKey('foo'); } { type SampleResult = (b: string) => boolean; let result: _.LoDashImplicitObjectWrapper; result = _(object).bindKey('foo', 42); } { type SampleResult = () => boolean; let result: _.LoDashImplicitObjectWrapper; result = _(object).bindKey('foo', 42, ''); } { type SampleResult = (a: number, b: string) => boolean; let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().bindKey('foo'); } { type SampleResult = (b: string) => boolean; let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().bindKey('foo', 42); } { type SampleResult = () => boolean; let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().bindKey('foo', 42, ''); } } var createCallbackObj: { [index: string]: string; } = { name: 'Joe' }; result = <() => any>_.createCallback('name'); result = <() => boolean>_.createCallback(createCallbackObj); result = <_.LoDashImplicitObjectWrapper<() => any>>_('name').createCallback(); result = <_.LoDashImplicitObjectWrapper<() => boolean>>_(createCallbackObj).createCallback(); // _.curry var testCurryFn = (a: number, b: number, c: number) => [a, b, c]; let curryResult0: number[] let curryResult1: _.CurriedFunction1 let curryResult2: _.CurriedFunction2 curryResult0 = _.curry(testCurryFn)(1, 2, 3); curryResult1 = _.curry(testCurryFn)(1, 2); curryResult0 = _.curry(testCurryFn)(1, 2)(3); curryResult0 = _.curry(testCurryFn)(1)(2)(3); curryResult2 = _.curry(testCurryFn)(1); curryResult1 = _.curry(testCurryFn)(1)(2); curryResult0 = _.curry(testCurryFn)(1)(2)(3); curryResult0 = _.curry(testCurryFn)(1)(2, 3); curryResult0 = _(testCurryFn).curry().value()(1, 2, 3); curryResult2 = _(testCurryFn).curry().value()(1); declare function testCurry2(a: string, b: number, c: boolean): [string, number, boolean]; let curryResult3: [string, number, boolean]; let curryResult4: _.CurriedFunction1; let curryResult5: _.CurriedFunction2; let curryResult6: _.CurriedFunction3; curryResult3 = _.curry(testCurry2)("1", 2, true); curryResult3 = _.curry(testCurry2)("1", 2)(true); curryResult3 = _.curry(testCurry2)("1")(2, true); curryResult3 = _.curry(testCurry2)("1")(2)(true); curryResult4 = _.curry(testCurry2)("1", 2); curryResult4 = _.curry(testCurry2)("1")(2); curryResult5 = _.curry(testCurry2)("1"); curryResult6 = _.curry(testCurry2); // _.curryRight var testCurryRightFn = (a: number, b: number, c: number) => [a, b, c]; curryResult0 = _.curryRight(testCurryRightFn)(1, 2, 3); curryResult2 = _.curryRight(testCurryRightFn)(1); curryResult0 = _(testCurryRightFn).curryRight().value()(1, 2, 3); curryResult2 = _(testCurryRightFn).curryRight().value()(1); let curryResult7: _.CurriedFunction1; let curryResult8: _.CurriedFunction2; let curryResult9: _.CurriedFunction3; curryResult3 = _.curryRight(testCurry2)(true, 2, "1"); curryResult3 = _.curryRight(testCurry2)(true, 2)("1"); curryResult3 = _.curryRight(testCurry2)(true)(2, "1"); curryResult3 = _.curryRight(testCurry2)(true)(2)("1"); curryResult7 = _.curryRight(testCurry2)(true, 2); curryResult7 = _.curryRight(testCurry2)(true)(2); curryResult8 = _.curryRight(testCurry2)(true); curryResult9 = _.curryRight(testCurry2); // _.debounce namespace TestDebounce { interface SampleFunc { (n: number, s: string): boolean; } interface Options { leading?: boolean; maxWait?: number; trailing?: boolean; } interface ResultFunc { (n: number, s: string): boolean; cancel(): void; } let func: SampleFunc; let options: Options; { let result: ResultFunc; result = _.debounce(func); result = _.debounce(func, 42); result = _.debounce(func, 42, options); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).debounce(); result = _(func).debounce(42); result = _(func).debounce(42, options); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().debounce(); result = _(func).chain().debounce(42); result = _(func).chain().debounce(42, options); } } // _.defer namespace TestDefer { type SampleFunc = (a: number, b: string) => boolean; let func: SampleFunc; { let result: number; result = _.defer(func); result = _.defer(func, any); result = _.defer(func, any, any); result = _.defer(func, any, any, any); } { let result: _.LoDashImplicitWrapper; result = _(func).defer(); result = _(func).defer(any); result = _(func).defer(any, any); result = _(func).defer(any, any, any); } { let result: _.LoDashExplicitWrapper; result = _(func).chain().defer(); result = _(func).chain().defer(any); result = _(func).chain().defer(any, any); result = _(func).chain().defer(any, any, any); } } // _.delay namespace TestDelay { type SampleFunc = (a: number, b: string) => boolean; let func: SampleFunc; { let result: number; result = _.delay(func, 1); result = _.delay(func, 1, 2); result = _.delay(func, 1, 2, ''); } { let result: _.LoDashImplicitWrapper; result = _(func).delay(1); result = _(func).delay(1, 2); result = _(func).delay(1, 2, ''); } { let result: _.LoDashExplicitWrapper; result = _(func).chain().delay(1); result = _(func).chain().delay(1, 2); result = _(func).chain().delay(1, 2, ''); } } // _.flip namespace TestFlip { interface Func { (a: number, b: string): boolean; } let func: Func; { let result: Func; result = _.flip(func); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).flip(); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().flip(); } } // _.flow namespace TestFlow { let Fn1: (n: number) => number; let Fn2: (m: number, n: number) => number; { let result: (m: number, n: number) => number; result = _.flow<(m: number, n: number) => number>(Fn1, Fn2); result = _.flow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); result = _.flow<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2); } { let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>; result = _(Fn1).flow<(m: number, n: number) => number>(Fn2); result = _(Fn1).flow<(m: number, n: number) => number>(Fn1, Fn2); result = _(Fn1).flow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); } { let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>; result = _(Fn1).chain().flow<(m: number, n: number) => number>(Fn2); result = _(Fn1).chain().flow<(m: number, n: number) => number>(Fn1, Fn2); result = _(Fn1).chain().flow<(m: number, n: number) => number>(Fn1, Fn1, Fn2); } } // _.flowRight namespace TestFlowRight { let Fn1: (n: number) => number; let Fn2: (m: number, n: number) => number; { let result: (m: number, n: number) => number; result = _.flowRight<(m: number, n: number) => number>(Fn1, Fn2); result = _.flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn2); result = _.flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2); } { let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>; result = _(Fn1).flowRight<(m: number, n: number) => number>(Fn2); result = _(Fn1).flowRight<(m: number, n: number) => number>(Fn1, Fn2); result = _(Fn1).flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn2); } { let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>; result = _(Fn1).chain().flowRight<(m: number, n: number) => number>(Fn2); result = _(Fn1).chain().flowRight<(m: number, n: number) => number>(Fn1, Fn2); result = _(Fn1).chain().flowRight<(m: number, n: number) => number>(Fn1, Fn1, Fn2); } } // _.memoize namespace TestMemoize { { let memoizedFunction: _.MemoizedFunction; let cache: _.MapCache = memoizedFunction.cache; } interface MemoizedResultFn extends _.MemoizedFunction { (a1: string, a2: number): boolean; } let memoizeFn: (a1: string, a2: number) => boolean; let memoizeResolverFn: (a1: string, a2: number) => string; { let result: MemoizedResultFn; result = _.memoize(memoizeFn); result = _.memoize(memoizeFn, memoizeResolverFn); result('foo', 1); result.cache.get('foo1'); } { let result: _.LoDashImplicitObjectWrapper; result = _(memoizeFn).memoize(); result = _(memoizeFn).memoize(memoizeResolverFn); } { let result: _.LoDashExplicitObjectWrapper; result = _(memoizeFn).chain().memoize(); result = _(memoizeFn).chain().memoize(memoizeResolverFn); } _.memoize.Cache = { delete: key => false, get: key => undefined, has: key => false, set(key, value) { return this; } }; } // _.overArgs namespace TestOverArgs { type Func1 = (a: boolean) => boolean; type Func2 = (a: boolean, b: boolean) => boolean; let func1: Func1; let func2: Func2; let transform1: (a: string) => boolean; let transform2: (b: number) => boolean; { let result: (a: string) => boolean; result = _.overArgs boolean>(func1, transform1); result = _.overArgs boolean>(func1, [transform1]); } { let result: (a: string, b: number) => boolean; result = _.overArgs boolean>(func2, transform1, transform2); result = _.overArgs boolean>(func2, [transform1, transform2]); } { let result: _.LoDashImplicitObjectWrapper<(a: string) => boolean>; result = _(func1).overArgs<(a: string) => boolean>(transform1); result = _(func1).overArgs<(a: string) => boolean>([transform1]); } { let result: _.LoDashImplicitObjectWrapper<(a: string, b: number) => boolean>; result = _(func2).overArgs<(a: string, b: number) => boolean>(transform1, transform2); result = _(func2).overArgs<(a: string, b: number) => boolean>([transform1, transform2]); } { let result: _.LoDashExplicitObjectWrapper<(a: string) => boolean>; result = _(func1).chain().overArgs<(a: string) => boolean>(transform1); result = _(func1).chain().overArgs<(a: string) => boolean>([transform1]); } { let result: _.LoDashExplicitObjectWrapper<(a: string, b: number) => boolean>; result = _(func2).chain().overArgs<(a: string, b: number) => boolean>(transform1, transform2); result = _(func2).chain().overArgs<(a: string, b: number) => boolean>([transform1, transform2]); } } // _.negate namespace TestNegate { interface PredicateFn { (a1: number, a2: number): boolean; } interface ResultFn { (a1: number, a2: number): boolean; } var predicate = (a1: number, a2: number) => a1 > a2; { let result: ResultFn; result = _.negate(predicate); result = _.negate(predicate); } { let result: _.LoDashImplicitObjectWrapper; result = _(predicate).negate(); result = _(predicate).negate(); } { let result: _.LoDashExplicitObjectWrapper; result = _(predicate).chain().negate(); result = _(predicate).chain().negate(); } } // _.once namespace TestOnce { interface Func { (a: number, b: string): boolean; } let func: Func; { let result: Func; result = _.once(func); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).once(); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().once(); } } var greetPartial = function (greeting: string, name: string) { return greeting + ' ' + name; }; var hi = _.partial(greetPartial, 'hi'); hi('moe'); var defaultsDeep = _.partialRight(_.merge, _.defaults); var optionsPartialRight = { 'variable': 'data', 'imports': { 'jq': $ } }; defaultsDeep(optionsPartialRight, _.templateSettings); //_.rearg var testReargFn = (a: string, b: string, c: string) => [a, b, c]; interface TestReargResultFn { (b: string, c: string, a: string): string[]; } result = (_.rearg(testReargFn, 2, 0, 1))('b', 'c', 'a'); result = (_.rearg(testReargFn, [2, 0, 1]))('b', 'c', 'a'); result = (_(testReargFn).rearg(2, 0, 1).value())('b', 'c', 'a'); result = (_(testReargFn).rearg([2, 0, 1]).value())('b', 'c', 'a'); // _.rest namespace TestRest { type Func = (a: string, b: number[]) => boolean; type ResultFunc = (a: string, ...b: number[]) => boolean; let func: Func; { let result: ResultFunc; result = _.rest(func); result = _.rest(func, 1); result = _.rest(func); result = _.rest(func, 1); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).rest(); result = _(func).rest(1); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().rest(); result = _(func).chain().rest(1); } } //_.spread namespace TestSpread { type SampleFunc = (args: (number|string)[]) => boolean; type SampleResult = (a: number, b: string) => boolean; let func: SampleFunc; { let result: SampleResult; result = _.spread(func); result = _.spread(func); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).spread(); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().spread(); } } // _.throttle namespace TestThrottle { interface SampleFunc { (n: number, s: string): boolean; } interface Options { leading?: boolean; trailing?: boolean; } interface ResultFunc { (n: number, s: string): boolean; cancel(): void; } let func: SampleFunc; let options: Options; { let result: ResultFunc; result = _.throttle(func); result = _.throttle(func, 42); result = _.throttle(func, 42, options); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).throttle(); result = _(func).throttle(42); result = _(func).throttle(42, options); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().throttle(); result = _(func).chain().throttle(42); result = _(func).chain().throttle(42, options); } } // _.unary namespace TestUnary { interface Func { (a: number, b: string): boolean; } let func: Func; { let result: Func; result = _.unary(func); } { let result: _.LoDashImplicitObjectWrapper; result = _(func).unary(); } { let result: _.LoDashExplicitObjectWrapper; result = _(func).chain().unary(); } } // _.wrap namespace TestWrap { type SampleValue = {a: number; b: string; c: boolean} type SampleResult = (arg2: number, arg3: string) => boolean; { type SampleWrapper = (arg1: SampleValue, arg2: number, arg3: string) => boolean; let value: SampleValue; let wrapper: SampleWrapper; let result: SampleResult; result = _.wrap(value, wrapper); result = _.wrap(value, wrapper); result = _.wrap(value, wrapper); } { type SampleWrapper = (arg1: number, arg2: number, arg3: string) => boolean; let value: number; let wrapper: SampleWrapper; let result: _.LoDashImplicitObjectWrapper; result = _(value).wrap(wrapper); result = _(value).wrap(wrapper); } { type SampleWrapper = (arg1: number[], arg2: number, arg3: string) => boolean; let value: number[]; let wrapper: SampleWrapper; let result: _.LoDashImplicitObjectWrapper; result = _(value).wrap(wrapper); result = _(value).wrap(wrapper); } { type SampleWrapper = (arg1: SampleValue, arg2: number, arg3: string) => boolean; let value: SampleValue; let wrapper: SampleWrapper; let result: _.LoDashImplicitObjectWrapper; result = _(value).wrap(wrapper); result = _(value).wrap(wrapper); } { type SampleWrapper = (arg1: number, arg2: number, arg3: string) => boolean; let value: number; let wrapper: SampleWrapper; let result: _.LoDashExplicitObjectWrapper; result = _(value).chain().wrap(wrapper); result = _(value).chain().wrap(wrapper); } { type SampleWrapper = (arg1: number[], arg2: number, arg3: string) => boolean; let value: number[]; let wrapper: SampleWrapper; let result: _.LoDashExplicitObjectWrapper; result = _(value).chain().wrap(wrapper); result = _(value).chain().wrap(wrapper); } { type SampleWrapper = (arg1: SampleValue, arg2: number, arg3: string) => boolean; let value: SampleValue; let wrapper: SampleWrapper; let result: _.LoDashExplicitObjectWrapper; result = _(value).chain().wrap(wrapper); result = _(value).chain().wrap(wrapper); } } /******** * Lang * ********/ // _.castArray namespace TestCastArray { { let result: number[]; result = _.castArray(42); } { let result: _.LoDashImplicitArrayWrapper; result = _(42).castArray(); result = _([42]).castArray(); } { let result: _.LoDashImplicitArrayWrapper<{a: number}>; result = _({a: 42}).castArray(); } { let result: _.LoDashExplicitArrayWrapper; result = _(42).chain().castArray(); result = _([42]).chain().castArray(); } { let result: _.LoDashExplicitArrayWrapper<{a: number}>; result = _({a: 42}).chain().castArray(); } } // _.clone namespace TestClone { { let result: number; result = _.clone(42); result = _(42).clone(); } { let result: _.LoDashExplicitWrapper; result = _(42).chain().clone(); } { let result: string[]; result = _.clone(['']); result = _(['']).clone(); } { let result: _.LoDashExplicitArrayWrapper; result = _(['']).chain().clone(); } { let result: {a: {b: number;};}; result = _.clone<{a: {b: number;};}>({a: {b: 42}}); result = _({a: {b: 42}}).clone(); } { let result: _.LoDashExplicitObjectWrapper<{a: {b: number;};}>; result = _({a: {b: 42}}).chain().clone(); } } // _.cloneDeep namespace TestCloneDeep { { let result: number; result = _.cloneDeep(42); result = _(42).cloneDeep(); } { let result: _.LoDashExplicitWrapper; result = _(42).chain().cloneDeep(); } { let result: string[]; result = _.cloneDeep(['']); result = _(['']).cloneDeep(); } { let result: _.LoDashExplicitArrayWrapper; result = _(['']).chain().cloneDeep(); } { let result: {a: {b: number;};}; result = _.cloneDeep<{a: {b: number;};}>({a: {b: 42}}); result = _({a: {b: 42}}).cloneDeep(); } { let result: _.LoDashExplicitObjectWrapper<{a: {b: number;};}>; result = _({a: {b: 42}}).chain().cloneDeep(); } } // _.cloneDeepWith namespace TestCloneDeepWith { interface CloneDeepWithCustomizer { (value: V): R; } { let customizer: CloneDeepWithCustomizer; let reslut: string; result = _.cloneDeepWith(42, customizer); result = _.cloneDeepWith(42, customizer); result = _(42).cloneDeepWith(customizer); } { let customizer: CloneDeepWithCustomizer; let result: _.LoDashExplicitWrapper; result = _(42).chain().cloneDeepWith(customizer); } { let customizer: CloneDeepWithCustomizer; let reslut: string[]; result = _.cloneDeepWith([42], customizer); result = _.cloneDeepWith([42], customizer); result = _([42]).cloneDeepWith(customizer); } { let customizer: CloneDeepWithCustomizer; let result: _.LoDashExplicitArrayWrapper; result = _([42]).chain().cloneDeepWith(customizer); } { let customizer: CloneDeepWithCustomizer<{a: {b: number;};}, {a: {b: string;};}>; let reslut: {a: {b: string;};}; result = _.cloneDeepWith<{a: {b: string;};}>({a: {b: 42}}, customizer); result = _.cloneDeepWith<{a: {b: number;};}, {a: {b: string;};}>({a: {b: 42}}, customizer); result = _({a: {b: 42}}).cloneDeepWith<{a: {b: string;};}>(customizer); } { let customizer: CloneDeepWithCustomizer<{a: {b: number;};}, {a: {b: string;};}>; let result: _.LoDashExplicitObjectWrapper<{a: {b: string;};}>; result = _({a: {b: 42}}).chain().cloneDeepWith<{a: {b: string;};}>(customizer); } } // _.cloneWith namespace TestCloneWith { interface CloneWithCustomizer { (value: V): R; } { let customizer: CloneWithCustomizer; let reslut: string; result = _.cloneWith(42, customizer); result = _.cloneWith(42, customizer); result = _(42).cloneWith(customizer); } { let customizer: CloneWithCustomizer; let result: _.LoDashExplicitWrapper; result = _(42).chain().cloneWith(customizer); } { let customizer: CloneWithCustomizer; let reslut: string[]; result = _.cloneWith([42], customizer); result = _.cloneWith([42], customizer); result = _([42]).cloneWith(customizer); } { let customizer: CloneWithCustomizer; let result: _.LoDashExplicitArrayWrapper; result = _([42]).chain().cloneWith(customizer); } { let customizer: CloneWithCustomizer<{a: {b: number;};}, {a: {b: string;};}>; let reslut: {a: {b: string;};}; result = _.cloneWith<{a: {b: string;};}>({a: {b: 42}}, customizer); result = _.cloneWith<{a: {b: number;};}, {a: {b: string;};}>({a: {b: 42}}, customizer); result = _({a: {b: 42}}).cloneWith<{a: {b: string;};}>(customizer); } { let customizer: CloneWithCustomizer<{a: {b: number;};}, {a: {b: string;};}>; let result: _.LoDashExplicitObjectWrapper<{a: {b: string;};}>; result = _({a: {b: 42}}).chain().cloneWith<{a: {b: string;};}>(customizer); } } // _.eq namespace TestEq { let customizer: (value: any, other: any, indexOrKey?: number|string) => boolean; { let result: boolean; result = _.eq(any, any); result = _(any).eq(any); } { let result: _.LoDashExplicitWrapper; result = _(any).chain().eq(any); } } // _.gt namespace TestGt { { let result: boolean; result = _.gt(any, any); result = _(1).gt(any); result = _([]).gt(any); result = _({}).gt(any); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().gt(any); result = _([]).chain().gt(any); result = _({}).chain().gt(any); } } // _.gte namespace TestGte { { let result: boolean; result = _.gte(any, any); result = _(1).gte(any); result = _([]).gte(any); result = _({}).gte(any); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().gte(any); result = _([]).chain().gte(any); result = _({}).chain().gte(any); } } // _.isArguments namespace TestisArguments { { let value: number|IArguments; if (_.isArguments(value)) { let result: IArguments = value; } else { let result: number = value; } } { let result: boolean; result = _.isArguments(any); result = _(1).isArguments(); result = _([]).isArguments(); result = _({}).isArguments(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isArguments(); result = _([]).chain().isArguments(); result = _({}).chain().isArguments(); } } // _.isArray namespace TestIsArray { { let value: number|string[]|boolean[]; if (_.isArray(value)) { let result: string[] = value; } else { if (_.isArray(value)) { let result: boolean[] = value; } else { let result: number = value; } } } { let result: boolean; result = _.isArray(any); result = _(1).isArray(); result = _([]).isArray(); result = _({}).isArray(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isArray(); result = _([]).chain().isArray(); result = _({}).chain().isArray(); } } // _.isArrayBuffer namespace TestIsArrayBuffer { { let value: ArrayBuffer|number; if (_.isArrayBuffer(value)) { let result: ArrayBuffer = value; } else { let result: number = value; } } { let result: boolean; result = _.isArrayBuffer(any); result = _(1).isArrayBuffer(); result = _([]).isArrayBuffer(); result = _({}).isArrayBuffer(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isArrayBuffer(); result = _([]).chain().isArrayBuffer(); result = _({}).chain().isArrayBuffer(); } } // _.isArrayLike namespace TestIsArrayLike { { let value: number|string[]|boolean[]; if (_.isArrayLike(value)) { let result: string[] = value; } else { if (_.isArrayLike(value)) { let result: boolean[] = value; } else { let result: number = value; } } } { let result: boolean; result = _.isArrayLike(any); result = _(1).isArrayLike(); result = _([]).isArrayLike(); result = _({}).isArrayLike(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isArrayLike(); result = _([]).chain().isArrayLike(); result = _({}).chain().isArrayLike(); } } // _.isArrayLikeObject namespace TestIsArrayLikeObject { { let value: number|string[]|boolean[]; if (_.isArrayLikeObject(value)) { let result: string[] = value; } else { if (_.isArrayLikeObject(value)) { let result: boolean[] = value; } else { let result: number = value; } } } { let result: boolean; result = _.isArrayLikeObject(any); result = _(1).isArrayLikeObject(); result = _([]).isArrayLikeObject(); result = _({}).isArrayLikeObject(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isArrayLikeObject(); result = _([]).chain().isArrayLikeObject(); result = _({}).chain().isArrayLikeObject(); } } // _.isBoolean namespace TestIsBoolean { { let value: number|boolean; if (_.isBoolean(value)) { let result: boolean = value; } else { let result: number = value; } } { let result: boolean; result = _.isBoolean(any); result = _(1).isBoolean(); result = _([]).isBoolean(); result = _({}).isBoolean(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isBoolean(); result = _([]).chain().isBoolean(); result = _({}).chain().isBoolean(); } } // _.isBuffer namespace TestIsBuffer { { let result: boolean; result = _.isBuffer(any); result = _(1).isBuffer(); result = _([]).isBuffer(); result = _({}).isBuffer(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isBuffer(); result = _([]).chain().isBuffer(); result = _({}).chain().isBuffer(); } } // _.isDate namespace TestIsBoolean { { let value: number|Date; if (_.isDate(value)) { let result: Date = value; } else { let result: number = value; } } { let result: boolean; result = _.isDate(any); result = _(42).isDate(); result = _([]).isDate(); result = _({}).isDate(); } { let result: _.LoDashExplicitWrapper; result = _(42).chain().isDate(); result = _([]).chain().isDate(); result = _({}).chain().isDate(); } } // _.isElement namespace TestIsElement { { let result: boolean; result = _.isElement(any); result = _(42).isElement(); result = _([]).isElement(); result = _({}).isElement(); } { let result: _.LoDashExplicitWrapper; result = _(42).chain().isElement(); result = _([]).chain().isElement(); result = _({}).chain().isElement(); } } // _.isEmpty namespace TestIsEmpty { { let result: boolean; result = _.isEmpty(any); result = _(1).isEmpty(); result = _('').isEmpty(); result = _([]).isEmpty(); result = _({}).isEmpty(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isEmpty(); result = _('').chain().isEmpty(); result = _([]).chain().isEmpty(); result = _({}).chain().isEmpty(); } } // _.isEqual namespace TestIsEqual { let customizer: (value: any, other: any, indexOrKey?: number|string) => boolean; { let result: boolean; result = _.isEqual(any, any); result = _(any).isEqual(any); } { let result: _.LoDashExplicitWrapper; result = _(any).chain().isEqual(any); } } // _.isEqualWith namespace TestIsEqualWith { let customizer: (value: any, other: any, indexOrKey?: number|string) => boolean; { let result: boolean; result = _.isEqualWith(any, any, customizer); result = _(any).isEqualWith(any, customizer); } { let result: _.LoDashExplicitWrapper; result = _(any).chain().isEqualWith(any, customizer); } } // _.isError namespace TestIsError { { let value: number|Error; if (_.isError(value)) { let result: Error = value; } else { let result: number = value; } } { class CustomError extends Error {} let value: number|CustomError; if (_.isError(value)) { let result: CustomError = value; } else { let result: number = value; } } { let result: boolean; result = _.isError(any); result = _(1).isError(); result = _([]).isError(); result = _({}).isError(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isError(); result = _([]).chain().isError(); result = _({}).chain().isError(); } } // _.isFinite namespace TestIsFinite { { let result: boolean; result = _.isFinite(any); result = _(1).isFinite(); result = _([]).isFinite(); result = _({}).isFinite(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isFinite(); result = _([]).chain().isFinite(); result = _({}).chain().isFinite(); } } // _.isFunction namespace TestIsFunction { { let value: number|Function; if (_.isFunction(value)) { let result: Function = value; } else { let result: number = value; } } { let result: boolean; result = _.isFunction(any); result = _(1).isFunction(); result = _([]).isFunction(); result = _({}).isFunction(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isFunction(); result = _([]).chain().isFunction(); result = _({}).chain().isFunction(); } } // _.isInteger namespace TestIsInteger { { let result: boolean; result = _.isInteger(any); result = _(1).isInteger(); result = _([]).isInteger(); result = _({}).isInteger(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isInteger(); result = _([]).chain().isInteger(); result = _({}).chain().isInteger(); } } // _.isLength namespace TestIsLength { { let result: boolean; result = _.isLength(any); result = _(1).isLength(); result = _([]).isLength(); result = _({}).isLength(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isLength(); result = _([]).chain().isLength(); result = _({}).chain().isLength(); } } // _.isMap namespace TestIsMap { { let value: number|Map; if (_.isMap(value)) { let result: Map = value; } else { let result: number = value; } } { let result: boolean; result = _.isMap(any); result = _(1).isMap(); result = _([]).isMap(); result = _({}).isMap(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isMap(); result = _([]).chain().isMap(); result = _({}).chain().isMap(); } } // _.isMatch namespace TestIsMatch { let testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean; let result: boolean; result = _.isMatch({}, {}); result = _({}).isMatch({}); } // _.isMatchWith namespace TestIsMatchWith { let testIsMatchCustiomizerFn: (value: any, other: any, indexOrKey: number|string) => boolean; let result: boolean; result = _.isMatchWith({}, {}, testIsMatchCustiomizerFn); result = _({}).isMatchWith({}, testIsMatchCustiomizerFn); } // _.isNaN namespace TestIsNaN { { let result: boolean; result = _.isNaN(any); result = _(1).isNaN(); result = _([]).isNaN(); result = _({}).isNaN(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isNaN(); result = _([]).chain().isNaN(); result = _({}).chain().isNaN(); } } // _.isNative namespace TestIsNative { { let value: number|Function; if (_.isNative(value)) { let result: Function = value; } else { let result: number = value; } } { let result: boolean; result = _.isNative(any); result = _(1).isNative(); result = _([]).isNative(); result = _({}).isNative(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isNative(); result = _([]).chain().isNative(); result = _({}).chain().isNative(); } } // _.isNil namespace TestIsNil { { let result: boolean; result = _.isNil(any); result = _(1).isNil(); result = _([]).isNil(); result = _({}).isNil(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isNil(); result = _([]).chain().isNil(); result = _({}).chain().isNil(); } } // _.isNull namespace TestIsNull { { let result: boolean; result = _.isNull(any); result = _(1).isNull(); result = _([]).isNull(); result = _({}).isNull(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isNull(); result = _([]).chain().isNull(); result = _({}).chain().isNull(); } } // _.isNumber namespace TestIsNumber { { let value: string|number; if (_.isNumber(value)) { let result: number = value; } else { let result: string = value; } } { let result: boolean; result = _.isNumber(any); result = _(1).isNumber(); result = _([]).isNumber(); result = _({}).isNumber(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isNumber(); result = _([]).chain().isNumber(); result = _({}).chain().isNumber(); } } // _.isObject namespace TestIsObject { { let result: boolean; result = _.isObject(any); result = _(1).isObject(); result = _([]).isObject(); result = _({}).isObject(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isObject(); result = _([]).chain().isObject(); result = _({}).chain().isObject(); } } // _.isObjectLike namespace TestIsObjectLike { { let result: boolean; result = _.isObjectLike(any); result = _(1).isObjectLike(); result = _([]).isObjectLike(); result = _({}).isObjectLike(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isObjectLike(); result = _([]).chain().isObjectLike(); result = _({}).chain().isObjectLike(); } } // _.isPlainObject namespace TestIsPlainObject { { let result: boolean; result = _.isPlainObject(any); result = _(1).isPlainObject(); result = _([]).isPlainObject(); result = _({}).isPlainObject(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isPlainObject(); result = _([]).chain().isPlainObject(); result = _({}).chain().isPlainObject(); } } // _.isRegExp namespace TestIsRegExp { { let value: number|RegExp; if (_.isRegExp(value)) { let result: RegExp = value; } else { let result: number = value; } } { let result: boolean; result = _.isRegExp(any); result = _(1).isRegExp(); result = _([]).isRegExp(); result = _({}).isRegExp(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isRegExp(); result = _([]).chain().isRegExp(); result = _({}).chain().isRegExp(); } } // _.isSafeInteger namespace TestIsSafeInteger { { let result: boolean; result = _.isSafeInteger(any); result = _(1).isSafeInteger(); result = _([]).isSafeInteger(); result = _({}).isSafeInteger(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isSafeInteger(); result = _([]).chain().isSafeInteger(); result = _({}).chain().isSafeInteger(); } } // _.isSet namespace TestIsSet { { let value: number|Set; if (_.isSet(value)) { let result: Set = value; } else { let result: number = value; } } { let result: boolean; result = _.isSet(any); result = _(1).isSet(); result = _([]).isSet(); result = _({}).isSet(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isSet(); result = _([]).chain().isSet(); result = _({}).chain().isSet(); } } // _.isString namespace TestIsString { { let value: number|string; if (_.isString(value)) { let result: string = value; } else { let result: number = value; } } { let result: boolean; result = _.isString(any); result = _(1).isString(); result = _([]).isString(); result = _({}).isString(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isString(); result = _([]).chain().isString(); result = _({}).chain().isString(); } } // _.isSymbol namespace TestIsSymbol { { let result: boolean; result = _.isSymbol(any); result = _(1).isSymbol(); result = _([]).isSymbol(); result = _({}).isSymbol(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isSymbol(); result = _([]).chain().isSymbol(); result = _({}).chain().isSymbol(); } } // _.isTypedArray namespace TestIsTypedArray { { let result: boolean; result = _.isTypedArray([]); result = _([]).isTypedArray(); } { let result: _.LoDashExplicitWrapper; result = _([]).chain().isTypedArray(); } } // _.isUndefined namespace TestIsUndefined { { let result: boolean; result = _.isUndefined(any); result = _(1).isUndefined(); result = _([]).isUndefined(); result = _({}).isUndefined(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isUndefined(); result = _([]).chain().isUndefined(); result = _({}).chain().isUndefined(); } } // _.isWeakMap namespace TestIsWeakMap { { let value: number|WeakMap; if (_.isWeakMap(value)) { let result: WeakMap = value; } else { let result: number = value; } } { let result: boolean; result = _.isWeakMap(any); result = _(1).isWeakMap(); result = _([]).isWeakMap(); result = _({}).isWeakMap(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isWeakMap(); result = _([]).chain().isWeakMap(); result = _({}).chain().isWeakMap(); } } // _.isWeakSet module TestIsWeakSet { { let value: number|WeakSet; if (_.isWeakSet(value)) { let result: WeakSet = value; } else { let result: number = value; } } { let result: boolean; result = _.isWeakSet(any); result = _(1).isWeakSet(); result = _([]).isWeakSet(); result = _({}).isWeakSet(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().isWeakSet(); result = _([]).chain().isWeakSet(); result = _({}).chain().isWeakSet(); } } // _.lt namespace TestLt { { let result: boolean; result = _.lt(any, any); result = _(1).lt(any); result = _([]).lt(any); result = _({}).lt(any); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().lt(any); result = _([]).chain().lt(any); result = _({}).chain().lt(any); } } // _.lte namespace TestLte { { let result: boolean; result = _.lte(any, any); result = _(1).lte(any); result = _([]).lte(any); result = _({}).lte(any); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().lte(any); result = _([]).chain().lte(any); result = _({}).chain().lte(any); } } // _.toArray namespace TestToArray { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let numericDictionary: _.NumericDictionary; { let result: string[]; result = _.toArray(''); result = _.toArray(''); } { let result: TResult[]; result = _.toArray(array); result = _.toArray(list); result = _.toArray(dictionary); result = _.toArray(numericDictionary); result = _.toArray(array); result = _.toArray(list); result = _.toArray(dictionary); result = _.toArray(numericDictionary); } { let result: any[]; result = _.toArray(); result = _.toArray(42); result = _.toArray(true); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).toArray(); result = _(list).toArray(); result = _(dictionary).toArray(); result = _(numericDictionary).toArray(); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().toArray(); result = _(list).chain().toArray(); result = _(dictionary).chain().toArray(); result = _(numericDictionary).chain().toArray(); } } // _.toPlainObject namespace TestToPlainObject { { let result: TResult; result = _.toPlainObject(); result = _.toPlainObject(true); result = _.toPlainObject(1); result = _.toPlainObject('a'); result = _.toPlainObject([]); result = _.toPlainObject({}); } { let result: _.LoDashImplicitObjectWrapper; result = _(true).toPlainObject(); result = _(1).toPlainObject(); result = _('a').toPlainObject(); result = _([1]).toPlainObject(); result = _([]).toPlainObject(); result = _({}).toPlainObject(); } } // _.toInteger namespace TestToInteger { { let result: number; result = _.toInteger(true); result = _.toInteger(1); result = _.toInteger('a'); result = _.toInteger([]); result = _.toInteger({}); } { let result: _.LoDashImplicitWrapper; result = _(true).toInteger(); result = _(1).toInteger(); result = _('a').toInteger(); result = _([1]).toInteger(); result = _([]).toInteger(); result = _({}).toInteger(); } } // _.toLength namespace TestToLength { { let result: number; result = _.toLength(true); result = _.toLength(1); result = _.toLength('a'); result = _.toLength([]); result = _.toLength({}); } { let result: _.LoDashImplicitWrapper; result = _(true).toLength(); result = _(1).toLength(); result = _('a').toLength(); result = _([1]).toLength(); result = _([]).toLength(); result = _({}).toLength(); } } // _.toNumber namespace TestToNumber { { let result: number; result = _.toNumber(true); result = _.toNumber(1); result = _.toNumber('a'); result = _.toNumber([]); result = _.toNumber({}); } { let result: _.LoDashImplicitWrapper; result = _(true).toNumber(); result = _(1).toNumber(); result = _('a').toNumber(); result = _([1]).toNumber(); result = _([]).toNumber(); result = _({}).toNumber(); } } // _.toSafeInteger namespace TestToSafeInteger { { let result: number; result = _.toSafeInteger(true); result = _.toSafeInteger(1); result = _.toSafeInteger('a'); result = _.toSafeInteger([]); result = _.toSafeInteger({}); } { let result: _.LoDashImplicitWrapper; result = _(true).toSafeInteger(); result = _(1).toSafeInteger(); result = _('a').toSafeInteger(); result = _([1]).toSafeInteger(); result = _([]).toSafeInteger(); result = _({}).toSafeInteger(); } } /******** * Math * ********/ // _.add namespace TestAdd { { let result: number; result = _.add(1, 1); result = _(1).add(1); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().add(1); } } // _.ceil namespace TestCeil { { let result: number; result = _.ceil(6.004); result = _.ceil(6.004, 2); result = _(6.004).ceil(); result = _(6.004).ceil(2); } { let result: _.LoDashExplicitWrapper; result = _(6.004).chain().ceil(); result = _(6.004).chain().ceil(2); } } // _.floor namespace TestFloor { { let result: number; result = _.floor(4.006); result = _.floor(0.046, 2); result = _.floor(4060, -2); result = _(4.006).floor(); result = _(0.046).floor(2); result = _(4060).floor(-2); } { let result: _.LoDashExplicitWrapper; result = _(4.006).chain().floor(); result = _(0.046).chain().floor(2); result = _(4060).chain().floor(-2); } } // _.max namespace TestMax { let array: number[]; let list: _.List; let result: number; result = _.max(array); result = _.max(list); result = _(array).max(); result = _(list).max(); } // _.maxBy namespace TestMaxBy { let array: number[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: number, index: number, collection: _.List) => number; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number; let result: number; result = _.maxBy(array); result = _.maxBy(array, listIterator); result = _.maxBy(array, ''); result = _.maxBy<{a: number}, number>(array, {a: 42}); result = _.maxBy(list); result = _.maxBy(list, listIterator); result = _.maxBy(list, ''); result = _.maxBy<{a: number}, number>(list, {a: 42}); result = _.maxBy(dictionary); result = _.maxBy(dictionary, dictionaryIterator); result = _.maxBy(dictionary, ''); result = _.maxBy<{a: number}, number>(dictionary, {a: 42}); result = _(array).maxBy(); result = _(array).maxBy(listIterator); result = _(array).maxBy(''); result = _(array).maxBy<{a: number}>({a: 42}); result = _(list).maxBy(); result = _(list).maxBy(listIterator); result = _(list).maxBy(''); result = _(list).maxBy<{a: number}, number>({a: 42}); result = _(dictionary).maxBy(); result = _(dictionary).maxBy(dictionaryIterator); result = _(dictionary).maxBy(''); result = _(dictionary).maxBy<{a: number}, number>({a: 42}); } // _.mean namespace TestMean { let array: number[]; let result: number; result = _.mean(array); result = _(array).mean(); } // _.min namespace TestMin { let array: number[]; let list: _.List; let result: number; result = _.min(array); result = _.min(list); result = _(array).min(); result = _(list).min(); } // _.minBy namespace TestMinBy { let array: number[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: number, index: number, collection: _.List) => number; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number; let result: number; result = _.minBy(array); result = _.minBy(array, listIterator); result = _.minBy(array, ''); result = _.minBy<{a: number}, number>(array, {a: 42}); result = _.minBy(list); result = _.minBy(list, listIterator); result = _.minBy(list, ''); result = _.minBy<{a: number}, number>(list, {a: 42}); result = _.minBy(dictionary); result = _.minBy(dictionary, dictionaryIterator); result = _.minBy(dictionary, ''); result = _.minBy<{a: number}, number>(dictionary, {a: 42}); result = _(array).minBy(); result = _(array).minBy(listIterator); result = _(array).minBy(''); result = _(array).minBy<{a: number}>({a: 42}); result = _(list).minBy(); result = _(list).minBy(listIterator); result = _(list).minBy(''); result = _(list).minBy<{a: number}, number>({a: 42}); result = _(dictionary).minBy(); result = _(dictionary).minBy(dictionaryIterator); result = _(dictionary).minBy(''); result = _(dictionary).minBy<{a: number}, number>({a: 42}); } // _.round namespace TestRound { { let result: number; result = _.round(4.006); result = _.round(4.006, 2); result = _(4.006).round(); result = _(4.006).round(2); } { let result: _.LoDashExplicitWrapper; result = _(4.006).chain().round(); result = _(4.006).chain().round(2); } } // _.sum namespace TestSum { let array: number[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: number, index: number, collection: _.List) => number; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number; { let result: number; result = _.sum(array); result = _.sum(array); result = _.sum(list); result = _.sum(list); result = _(array).sum(); result = _(list).sum(); result = _(dictionary).sum(); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().sum(); result = _(list).chain().sum(); result = _(dictionary).chain().sum(); } } // _.sumBy namespace TestSumBy { let array: number[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: number, index: number, collection: _.List) => number; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => number; { let result: number; result = _.sumBy(array); result = _.sumBy(array, listIterator); result = _.sumBy(array, ''); result = _.sumBy(list); result = _.sumBy(list, listIterator); result = _.sumBy(list, ''); result = _.sumBy(dictionary); result = _.sumBy(dictionary, dictionaryIterator); result = _.sumBy(dictionary, ''); result = _(array).sumBy(listIterator); result = _(array).sumBy(''); result = _(list).sumBy(listIterator); result = _(list).sumBy(''); result = _(dictionary).sumBy(dictionaryIterator); result = _(dictionary).sumBy(''); } { let result: _.LoDashExplicitWrapper; result = _(array).chain().sumBy(listIterator); result = _(array).chain().sumBy(''); result = _(list).chain().sumBy(listIterator); result = _(list).chain().sumBy(''); result = _(dictionary).chain().sumBy(dictionaryIterator); result = _(dictionary).chain().sumBy(''); } } /********** * Number * **********/ // _.subtract namespace subtract { { let result: number; result = _.subtract(3, 2); result = _(3).subtract(2); } { let result: _.LoDashExplicitWrapper; result = _(3).chain().subtract(2); } } // _.clamp namespace TestInClamp { { let result: number; result = _.clamp(3, 2, 4); result = _(3).clamp(2, 4); } { let result: _.LoDashExplicitWrapper; result = _(3).chain().clamp(2, 4); } } // _.inRange namespace TestInRange { { let result: boolean; result = _.inRange(3, 2, 4); result = _.inRange(4, 8); result = _(3).inRange(2, 4); result = _(4).inRange(8); } { let result: _.LoDashExplicitWrapper; result = _(3).chain().inRange(2, 4); result = _(4).chain().inRange(8); } } // _.random namespace TestRandom { { let result: number; result = _.random(); result = _.random(1); result = _.random(1, 2); result = _.random(1, 2, true); result = _.random(1, true); result = _.random(true); result = _(1).random(); result = _(1).random(2); result = _(1).random(2, true); result = _(1).random(true); result = _(true).random(); } { let result: _.LoDashExplicitWrapper; result = _(1).chain().random(); result = _(1).chain().random(2); result = _(1).chain().random(2, true); result = _(1).chain().random(true); result = _(true).chain().random(); } } /********** * Object * **********/ // _.assign namespace TestAssign { interface Obj {a: string}; interface S1 {a: number}; interface S2 {b: number}; interface S3 {c: number}; interface S4 {d: number}; interface S5 {e: number}; let obj: Obj; let s1: S1; let s2: S2; let s3: S3; let s4: S4; let s5: S5; let customizer: (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; { let result: Obj; result = _.assign(obj); } { let result: {a: number}; result = _.assign(obj, s1); } { let result: {a: number, b: number}; result = _.assign(obj, s1, s2); } { let result: {a: number, b: number, c: number}; result = _.assign(obj, s1, s2, s3); } { let result: {a: number, b: number, c: number, d: number}; result = _.assign(obj, s1, s2, s3, s4); } { let result: {a: number, b: number, c: number, d: number, e: number}; result = _.assign(obj, s1, s2, s3, s4, s5); } { let result: _.LoDashImplicitObjectWrapper; result = _(obj).assign(); } { let result: _.LoDashImplicitObjectWrapper<{a: number}>; result = _(obj).assign(s1); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; result = _(obj).assign(s1, s2); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).assign(s1, s2, s3); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).assign(s1, s2, s3, s4); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); } { let result: _.LoDashExplicitObjectWrapper; result = _(obj).chain().assign(); } { let result: _.LoDashExplicitObjectWrapper<{a: number}>; result = _(obj).chain().assign(s1); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; result = _(obj).chain().assign(s1, s2); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).chain().assign(s1, s2, s3); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).chain().assign(s1, s2, s3, s4); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).chain().assign<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); } } // _.assignWith namespace TestAssignWith { interface Obj {a: string}; interface S1 {a: number}; interface S2 {b: number}; interface S3 {c: number}; interface S4 {d: number}; interface S5 {e: number}; let obj: Obj; let s1: S1; let s2: S2; let s3: S3; let s4: S4; let s5: S5; let customizer: (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; { let result: Obj; result = _.assignWith(obj); } { let result: {a: number}; result = _.assignWith(obj, s1, customizer); } { let result: {a: number, b: number}; result = _.assignWith(obj, s1, s2, customizer); } { let result: {a: number, b: number, c: number}; result = _.assignWith(obj, s1, s2, s3, customizer); } { let result: {a: number, b: number, c: number, d: number}; result = _.assignWith(obj, s1, s2, s3, s4, customizer); } { let result: {a: number, b: number, c: number, d: number, e: number}; result = _.assignWith(obj, s1, s2, s3, s4, s5, customizer); } { let result: _.LoDashImplicitObjectWrapper; result = _(obj).assignWith(); } { let result: _.LoDashImplicitObjectWrapper<{a: number}>; result = _(obj).assignWith(s1, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; result = _(obj).assignWith(s1, s2, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).assignWith(s1, s2, s3, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).assignWith(s1, s2, s3, s4, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).assignWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); } { let result: _.LoDashExplicitObjectWrapper; result = _(obj).chain().assignWith(); } { let result: _.LoDashExplicitObjectWrapper<{a: number}>; result = _(obj).chain().assignWith(s1, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; result = _(obj).chain().assignWith(s1, s2, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).chain().assignWith(s1, s2, s3, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).chain().assignWith(s1, s2, s3, s4, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).chain().assignWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); } } // _.assignIn namespace TestAssignIn { interface Obj {a: string}; interface S1 {a: number}; interface S2 {b: number}; interface S3 {c: number}; interface S4 {d: number}; interface S5 {e: number}; let obj: Obj; let s1: S1; let s2: S2; let s3: S3; let s4: S4; let s5: S5; let customizer: (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; { let result: Obj; result = _.assignIn(obj); } { let result: {a: number}; result = _.assignIn(obj, s1); } { let result: {a: number, b: number}; result = _.assignIn(obj, s1, s2); } { let result: {a: number, b: number, c: number}; result = _.assignIn(obj, s1, s2, s3); } { let result: {a: number, b: number, c: number, d: number}; result = _.assignIn(obj, s1, s2, s3, s4); } { let result: {a: number, b: number, c: number, d: number, e: number}; result = _.assignIn(obj, s1, s2, s3, s4, s5); } { let result: _.LoDashImplicitObjectWrapper; result = _(obj).assignIn(); } { let result: _.LoDashImplicitObjectWrapper<{a: number}>; result = _(obj).assignIn(s1); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; result = _(obj).assignIn(s1, s2); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).assignIn(s1, s2, s3); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).assignIn(s1, s2, s3, s4); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).assignIn<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); } { let result: _.LoDashExplicitObjectWrapper; result = _(obj).chain().assignIn(); } { let result: _.LoDashExplicitObjectWrapper<{a: number}>; result = _(obj).chain().assignIn(s1); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; result = _(obj).chain().assignIn(s1, s2); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).chain().assignIn(s1, s2, s3); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).chain().assignIn(s1, s2, s3, s4); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).chain().assignIn<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); } } // _.assignInWith namespace TestAssignInWith { interface Obj {a: string}; interface S1 {a: number}; interface S2 {b: number}; interface S3 {c: number}; interface S4 {d: number}; interface S5 {e: number}; let obj: Obj; let s1: S1; let s2: S2; let s3: S3; let s4: S4; let s5: S5; let customizer: (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; { let result: Obj; result = _.assignInWith(obj); } { let result: {a: number}; result = _.assignInWith(obj, s1, customizer); } { let result: {a: number, b: number}; result = _.assignInWith(obj, s1, s2, customizer); } { let result: {a: number, b: number, c: number}; result = _.assignInWith(obj, s1, s2, s3, customizer); } { let result: {a: number, b: number, c: number, d: number}; result = _.assignInWith(obj, s1, s2, s3, s4, customizer); } { let result: {a: number, b: number, c: number, d: number, e: number}; result = _.assignInWith(obj, s1, s2, s3, s4, s5, customizer); } { let result: _.LoDashImplicitObjectWrapper; result = _(obj).assignInWith(); } { let result: _.LoDashImplicitObjectWrapper<{a: number}>; result = _(obj).assignInWith(s1, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; result = _(obj).assignInWith(s1, s2, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).assignInWith(s1, s2, s3, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).assignInWith(s1, s2, s3, s4, customizer); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).assignInWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); } { let result: _.LoDashExplicitObjectWrapper; result = _(obj).chain().assignInWith(); } { let result: _.LoDashExplicitObjectWrapper<{a: number}>; result = _(obj).chain().assignInWith(s1, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; result = _(obj).chain().assignInWith(s1, s2, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).chain().assignInWith(s1, s2, s3, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).chain().assignInWith(s1, s2, s3, s4, customizer); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).chain().assignInWith<{a: number, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5, customizer); } } // _.create namespace TestCreate { type SampleProto = {a: number}; type SampleProps = {b: string}; let prototype: SampleProto; let properties: SampleProps; { let result: {a: number; b: string}; result = _.create(prototype, properties); result = _.create(prototype, properties); } { let result: _.LoDashImplicitObjectWrapper<{a: number; b: string}>; result = _(prototype).create(properties); result = _(prototype).create(properties); } { let result: _.LoDashExplicitObjectWrapper<{a: number; b: string}>; result = _(prototype).chain().create(properties); result = _(prototype).chain().create(properties); } } // _.defaults namespace TestDefaults { interface Obj {a: string}; interface S1 {a: number}; interface S2 {b: number}; interface S3 {c: number}; interface S4 {d: number}; interface S5 {e: number}; let obj: Obj; let s1: S1; let s2: S2; let s3: S3; let s4: S4; let s5: S5; { let result: Obj; result = _.defaults(obj); } { let result: {a: string}; result = _.defaults(obj, s1); } { let result: {a: string, b: number}; result = _.defaults(obj, s1, s2); } { let result: {a: string, b: number, c: number}; result = _.defaults(obj, s1, s2, s3); } { let result: {a: string, b: number, c: number, d: number}; result = _.defaults(obj, s1, s2, s3, s4); } { let result: {a: string, b: number, c: number, d: number, e: number}; result = _.defaults(obj, s1, s2, s3, s4, s5); } { let result: _.LoDashImplicitObjectWrapper; result = _(obj).defaults(); } { let result: _.LoDashImplicitObjectWrapper<{a: string}>; result = _(obj).defaults(s1); } { let result: _.LoDashImplicitObjectWrapper<{a: string, b: number}>; result = _(obj).defaults(s1, s2); } { let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number}>; result = _(obj).defaults(s1, s2, s3); } { let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; result = _(obj).defaults(s1, s2, s3, s4); } { let result: _.LoDashImplicitObjectWrapper<{a: string, b: number, c: number, d: number, e: number}>; result = _(obj).defaults<{a: string, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); } { let result: _.LoDashExplicitObjectWrapper; result = _(obj).chain().defaults(); } { let result: _.LoDashExplicitObjectWrapper<{a: string}>; result = _(obj).chain().defaults(s1); } { let result: _.LoDashExplicitObjectWrapper<{a: string, b: number}>; result = _(obj).chain().defaults(s1, s2); } { let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number}>; result = _(obj).chain().defaults(s1, s2, s3); } { let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number, d: number}>; result = _(obj).chain().defaults(s1, s2, s3, s4); } { let result: _.LoDashExplicitObjectWrapper<{a: string, b: number, c: number, d: number, e: number}>; result = _(obj).chain().defaults<{a: string, b: number, c: number, d: number, e: number}>(s1, s2, s3, s4, s5); } } //_.defaultsDeep interface DefaultsDeepResult { user: { name: string; age: number; } } var TestDefaultsDeepObject = {'user': {'name': 'barney'}}; var TestDefaultsDeepSource = {'user': {'name': 'fred', 'age': 36}}; result = _.defaultsDeep(TestDefaultsDeepObject, TestDefaultsDeepSource); result = _(TestDefaultsDeepObject).defaultsDeep(TestDefaultsDeepSource).value(); // _.extend namespace TestExtend { type Obj = {a: string}; type S1 = {a: number}; type S2 = {b: number}; type S3 = {c: number}; type S4 = {d: number}; type S5 = {e: number}; let obj: Obj; let s1: S1; let s2: S2; let s3: S3; let s4: S4; let s5: S5; let customizer: (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; { let result: Obj; result = _.extend(obj); } { let result: {a: number}; result = _.extend(obj, s1); result = _.extend(obj, s1, customizer); result = _.extend(obj, s1, customizer, any); } { let result: {a: number, b: number}; result = _.extend(obj, s1, s2); result = _.extend(obj, s1, s2, customizer); result = _.extend(obj, s1, s2, customizer, any); } { let result: {a: number, b: number, c: number}; result = _.extend(obj, s1, s2, s3); result = _.extend(obj, s1, s2, s3, customizer); result = _.extend(obj, s1, s2, s3, customizer, any); } { let result: {a: number, b: number, c: number, d: number}; result = _.extend(obj, s1, s2, s3, s4); result = _.extend(obj, s1, s2, s3, s4, customizer); result = _.extend(obj, s1, s2, s3, s4, customizer, any); } { let result: {a: number, b: number, c: number, d: number, e: number}; result = _.extend(obj, s1, s2, s3, s4, s5); result = _.extend(obj, s1, s2, s3, s4, s5, customizer); result = _.extend(obj, s1, s2, s3, s4, s5, customizer, any); } { let result: _.LoDashImplicitObjectWrapper; result = _(obj).extend(); } { let result: _.LoDashImplicitObjectWrapper<{a: number}>; result = _(obj).extend(s1); result = _(obj).extend(s1, customizer); result = _(obj).extend(s1, customizer, any); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number}>; result = _(obj).extend(s1, s2); result = _(obj).extend(s1, s2, customizer); result = _(obj).extend(s1, s2, customizer, any); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).extend(s1, s2, s3); result = _(obj).extend(s1, s2, s3, customizer); result = _(obj).extend(s1, s2, s3, customizer, any); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).extend(s1, s2, s3, s4); result = _(obj).extend(s1, s2, s3, s4, customizer); result = _(obj).extend(s1, s2, s3, s4, customizer, any); } { let result: _.LoDashImplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).extend(s1, s2, s3, s4, s5); result = _(obj).extend(s1, s2, s3, s4, s5, customizer); result = _(obj).extend(s1, s2, s3, s4, s5, customizer, any); } { let result: _.LoDashExplicitObjectWrapper; result = _(obj).chain().extend(); } { let result: _.LoDashExplicitObjectWrapper<{a: number}>; result = _(obj).chain().extend(s1); result = _(obj).chain().extend(s1, customizer); result = _(obj).chain().extend(s1, customizer, any); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number}>; result = _(obj).chain().extend(s1, s2); result = _(obj).chain().extend(s1, s2, customizer); result = _(obj).chain().extend(s1, s2, customizer, any); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number}>; result = _(obj).chain().extend(s1, s2, s3); result = _(obj).chain().extend(s1, s2, s3, customizer); result = _(obj).chain().extend(s1, s2, s3, customizer, any); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number}>; result = _(obj).chain().extend(s1, s2, s3, s4); result = _(obj).chain().extend(s1, s2, s3, s4, customizer); result = _(obj).chain().extend(s1, s2, s3, s4, customizer, any); } { let result: _.LoDashExplicitObjectWrapper<{a: number, b: number, c: number, d: number, e: number}>; result = _(obj).chain().extend(s1, s2, s3, s4, s5); result = _(obj).chain().extend(s1, s2, s3, s4, s5, customizer); result = _(obj).chain().extend(s1, s2, s3, s4, s5, customizer, any); } } // _.findKey namespace TestFindKey { { let predicateFn: (value: any, key?: string, object?: {}) => boolean; let result: string; result = _.findKey<{a: string;}>({a: ''}); result = _.findKey<{a: string;}>({a: ''}, predicateFn); result = _.findKey<{a: string;}>({a: ''}, predicateFn, any); result = _.findKey<{a: string;}>({a: ''}, ''); result = _.findKey<{a: string;}>({a: ''}, '', any); result = _.findKey<{a: number;}, {a: string;}>({a: ''}, {a: 42}); result = _<{a: string;}>({a: ''}).findKey(); result = _<{a: string;}>({a: ''}).findKey(predicateFn); result = _<{a: string;}>({a: ''}).findKey(predicateFn, any); result = _<{a: string;}>({a: ''}).findKey(''); result = _<{a: string;}>({a: ''}).findKey('', any); result = _<{a: string;}>({a: ''}).findKey<{a: number;}>({a: 42}); } { let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; let result: string; result = _.findKey({a: ''}, predicateFn); result = _.findKey({a: ''}, predicateFn, any); result = _<{a: string;}>({a: ''}).findKey(predicateFn); result = _<{a: string;}>({a: ''}).findKey(predicateFn, any); } { let predicateFn: (value: any, key?: string, object?: {}) => boolean; let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findKey(); result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn); result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any); result = _<{a: string;}>({a: ''}).chain().findKey(''); result = _<{a: string;}>({a: ''}).chain().findKey('', any); result = _<{a: string;}>({a: ''}).chain().findKey<{a: number;}>({a: 42}); } { let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn); result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any); } } // _.findLastKey namespace TestFindLastKey { { let predicateFn: (value: any, key?: string, object?: {}) => boolean; let result: string; result = _.findLastKey<{a: string;}>({a: ''}); result = _.findLastKey<{a: string;}>({a: ''}, predicateFn); result = _.findLastKey<{a: string;}>({a: ''}, predicateFn, any); result = _.findLastKey<{a: string;}>({a: ''}, ''); result = _.findLastKey<{a: string;}>({a: ''}, '', any); result = _.findLastKey<{a: number;}, {a: string;}>({a: ''}, {a: 42}); result = _<{a: string;}>({a: ''}).findLastKey(); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn, any); result = _<{a: string;}>({a: ''}).findLastKey(''); result = _<{a: string;}>({a: ''}).findLastKey('', any); result = _<{a: string;}>({a: ''}).findLastKey<{a: number;}>({a: 42}); } { let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; let result: string; result = _.findLastKey({a: ''}, predicateFn); result = _.findLastKey({a: ''}, predicateFn, any); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn, any); } { let predicateFn: (value: any, key?: string, object?: {}) => boolean; let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findLastKey(); result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn); result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any); result = _<{a: string;}>({a: ''}).chain().findLastKey(''); result = _<{a: string;}>({a: ''}).chain().findLastKey('', any); result = _<{a: string;}>({a: ''}).chain().findLastKey<{a: number;}>({a: 42}); } { let predicateFn: (value: string, key?: string, collection?: _.Dictionary) => boolean; let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn); result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any); } } // _.forIn namespace TestForIn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; let object: SampleObject; let objectIterator: (element: any, key?: string, collection?: any) => any; { let result: _.Dictionary; result = _.forIn(dictionary); result = _.forIn(dictionary, dictionaryIterator); result = _.forIn(dictionary, dictionaryIterator, any); } { let result: SampleObject; result = _.forIn(object); result = _.forIn(object, objectIterator); result = _.forIn(object, objectIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forIn(); result = _(dictionary).forIn(dictionaryIterator); result = _(dictionary).forIn(dictionaryIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forIn(); result = _(dictionary).chain().forIn(dictionaryIterator); result = _(dictionary).chain().forIn(dictionaryIterator, any); } } // _.forInRight namespace TestForInRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; let object: SampleObject; let objectIterator: (element: any, key?: string, collection?: any) => any; { let result: _.Dictionary; result = _.forInRight(dictionary); result = _.forInRight(dictionary, dictionaryIterator); result = _.forInRight(dictionary, dictionaryIterator, any); } { let result: SampleObject; result = _.forInRight(object); result = _.forInRight(object, objectIterator); result = _.forInRight(object, objectIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forInRight(); result = _(dictionary).forInRight(dictionaryIterator); result = _(dictionary).forInRight(dictionaryIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forInRight(); result = _(dictionary).chain().forInRight(dictionaryIterator); result = _(dictionary).chain().forInRight(dictionaryIterator, any); } } // _.forOwn namespace TestForOwn { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; let object: SampleObject; let objectIterator: (element: any, key?: string, collection?: any) => any; { let result: _.Dictionary; result = _.forOwn(dictionary); result = _.forOwn(dictionary, dictionaryIterator); result = _.forOwn(dictionary, dictionaryIterator, any); } { let result: SampleObject; result = _.forOwn(object); result = _.forOwn(object, objectIterator); result = _.forOwn(object, objectIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forOwn(); result = _(dictionary).forOwn(dictionaryIterator); result = _(dictionary).forOwn(dictionaryIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forOwn(); result = _(dictionary).chain().forOwn(dictionaryIterator); result = _(dictionary).chain().forOwn(dictionaryIterator, any); } } // _.forOwnRight namespace TestForOwnRight { type SampleObject = {a: number; b: string; c: boolean;}; let dictionary: _.Dictionary; let dictionaryIterator: (value: number, key: string, collection: _.Dictionary) => any; let object: SampleObject; let objectIterator: (element: any, key?: string, collection?: any) => any; { let result: _.Dictionary; result = _.forOwnRight(dictionary); result = _.forOwnRight(dictionary, dictionaryIterator); result = _.forOwnRight(dictionary, dictionaryIterator, any); } { let result: SampleObject; result = _.forOwnRight(object); result = _.forOwnRight(object, objectIterator); result = _.forOwnRight(object, objectIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(dictionary).forOwnRight(); result = _(dictionary).forOwnRight(dictionaryIterator); result = _(dictionary).forOwnRight(dictionaryIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(dictionary).chain().forOwnRight(); result = _(dictionary).chain().forOwnRight(dictionaryIterator); result = _(dictionary).chain().forOwnRight(dictionaryIterator, any); } } // _.functions namespace TestFunctions { type SampleObject = {a: number; b: string; c: boolean;}; let object: SampleObject; { let result: string[]; result = _.functions(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).functions(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().functions(); } } // _.functionsIn namespace TestFunctionsIn { type SampleObject = {a: number; b: string; c: boolean;}; let object: SampleObject; { let result: string[]; result = _.functionsIn(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).functionsIn(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().functionsIn(); } } // _.get namespace TestGet { { let result: string; result = _.get('abc', '0'); result = _.get('abc', '0', '_'); result = _.get('abc', ['0']); result = _.get('abc', ['0'], '_'); result = _.get('abc', '0'); result = _.get('abc', '0', '_'); result = _.get('abc', ['0']); result = _.get('abc', ['0'], '_'); result = _('abc').get('0'); result = _('abc').get('0', '_'); result = _('abc').get(['0']); result = _('abc').get(['0'], '_'); } { let result: number; result = _.get([42], '0'); result = _.get([42], '0', -1); result = _.get([42], ['0']); result = _.get([42], ['0'], -1); result = _.get([42], '0'); result = _.get([42], '0', -1); result = _.get([42], ['0']); result = _.get([42], ['0'], -1); result = _([42]).get('0'); result = _([42]).get('0', -1); result = _([42]).get(['0']); result = _([42]).get(['0'], -1); } { let result: boolean; result = _.get<{a: boolean}, boolean>({a: true}, 'a'); result = _.get<{a: boolean}, boolean>({a: true}, 'a', false); result = _.get<{a: boolean}, boolean>({a: true}, ['a']); result = _.get<{a: boolean}, boolean>({a: true}, ['a'], false); result = _.get({a: true}, 'a'); result = _.get({a: true}, 'a', false); result = _.get({a: true}, ['a']); result = _.get({a: true}, ['a'], false); result = _({a: true}).get('a'); result = _({a: true}).get('a', false); result = _({a: true}).get(['a']); result = _({a: true}).get(['a'], false); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().get<_.LoDashExplicitWrapper>('0'); result = _('abc').chain().get<_.LoDashExplicitWrapper>('0', '_'); result = _('abc').chain().get<_.LoDashExplicitWrapper>(['0']); result = _('abc').chain().get<_.LoDashExplicitWrapper>(['0'], '_'); } { let result: _.LoDashExplicitWrapper; result = _([42]).chain().get<_.LoDashExplicitWrapper>('0'); result = _([42]).chain().get<_.LoDashExplicitWrapper>('0', -1); result = _([42]).chain().get<_.LoDashExplicitWrapper>(['0']); result = _([42]).chain().get<_.LoDashExplicitWrapper>(['0'], -1); } { let result: _.LoDashExplicitWrapper; result = _({a: true}).chain().get<_.LoDashExplicitWrapper>('a'); result = _({a: true}).chain().get<_.LoDashExplicitWrapper>('a', false); result = _({a: true}).chain().get<_.LoDashExplicitWrapper>(['a']); result = _({a: true}).chain().get<_.LoDashExplicitWrapper>(['a'], false); } } // _.has namespace TestHas { type SampleObject = {a: number; b: string; c: boolean;}; let object: SampleObject; { let result: boolean; result = _.has(object, ''); result = _.has(object, 42); result = _.has(object, true); result = _.has(object, ['', 42, true]); result = _(object).has(''); result = _(object).has(42); result = _(object).has(true); result = _(object).has(['', 42, true]); } { let result: _.LoDashExplicitWrapper; result = _(object).chain().has(''); result = _(object).chain().has(42); result = _(object).chain().has(true); result = _(object).chain().has(['', 42, true]); } } // _.hasIn namespace TestHasIn { type SampleObject = {a: number; b: string; c: boolean;}; let object: SampleObject; { let result: boolean; result = _.hasIn(object, ''); result = _.hasIn(object, 42); result = _.hasIn(object, true); result = _.hasIn(object, ['', 42, true]); result = _(object).hasIn(''); result = _(object).hasIn(42); result = _(object).hasIn(true); result = _(object).hasIn(['', 42, true]); } { let result: _.LoDashExplicitWrapper; result = _(object).chain().hasIn(''); result = _(object).chain().hasIn(42); result = _(object).chain().hasIn(true); result = _(object).chain().hasIn(['', 42, true]); } } // _.invert namespace TestInvert { { let result: TResult; result = _.invert({}); result = _.invert({}, true); result = _.invert({}); result = _.invert({}, true); } { let result: _.LoDashImplicitObjectWrapper; result = _({}).invert(); result = _({}).invert(true); } { let result: _.LoDashExplicitObjectWrapper; result = _({}).chain().invert(); result = _({}).chain().invert(true); } } // _.invertBy namespace TestInvertBy { let array: ({a: number;})[]; let list: _.List<{a: number;}>; let dictionary: _.Dictionary<{a: number;}>; let numericDictionary: _.NumericDictionary<{a: number;}>; let stringIterator: (value: string) => any; let arrayIterator: (value: {a: number;}) => any; let listIterator: (value: {a: number;}) => any; let dictionaryIterator: (value: {a: number;}) => any; let numericDictionaryIterator: (value: {a: number;}) => any; { let result: _.Dictionary; result = _.invertBy('foo'); result = _.invertBy('foo', stringIterator); result = _.invertBy(array); result = _.invertBy<{a: number;}>(array, 'a'); result = _.invertBy<{a: number;}>(array, arrayIterator); result = _.invertBy<{a: number;}>(array, {a: 1}); result = _.invertBy(list); result = _.invertBy<{a: number;}>(list, 'a'); result = _.invertBy<{a: number;}>(list, listIterator); result = _.invertBy<{a: number;}>(list, {a: 1}); result = _.invertBy(dictionary); result = _.invertBy<{a: number;}>(dictionary, 'a'); result = _.invertBy<{a: number;}>(dictionary, dictionaryIterator); result = _.invertBy<{a: number;}>(dictionary, {a: 1}); result = _.invertBy(numericDictionary); result = _.invertBy<{a: number;}>(numericDictionary, 'a'); result = _.invertBy<{a: number;}>(numericDictionary, numericDictionaryIterator); result = _.invertBy<{a: number;}>(numericDictionary, {a: 1}); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _('foo').invertBy(); result = _('foo').invertBy(stringIterator); result = _(array).invertBy(); result = _(array).invertBy('a'); result = _(array).invertBy(arrayIterator); result = _(array).invertBy({a: 1}); result = _(list).invertBy(); result = _(list).invertBy('a'); result = _(list).invertBy(listIterator); result = _(list).invertBy<{a: number;}>({a: 1}); result = _(dictionary).invertBy(); result = _(dictionary).invertBy('a'); result = _(dictionary).invertBy(dictionaryIterator); result = _(dictionary).invertBy<{a: number;}>({a: 1}); result = _(numericDictionary).invertBy(); result = _(numericDictionary).invertBy('a'); result = _(numericDictionary).invertBy(numericDictionaryIterator); result = _(numericDictionary).invertBy<{a: number;}>({a: 1}); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _('foo').chain().invertBy(); result = _('foo').chain().invertBy(stringIterator); result = _(array).chain().invertBy(); result = _(array).chain().invertBy('a'); result = _(array).chain().invertBy(arrayIterator); result = _(array).chain().invertBy({a: 1}); result = _(list).chain().invertBy(); result = _(list).chain().invertBy('a'); result = _(list).chain().invertBy(listIterator); result = _(list).chain().invertBy<{a: number;}>({a: 1}); result = _(dictionary).chain().invertBy(); result = _(dictionary).chain().invertBy('a'); result = _(dictionary).chain().invertBy(dictionaryIterator); result = _(dictionary).chain().invertBy<{a: number;}>({a: 1}); result = _(numericDictionary).chain().invertBy(); result = _(numericDictionary).chain().invertBy('a'); result = _(numericDictionary).chain().invertBy(numericDictionaryIterator); result = _(numericDictionary).chain().invertBy<{a: number;}>({a: 1}); } } // _.keys namespace TestKeys { let object: _.Dictionary; { let result: string[]; result = _.keys(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).keys(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().keys(); } } // _.keysIn namespace TestKeysIn { let object: _.Dictionary; { let result: string[]; result = _.keysIn(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).keysIn(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().keysIn(); } } // _.mapKeys namespace TestMapKeys { let array: TResult[]; let list: _.List; let dictionary: _.Dictionary; let listIterator: (value: TResult, index: number, collection: _.List) => string; let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => string; { let result: _.Dictionary; result = _.mapKeys(array); result = _.mapKeys(array, listIterator); result = _.mapKeys(array, listIterator, any); result = _.mapKeys(array, ''); result = _.mapKeys(array, '', any); result = _.mapKeys(array, {}); result = _.mapKeys(list); result = _.mapKeys(list, listIterator); result = _.mapKeys(list, listIterator, any); result = _.mapKeys(list, ''); result = _.mapKeys(list, '', any); result = _.mapKeys(list, {}); result = _.mapKeys(dictionary); result = _.mapKeys(dictionary, dictionaryIterator); result = _.mapKeys(dictionary, dictionaryIterator, any); result = _.mapKeys(dictionary, ''); result = _.mapKeys(dictionary, '', any); result = _.mapKeys(dictionary, {}); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; result = _(array).mapKeys(); result = _(array).mapKeys(listIterator); result = _(array).mapKeys(listIterator, any); result = _(array).mapKeys(''); result = _(array).mapKeys('', any); result = _(array).mapKeys<{}>({}); result = _(list).mapKeys(); result = _(list).mapKeys(listIterator); result = _(list).mapKeys(listIterator, any); result = _(list).mapKeys(''); result = _(list).mapKeys('', any); result = _(list).mapKeys({}); result = _(dictionary).mapKeys(); result = _(dictionary).mapKeys(dictionaryIterator); result = _(dictionary).mapKeys(dictionaryIterator, any); result = _(dictionary).mapKeys(''); result = _(dictionary).mapKeys('', any); result = _(dictionary).mapKeys({}); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; result = _(array).chain().mapKeys(); result = _(array).chain().mapKeys(listIterator); result = _(array).chain().mapKeys(listIterator, any); result = _(array).chain().mapKeys(''); result = _(array).chain().mapKeys('', any); result = _(array).chain().mapKeys<{}>({}); result = _(list).chain().mapKeys(); result = _(list).chain().mapKeys(listIterator); result = _(list).chain().mapKeys(listIterator, any); result = _(list).chain().mapKeys(''); result = _(list).chain().mapKeys('', any); result = _(list).chain().mapKeys({}); result = _(dictionary).chain().mapKeys(); result = _(dictionary).chain().mapKeys(dictionaryIterator); result = _(dictionary).chain().mapKeys(dictionaryIterator, any); result = _(dictionary).chain().mapKeys(''); result = _(dictionary).chain().mapKeys('', any); result = _(dictionary).chain().mapKeys({}); } } // _.merge namespace TestMerge { type InitialValue = { a : number }; type MergingValue = { b : string }; var initialValue = { a : 1 }; var mergingValue = { b : "hi" }; type ExpectedResult = { a: number, b: string }; let result: ExpectedResult; // Test for basic merging result = _.merge(initialValue, mergingValue); result = _.merge(initialValue, {}, mergingValue); result = _.merge(initialValue, {}, {}, mergingValue); result = _.merge(initialValue, {}, {}, {}, mergingValue); // Once we get to the varargs version, you have to specify the result explicitly result = _.merge(initialValue, {}, {}, {}, {}, mergingValue); type ComplicatedExpectedType = { a: number, b: string, c: {}, d: number[], e: boolean }; var complicatedResult: ComplicatedExpectedType = _.merge({ a: 1 }, { b: "string" }, { c: {} }, { d: [1] }, { e: true }); // Test for type overriding type ExpectedTypeAfterOverriding = { a: boolean }; var overriddenResult: ExpectedTypeAfterOverriding = _.merge({ a: 1 }, { a: "string" }, { a: {} }, { a: [1] }, { a: true }); // Tests for basic chaining with merge result = _(initialValue).merge(mergingValue).value(); result = _(initialValue).merge({}, mergingValue).value(); result = _(initialValue).merge({}, {}, mergingValue).value(); result = _(initialValue).merge({}, {}, {}, mergingValue).value(); // Once we get to the varargs version, you have to specify the result explicitly result = _(initialValue).merge({}, {}, {}, {}, mergingValue).value(); // Test complex multiple combinations with chaining var complicatedResult: ComplicatedExpectedType = _({ a: 1 }).merge({ b: "string" }, { c: {} }, { d: [1] }, { e: true }).value(); // Test for type overriding with chaining var overriddenResult: ExpectedTypeAfterOverriding = _({ a: 1 }).merge({ a: "string" }, { a: {} }, { a: [1] }, { a: true }).value(); { let result: _.LoDashExplicitObjectWrapper; // result = _(initialValue).chain().merge(mergingValue); // result = _(initialValue).chain().merge({}, mergingValue); // result = _(initialValue).chain().merge({}, {}, mergingValue); // result = _(initialValue).chain().merge({}, {}, {}, mergingValue); // result = _(initialValue).chain().merge({}, {}, {}, {}, mergingValue); } { let result: _.LoDashExplicitObjectWrapper; //result = _({ a: 1 }).chain().merge({ b: "string" }, { c: {} }, { d: [1] }, { e: true }); } { let result: _.LoDashExplicitObjectWrapper; //result = _({ a: 1 }).chain().merge({ a: "string" }, { a: {} }, { a: [1] }, { a: true }); } } // _.mergeWith namespace TestMergeWith { type InitialValue = { a : number }; type MergingValue = { b : string }; var initialValue = { a : 1 }; var mergingValue = { b : "hi" }; type ExpectedResult = { a: number, b: string }; let result: ExpectedResult; let customizer: (value: any, srcValue: any, key?: string, object?: InitialValue, source?: MergingValue) => any; // Test for basic merging result = _.mergeWith(initialValue, mergingValue, customizer); result = _.mergeWith(initialValue, {}, mergingValue, customizer); result = _.mergeWith(initialValue, {}, {}, mergingValue, customizer); result = _.mergeWith(initialValue, {}, {}, {}, mergingValue, customizer); // Once we get to the varargs version, you have to specify the result explicitl result = _.mergeWith(initialValue, {}, {}, {}, {}, mergingValue, customizer); // Tests for basic chaining with mergeWith result = _(initialValue).mergeWith(mergingValue, customizer).value(); result = _(initialValue).mergeWith({}, mergingValue, customizer).value(); result = _(initialValue).mergeWith({}, {}, mergingValue, customizer).value(); result = _(initialValue).mergeWith({}, {}, {}, mergingValue, customizer).value(); // Once we get to the varargs version, you have to specify the result explicitl result = _(initialValue).mergeWith({}, {}, {}, {}, mergingValue, customizer).value(); } // _.omit namespace TestOmit { let predicate: (element: any, key: string, collection: any) => boolean; { let result: TResult; result = _.omit({}, 'a'); result = _.omit({}, 0, 'a'); result = _.omit({}, true, 0, 'a'); result = _.omit({}, ['b', 1, false], true, 0, 'a'); } { let result: _.LoDashImplicitObjectWrapper; result = _({}).omit('a'); result = _({}).omit(0, 'a'); result = _({}).omit(true, 0, 'a'); result = _({}).omit(['b', 1, false], true, 0, 'a'); } { let result: _.LoDashExplicitObjectWrapper; result = _({}).chain().omit('a'); result = _({}).chain().omit(0, 'a'); result = _({}).chain().omit(true, 0, 'a'); result = _({}).chain().omit(['b', 1, false], true, 0, 'a'); } } // _.omitBy namespace TestOmitBy { let predicate: (element: any, key: string, collection: any) => boolean; { let result: TResult; result = _.omitBy({}, predicate); } { let result: _.LoDashImplicitObjectWrapper; result = _({}).omitBy(predicate); } { let result: _.LoDashExplicitObjectWrapper; result = _({}).chain().omitBy(predicate); } } // _.pick namespace TestPick { let predicate: (element: any, key: string, collection: any) => boolean; { let result: TResult; result = _.pick({}, 'a'); result = _.pick({}, 0, 'a'); result = _.pick({}, true, 0, 'a'); result = _.pick({}, ['b', 1, false], true, 0, 'a'); } { let result: _.LoDashImplicitObjectWrapper; result = _({}).pick('a'); result = _({}).pick(0, 'a'); result = _({}).pick(true, 0, 'a'); result = _({}).pick(['b', 1, false], true, 0, 'a'); } { let result: _.LoDashExplicitObjectWrapper; result = _({}).chain().pick('a'); result = _({}).chain().pick(0, 'a'); result = _({}).chain().pick(true, 0, 'a'); result = _({}).chain().pick(['b', 1, false], true, 0, 'a'); } } // _.pickBy namespace TestPickBy { let predicate: (element: any, key: string, collection: any) => boolean; { let result: TResult; result = _.pickBy({}, predicate); } { let result: _.LoDashImplicitObjectWrapper; result = _({}).pickBy(predicate); } { let result: _.LoDashExplicitObjectWrapper; result = _({}).chain().pickBy(predicate); } } // _.result namespace TestResult { { let result: string; result = _.result('abc', '0'); result = _.result('abc', '0', '_'); result = _.result('abc', '0', () => '_'); result = _.result('abc', ['0']); result = _.result('abc', ['0'], '_'); result = _.result('abc', ['0'], () => '_'); result = _.result('abc', '0'); result = _.result('abc', '0', '_'); result = _.result('abc', '0', () => '_'); result = _.result('abc', ['0']); result = _.result('abc', ['0'], '_'); result = _.result('abc', ['0'], () => '_'); result = _('abc').result('0'); result = _('abc').result('0', '_'); result = _('abc').result('0', () => '_'); result = _('abc').result(['0']); result = _('abc').result(['0'], '_'); result = _('abc').result(['0'], () => '_'); } { let result: number; result = _.result([42], '0'); result = _.result([42], '0', -1); result = _.result([42], '0', () => -1); result = _.result([42], ['0']); result = _.result([42], ['0'], -1); result = _.result([42], ['0'], () => -1); result = _.result([42], '0'); result = _.result([42], '0', -1); result = _.result([42], '0', () => -1); result = _.result([42], ['0']); result = _.result([42], ['0'], -1); result = _.result([42], ['0'], () => -1); result = _([42]).result('0'); result = _([42]).result('0', -1); result = _([42]).result('0', () => -1); result = _([42]).result(['0']); result = _([42]).result(['0'], -1); result = _([42]).result(['0'], () => -1); } { let result: boolean; result = _.result<{a: boolean}, boolean>({a: true}, 'a'); result = _.result<{a: boolean}, boolean>({a: true}, 'a', false); result = _.result<{a: boolean}, boolean>({a: true}, 'a', () => false); result = _.result<{a: boolean}, boolean>({a: true}, ['a']); result = _.result<{a: boolean}, boolean>({a: true}, ['a'], false); result = _.result<{a: boolean}, boolean>({a: true}, ['a'], () => false); result = _.result({a: true}, 'a'); result = _.result({a: true}, 'a', false); result = _.result({a: true}, 'a', () => false); result = _.result({a: true}, ['a']); result = _.result({a: true}, ['a'], false); result = _.result({a: true}, ['a'], () => false); result = _({a: true}).result('a'); result = _({a: true}).result('a', false); result = _({a: true}).result('a', () => false); result = _({a: true}).result(['a']); result = _({a: true}).result(['a'], false); result = _({a: true}).result(['a'], () => false); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().result<_.LoDashExplicitWrapper>('0'); result = _('abc').chain().result<_.LoDashExplicitWrapper>('0', '_'); result = _('abc').chain().result<_.LoDashExplicitWrapper>('0', '_'); result = _('abc').chain().result<_.LoDashExplicitWrapper>(['0']); result = _('abc').chain().result<_.LoDashExplicitWrapper>(['0'], () => '_'); result = _('abc').chain().result<_.LoDashExplicitWrapper>(['0'], () => '_'); } { let result: _.LoDashExplicitWrapper; result = _([42]).chain().result<_.LoDashExplicitWrapper>('0'); result = _([42]).chain().result<_.LoDashExplicitWrapper>('0', -1); result = _([42]).chain().result<_.LoDashExplicitWrapper>('0', () => -1); result = _([42]).chain().result<_.LoDashExplicitWrapper>(['0']); result = _([42]).chain().result<_.LoDashExplicitWrapper>(['0'], -1); result = _([42]).chain().result<_.LoDashExplicitWrapper>(['0'], () => -1); } { let result: _.LoDashExplicitWrapper; result = _({a: true}).chain().result<_.LoDashExplicitWrapper>('a'); result = _({a: true}).chain().result<_.LoDashExplicitWrapper>('a', false); result = _({a: true}).chain().result<_.LoDashExplicitWrapper>('a', () => false); result = _({a: true}).chain().result<_.LoDashExplicitWrapper>(['a']); result = _({a: true}).chain().result<_.LoDashExplicitWrapper>(['a'], false); result = _({a: true}).chain().result<_.LoDashExplicitWrapper>(['a'], () => false); } } // _.set namespace TestSet { type SampleObject = {a: {}}; type SampleResult = {a: {b: number[]}}; let object: SampleObject; let value: number; { let result: SampleResult; result = _.set(object, 'a.b[1]', value); result = _.set(object, ['a', 'b', 1], value); result = _.set(object, 'a.b[1]', value); result = _.set(object, ['a', 'b', 1], value); result = _.set(object, 'a.b[1]', value); result = _.set(object, ['a', 'b', 1], value); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).set('a.b[1]', value); result = _(object).set(['a', 'b', 1], value); result = _(object).set('a.b[1]', value); result = _(object).set(['a', 'b', 1], value); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().set('a.b[1]', value); result = _(object).chain().set(['a', 'b', 1], value); result = _(object).chain().set('a.b[1]', value); result = _(object).chain().set(['a', 'b', 1], value); } } // _.setWith namespace TestSetWith { type SampleObject = {a: {}}; type SampleResult = {a: {b: number[]}}; let object: SampleObject; let value: number; let customizer: (value: any, key: string, object: SampleObject) => number; { let result: SampleResult; result = _.setWith(object, 'a.b[1]', value); result = _.setWith(object, 'a.b[1]', value, customizer); result = _.setWith(object, ['a', 'b', 1], value); result = _.setWith(object, ['a', 'b', 1], value, customizer); result = _.setWith(object, 'a.b[1]', value); result = _.setWith(object, 'a.b[1]', value, customizer); result = _.setWith(object, ['a', 'b', 1], value); result = _.setWith(object, ['a', 'b', 1], value, customizer); result = _.setWith(object, 'a.b[1]', value); result = _.setWith(object, 'a.b[1]', value, customizer); result = _.setWith(object, ['a', 'b', 1], value); result = _.setWith(object, ['a', 'b', 1], value, customizer); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).setWith('a.b[1]', value); result = _(object).setWith('a.b[1]', value, customizer); result = _(object).setWith(['a', 'b', 1], value); result = _(object).setWith(['a', 'b', 1], value, customizer); result = _(object).setWith('a.b[1]', value); result = _(object).setWith('a.b[1]', value, customizer); result = _(object).setWith(['a', 'b', 1], value); result = _(object).setWith(['a', 'b', 1], value, customizer); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().setWith('a.b[1]', value); result = _(object).chain().setWith('a.b[1]', value, customizer); result = _(object).chain().setWith(['a', 'b', 1], value); result = _(object).chain().setWith(['a', 'b', 1], value, customizer); result = _(object).chain().setWith('a.b[1]', value); result = _(object).chain().setWith('a.b[1]', value, customizer); result = _(object).chain().setWith(['a', 'b', 1], value); result = _(object).chain().setWith(['a', 'b', 1], value, customizer); } } // _.toPairs namespace TestToPairs { let object: _.Dictionary; { let result: any[][]; result = _.toPairs<_.Dictionary>(object); } { let result: string[][]; result = _.toPairs<_.Dictionary, string>(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).toPairs(); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).toPairs(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().toPairs(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().toPairs(); } } // _.toPairsIn namespace TestToPairsIn { let object: _.Dictionary; { let result: any[][]; result = _.toPairsIn<_.Dictionary>(object); } { let result: string[][]; result = _.toPairsIn<_.Dictionary, string>(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).toPairsIn(); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).toPairsIn(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().toPairsIn(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().toPairs(); } } // _.transform namespace TestTransform { let array: number[]; let dictionary: _.Dictionary; { let iterator: (acc: TResult[], curr: number, index?: number, arr?: number[]) => void; let accumulator: TResult[]; let result: TResult[]; result = _.transform(array); result = _.transform(array, iterator); result = _.transform(array, iterator, accumulator); result = _.transform(array, iterator, accumulator, any); result = _(array).transform().value(); result = _(array).transform(iterator).value(); result = _(array).transform(iterator, accumulator).value(); result = _(array).transform(iterator, accumulator, any).value(); } { let iterator: (acc: _.Dictionary, curr: number, index?: number, arr?: number[]) => void; let accumulator: _.Dictionary; let result: _.Dictionary; result = _.transform(array, iterator); result = _.transform(array, iterator, accumulator); result = _.transform(array, iterator, accumulator, any); result = _(array).transform(iterator).value(); result = _(array).transform(iterator, accumulator).value(); result = _(array).transform(iterator, accumulator, any).value(); } { let iterator: (acc: _.Dictionary, curr: number, key?: string, dict?: _.Dictionary) => void; let accumulator: _.Dictionary; let result: _.Dictionary; result = _.transform(dictionary); result = _.transform(dictionary, iterator); result = _.transform(dictionary, iterator, accumulator); result = _.transform(dictionary, iterator, accumulator, any); result = _(dictionary).transform().value(); result = _(dictionary).transform(iterator).value(); result = _(dictionary).transform(iterator, accumulator).value(); result = _(dictionary).transform(iterator, accumulator, any).value(); } { let iterator: (acc: TResult[], curr: number, key?: string, dict?: _.Dictionary) => void; let accumulator: TResult[]; let result: TResult[]; result = _.transform(dictionary, iterator); result = _.transform(dictionary, iterator, accumulator); result = _.transform(dictionary, iterator, accumulator, any); result = _(dictionary).transform(iterator).value(); result = _(dictionary).transform(iterator, accumulator).value(); result = _(dictionary).transform(iterator, accumulator, any).value(); } } // _.unset namespace TestUnset { type SampleObject = {a: {b: string; c: boolean}}; let object: SampleObject; { let result: boolean; _.unset(object, 'a.b'); _.unset(object, ['a', 'b']); } { let result: _.LoDashImplicitWrapper; result = _(object).unset('a.b'); result = _(object).unset(['a', 'b']); } { let result: _.LoDashExplicitWrapper; result = _(object).chain().unset('a.b'); result = _(object).chain().unset(['a', 'b']); } } // _.update namespace TestUpdate { type SampleObject = {a: {}}; type SampleResult = {a: {b: number[]}}; let object: SampleObject; let updater: (value: any) => number; { let result: SampleResult; result = _.update(object, 'a.b[1]', updater); result = _.update(object, ['a', 'b', 1], updater); result = _.update<(value: any) => number, SampleResult>(object, 'a.b[1]', updater); result = _.update<(value: any) => number, SampleResult>(object, ['a', 'b', 1], updater); result = _.update(object, 'a.b[1]', updater); result = _.update(object, ['a', 'b', 1], updater); result = _.update number, SampleResult>(object, 'a.b[1]', updater); result = _.update number, SampleResult>(object, ['a', 'b', 1], updater); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).update('a.b[1]', updater); result = _(object).update(['a', 'b', 1], updater); result = _(object).update<(value: any) => number, SampleResult>('a.b[1]', updater); result = _(object).update<(value: any) => number, SampleResult>(['a', 'b', 1], updater); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().update('a.b[1]', updater); result = _(object).chain().update(['a', 'b', 1], updater); result = _(object).chain().update<(value: any) => number, SampleResult>('a.b[1]', updater); result = _(object).chain().update<(value: any) => number, SampleResult>(['a', 'b', 1], updater); } } // _.values namespace TestValues { let object: _.Dictionary; { let result: TResult[]; result = _.values(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).values(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().values(); } } // _.valuesIn namespace TestValuesIn { let object: _.Dictionary; { let result: TResult[]; result = _.valuesIn(object); } { let result: _.LoDashImplicitArrayWrapper; result = _(object).valuesIn(); } { let result: _.LoDashExplicitArrayWrapper; result = _(object).chain().valuesIn(); } } /********** * String * **********/ // _.camelCase namespace TestCamelCase { { let result: string; result = _.camelCase('Foo Bar'); result = _('Foo Bar').camelCase(); } { let result: _.LoDashExplicitWrapper; result = _('Foo Bar').chain().camelCase(); } } // _.capitalize namespace TestCapitalize { { let result: string; result = _.capitalize('fred'); result = _('fred').capitalize(); } { let result: _.LoDashExplicitWrapper; result = _('fred').chain().capitalize(); } } // _.deburr namespace TestDeburr { { let result: string; result = _.deburr('déjà vu'); result = _('déjà vu').deburr(); } { let result: _.LoDashExplicitWrapper; result = _('déjà vu').chain().deburr(); } } // _.endsWith namespace TestEndsWith { { let result: boolean; result = _.endsWith('abc', 'c'); result = _.endsWith('abc', 'c', 1); result = _('abc').endsWith('c'); result = _('abc').endsWith('c', 1); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().endsWith('c'); result = _('abc').chain().endsWith('c', 1); } } // _.escape namespace TestEscape { { let result: string; result = _.escape('fred, barney, & pebbles'); result = _('fred, barney, & pebbles').escape(); } { let result: _.LoDashExplicitWrapper; result = _('fred, barney, & pebbles').chain().escape(); } } // _.escapeRegExp namespace TestEscapeRegExp { { let result: string; result = _.escapeRegExp('[lodash](https://lodash.com/)'); result = _('[lodash](https://lodash.com/)').escapeRegExp(); } { let result: _.LoDashExplicitWrapper; result = _('[lodash](https://lodash.com/)').chain().escapeRegExp(); } } // _.kebabCase namespace TestKebabCase { { let result: string; result = _.kebabCase('Foo Bar'); result = _('Foo Bar').kebabCase(); } { let result: _.LoDashExplicitWrapper; result = _('Foo Bar').chain().kebabCase(); } } // _.lowerCase namespace TestLowerCase { { let result: string; result = _.lowerCase('Foo Bar'); result = _('Foo Bar').lowerCase(); } { let result: _.LoDashExplicitWrapper; result = _('Foo Bar').chain().lowerCase(); } } // _.lowerFirst namespace TestLowerFirst { { let result: string; result = _.lowerFirst('Foo Bar'); result = _('Foo Bar').lowerFirst(); } { let result: _.LoDashExplicitWrapper; result = _('Foo Bar').chain().lowerFirst(); } } // _.pad namespace TestPad { { let result: string; result = _.pad('abc'); result = _.pad('abc', 8); result = _.pad('abc', 8, '_-'); result = _('abc').pad(); result = _('abc').pad(8); result = _('abc').pad(8, '_-'); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().pad(); result = _('abc').chain().pad(8); result = _('abc').chain().pad(8, '_-'); } } // _.padEnd namespace TestPadEnd { { let result: string; result = _.padEnd('abc'); result = _.padEnd('abc', 6); result = _.padEnd('abc', 6, '_-'); result = _('abc').padEnd(); result = _('abc').padEnd(6); result = _('abc').padEnd(6, '_-'); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().padEnd(); result = _('abc').chain().padEnd(6); result = _('abc').chain().padEnd(6, '_-'); } } // _.padStart namespace TestPadStart { { let result: string; result = _.padStart('abc'); result = _.padStart('abc', 6); result = _.padStart('abc', 6, '_-'); result = _('abc').padStart(); result = _('abc').padStart(6); result = _('abc').padStart(6, '_-'); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().padStart(); result = _('abc').chain().padStart(6); result = _('abc').chain().padStart(6, '_-'); } } // _.parseInt namespace TestParseInt { { let result: number; result = _.parseInt('08'); result = _.parseInt('08', 10); result = _('08').parseInt(); result = _('08').parseInt(10); } { let result: _.LoDashExplicitWrapper; result = _('08').chain().parseInt(); result = _('08').chain().parseInt(10); } } // _.repeat namespace TestRepeat { { let result: string; result = _.repeat('*'); result = _.repeat('*', 3); result = _('*').repeat(); result = _('*').repeat(3); } { let result: _.LoDashExplicitWrapper; result = _('*').chain().repeat(); result = _('*').chain().repeat(3); } } // _.replace namespace TestReplace { let replacer = (match: string, offset: number, string: string) => 'Barney'; { let result: string; result = _.replace('Hi Fred', 'Fred', 'Barney'); result = _.replace('Hi Fred', 'Fred', replacer); result = _.replace('Hi Fred', /fred/i, 'Barney'); result = _.replace('Hi Fred', /fred/i, replacer); result = _.replace('Fred'); result = _.replace('Fred', 'Barney'); result = _.replace('Fred', replacer); result = _.replace(/fred/i); result = _.replace(/fred/i, 'Barney'); result = _.replace(/fred/i, replacer); result = _('Hi Fred').replace('Fred', 'Barney'); result = _('Hi Fred').replace('Fred', replacer); result = _('Hi Fred').replace(/fred/i, 'Barney'); result = _('Hi Fred').replace(/fred/i, replacer); result = _('Fred').replace(); result = _('Fred').replace('Barney'); result = _('Fred').replace(replacer); result = _(/fred/i).replace(); result = _(/fred/i).replace('Barney'); result = _(/fred/i).replace(replacer); } { let result: _.LoDashExplicitWrapper; result = _('Hi Fred').chain().replace('Fred', 'Barney'); result = _('Hi Fred').chain().replace('Fred', replacer); result = _('Hi Fred').chain().replace(/fred/i, 'Barney'); result = _('Hi Fred').chain().replace(/fred/i, replacer); result = _('Fred').chain().replace(); result = _('Fred').chain().replace('Barney'); result = _('Fred').chain().replace(replacer); result = _(/fred/i).chain().replace(); result = _(/fred/i).chain().replace('Barney'); result = _(/fred/i).chain().replace(replacer); } } // _.snakeCase namespace TestSnakeCase { { let result: string; result = _.snakeCase('Foo Bar'); result = _('Foo Bar').snakeCase(); } { let result: _.LoDashExplicitWrapper; result = _('Foo Bar').chain().snakeCase(); } } // _.split namespace TestSplit { { let result: string[]; result = _.split('a-b-c'); result = _.split('a-b-c', '-'); result = _.split('a-b-c', '-', 2); } { let result: _.LoDashImplicitArrayWrapper; result = _('a-b-c').split(); result = _('a-b-c').split('-'); result = _('a-b-c').split('-', 2); } { let result: _.LoDashExplicitArrayWrapper; result = _('a-b-c').chain().split(); result = _('a-b-c').chain().split('-'); result = _('a-b-c').chain().split('-', 2); } } // _.startCase namespace TestStartCase { { let result: string; result = _.startCase('--foo-bar'); result = _('--foo-bar').startCase(); } { let result: _.LoDashExplicitWrapper; result = _('--foo-bar').chain().startCase(); } } // _.startsWith namespace TestStartsWith { { let result: boolean; result = _.startsWith('abc', 'a'); result = _.startsWith('abc', 'a', 1); result = _('abc').startsWith('a'); result = _('abc').startsWith('a', 1); } { let result: _.LoDashExplicitWrapper; result = _('abc').chain().startsWith('a'); result = _('abc').chain().startsWith('a', 1); } } // _.template namespace TestTemplate { interface TemplateExecutor { (obj?: Object): string; source: string; } let options: { escape?: RegExp; evaluate?: RegExp; imports?: _.Dictionary; interpolate?: RegExp; sourceURL?: string; variable?: string; }; { let result: TemplateExecutor; result = _.template(''); result = _.template('', options); result = _('').template(); result = _('').template(options); } { let result: _.LoDashExplicitObjectWrapper; result = _('').chain().template(); result = _('').chain().template(options); } } // _.toLower namespace TestToLower { { let result: string; result = _.toLower('fred, barney, & pebbles'); result = _('fred, barney, & pebbles').toLower(); } { let result: _.LoDashExplicitWrapper; result = _('fred, barney, & pebbles').chain().toLower(); } } // _.toUpper namespace TestToUpper { { let result: string; result = _.toUpper('fred, barney, & pebbles'); result = _('fred, barney, & pebbles').toUpper(); } { let result: _.LoDashExplicitWrapper; result = _('fred, barney, & pebbles').chain().toUpper(); } } // _.trim namespace TestTrim { { let result: string; result = _.trim(); result = _.trim(' abc '); result = _.trim('-_-abc-_-', '_-'); result = _('-_-abc-_-').trim(); result = _('-_-abc-_-').trim('_-'); } { let result: _.LoDashExplicitWrapper; result = _('-_-abc-_-').chain().trim(); result = _('-_-abc-_-').chain().trim('_-'); } } // _.trimEnd namespace TestTrimEnd { { let result: string; result = _.trimEnd(); result = _.trimEnd(' abc '); result = _.trimEnd('-_-abc-_-', '_-'); result = _('-_-abc-_-').trimEnd(); result = _('-_-abc-_-').trimEnd('_-'); } { let result: _.LoDashExplicitWrapper; result = _('-_-abc-_-').chain().trimEnd(); result = _('-_-abc-_-').chain().trimEnd('_-'); } } // _.trimStart namespace TestTrimStart { { let result: string; result = _.trimStart(); result = _.trimStart(' abc '); result = _.trimStart('-_-abc-_-', '_-'); result = _('-_-abc-_-').trimStart(); result = _('-_-abc-_-').trimStart('_-'); } { let result: _.LoDashExplicitWrapper; result = _('-_-abc-_-').chain().trimStart(); result = _('-_-abc-_-').chain().trimStart('_-'); } } // _.truncate namespace TestTruncate { { let result: string; result = _.truncate('hi-diddly-ho there, neighborino'); result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' }); result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ }); result = _.truncate('hi-diddly-ho there, neighborino', { 'omission': ' […]' }); result = _('hi-diddly-ho there, neighborino').truncate(); result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': ' ' }); result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': /,? +/ }); result = _('hi-diddly-ho there, neighborino').truncate({ 'omission': ' […]' }); } { let result: _.LoDashExplicitWrapper; result = _('hi-diddly-ho there, neighborino').chain().truncate(); result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': ' ' }); result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': /,? +/ }); result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'omission': ' […]' }); } } // _.unescape namespace TestUnescape { { let result: string; result = _.unescape('fred, barney, & pebbles'); result = _('fred, barney, & pebbles').unescape(); } { let result: _.LoDashExplicitWrapper; result = _('fred, barney, & pebbles').chain().unescape(); } } // _.upperCase namespace TestUpperCase { { let result: string; result = _.upperCase('fred, barney, & pebbles'); result = _('fred, barney, & pebbles').upperCase(); } { let result: _.LoDashExplicitWrapper; result = _('fred, barney, & pebbles').chain().upperCase(); } } // _.upperFirst namespace TestUpperFirst { { let result: string; result = _.upperFirst('fred, barney, & pebbles'); result = _('fred, barney, & pebbles').upperFirst(); } { let result: _.LoDashExplicitWrapper; result = _('fred, barney, & pebbles').chain().upperFirst(); } } // _.words namespace TestWords { { let result: string[]; result = _.words('fred, barney, & pebbles'); result = _.words('fred, barney, & pebbles', /[^, ]+/g); result = _('fred, barney, & pebbles').words(); result = _('fred, barney, & pebbles').words(/[^, ]+/g); } { let result: _.LoDashExplicitArrayWrapper; result = _('fred, barney, & pebbles').chain().words(); result = _('fred, barney, & pebbles').chain().words(/[^, ]+/g); } } /*********** * Utility * ***********/ // _.attempt namespace TestAttempt { let func: (...args: any[]) => {a: string}; { let result: {a: string}|Error; result = _.attempt<{a: string}>(func); result = _.attempt<{a: string}>(func, 'foo', 'bar', 'baz'); result = _(func).attempt<{a: string}>(); result = _(func).attempt<{a: string}>('foo', 'bar', 'baz'); } { let result: _.LoDashExplicitObjectWrapper<{a: string}|Error>; result = _(func).chain().attempt<{a: string}>(); result = _(func).chain().attempt<{a: string}>('foo', 'bar', 'baz'); } } // _.constant namespace TestConstant { { let result: () => number; result: _.constant(42); } { let result: () => string; result: _.constant('a'); } { let result: () => boolean; result: _.constant(true); } { let result: () => string[]; result: _.constant(['a']); } { let result: () => {a: string}; result: _.constant<{a: string}>({a: 'a'}); } { let result: _.LoDashImplicitObjectWrapper<() => number>; result: _(42).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => string>; result: _('a').constant(); } { let result: _.LoDashImplicitObjectWrapper<() => boolean>; result: _(true).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => string[]>; result: _(['a']).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => {a: string}>; result: _({a: 'a'}).constant<{a: string}>(); } { let result: _.LoDashExplicitObjectWrapper<() => number>; result: _(42).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => string>; result: _('a').chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => boolean>; result: _(true).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => string[]>; result: _(['a']).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => {a: string}>; result: _({a: 'a'}).chain().constant<{a: string}>(); } } // _.identity namespace TestIdentity { { let result: number; result = _.identity(42); result = _(42).identity(); } { let result: number[]; result = _.identity([42]); result = _([42]).identity(); } { let result: {a: number}; result = _.identity({a: 42}); result = _({a: 42}).identity(); } { let result: _.LoDashExplicitWrapper; result = _(42).chain().identity(); } { let result: _.LoDashExplicitArrayWrapper; result = _([42]).chain().identity(); } { let result: _.LoDashExplicitObjectWrapper<{a: number}>; result = _({a: 42}).chain().identity(); } } // _.iteratee namespace TestIteratee { { let result: (...args: any[]) => TResult; result = _.iteratee(Function); result = _.iteratee(Function, any); } { let result: (object: any) => TResult; result = _.iteratee(''); result = _.iteratee('', any); } { let result: (object: any) => boolean; result = _.iteratee({}); result = _.iteratee({}, any); } { let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; result = _(Function).iteratee(); result = _(Function).iteratee(any); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; result = _('').iteratee(); result = _('').iteratee(any); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => boolean>; result = _({}).iteratee(); result = _({}).iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; result = _(Function).chain().iteratee(); result = _(Function).chain().iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; result = _('').chain().iteratee(); result = _('').chain().iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => boolean>; result = _({}).chain().iteratee(); result = _({}).chain().iteratee(any); } } // _.matches namespace TestMatches { let source: TResult; { let result: (value: any) => boolean; result = _.matches(source); } { let result: (value: TResult) => boolean; result = _.matches(source); } { let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; result = _(source).matches(); } { let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; result = _(source).chain().matches(); } } // _.matchesProperty namespace TestMatches { let path: {toString(): string;}|{toString(): string;}[]; let source: TResult; { let result: (value: any) => boolean; result = _.matchesProperty(path, source); } { let result: (value: TResult) => boolean; result = _.matchesProperty(path, source); } { let result: _.LoDashImplicitObjectWrapper<(value: any) => boolean>; result = _(path).matchesProperty(source); } { let result: _.LoDashImplicitObjectWrapper<(value: TResult) => boolean>; result = _(path).matchesProperty(source); } { let result: _.LoDashExplicitObjectWrapper<(value: any) => boolean>; result = _(path).chain().matchesProperty(source); } { let result: _.LoDashExplicitObjectWrapper<(value: TResult) => boolean>; result = _(path).chain().matchesProperty(source); } } // _.method namespace TestMethod { { let result: (object: any) => {a: string}; result = _.method<{a: string}>('a.0'); result = _.method<{a: string}>('a.0', any); result = _.method<{a: string}>('a.0', any, any); result = _.method<{a: string}>('a.0', any, any, any); result = _.method<{a: string}>(['a', 0]); result = _.method<{a: string}>(['a', 0], any); result = _.method<{a: string}>(['a', 0], any, any); result = _.method<{a: string}>(['a', 0], any, any, any); } { let result: (object: {a: string}) => {b: string}; result = _.method<{a: string}, {b: string}>('a.0'); result = _.method<{a: string}, {b: string}>('a.0', any); result = _.method<{a: string}, {b: string}>('a.0', any, any); result = _.method<{a: string}, {b: string}>('a.0', any, any, any); result = _.method<{a: string}, {b: string}>(['a', 0]); result = _.method<{a: string}, {b: string}>(['a', 0], any); result = _.method<{a: string}, {b: string}>(['a', 0], any, any); result = _.method<{a: string}, {b: string}>(['a', 0], any, any, any); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').method<{a: string}>(); result = _('a.0').method<{a: string}>(any); result = _('a.0').method<{a: string}>(any, any); result = _('a.0').method<{a: string}>(any, any, any); result = _(['a', 0]).method<{a: string}>(); result = _(['a', 0]).method<{a: string}>(any); result = _(['a', 0]).method<{a: string}>(any, any); result = _(['a', 0]).method<{a: string}>(any, any, any); } { let result: _.LoDashImplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').method<{a: string}, {b: string}>(); result = _('a.0').method<{a: string}, {b: string}>(any); result = _('a.0').method<{a: string}, {b: string}>(any, any); result = _('a.0').method<{a: string}, {b: string}>(any, any, any); result = _(['a', 0]).method<{a: string}, {b: string}>(); result = _(['a', 0]).method<{a: string}, {b: string}>(any); result = _(['a', 0]).method<{a: string}, {b: string}>(any, any); result = _(['a', 0]).method<{a: string}, {b: string}>(any, any, any); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => {a: string}>; result = _('a.0').chain().method<{a: string}>(); result = _('a.0').chain().method<{a: string}>(any); result = _('a.0').chain().method<{a: string}>(any, any); result = _('a.0').chain().method<{a: string}>(any, any, any); result = _(['a', 0]).chain().method<{a: string}>(); result = _(['a', 0]).chain().method<{a: string}>(any); result = _(['a', 0]).chain().method<{a: string}>(any, any); result = _(['a', 0]).chain().method<{a: string}>(any, any, any); } { let result: _.LoDashExplicitObjectWrapper<(object: {a: string}) => {b: string}>; result = _('a.0').chain().method<{a: string}, {b: string}>(); result = _('a.0').chain().method<{a: string}, {b: string}>(any); result = _('a.0').chain().method<{a: string}, {b: string}>(any, any); result = _('a.0').chain().method<{a: string}, {b: string}>(any, any, any); result = _(['a', 0]).chain().method<{a: string}, {b: string}>(); result = _(['a', 0]).chain().method<{a: string}, {b: string}>(any); result = _(['a', 0]).chain().method<{a: string}, {b: string}>(any, any); result = _(['a', 0]).chain().method<{a: string}, {b: string}>(any, any, any); } } // _.methodOf namespace TestMethodOf { type SampleObject = {a: {b: () => TResult}[]}; type ResultFn = (path: _.StringRepresentable|_.StringRepresentable[]) => TResult; let object: SampleObject; { let result: ResultFn; result = _.methodOf(object); result = _.methodOf(object, any); result = _.methodOf(object, any, any); result = _.methodOf(object, any, any, any); result = _.methodOf(object); result = _.methodOf(object, any); result = _.methodOf(object, any, any); result = _.methodOf(object, any, any, any); } { let result: _.LoDashImplicitObjectWrapper; result = _(object).methodOf(); result = _(object).methodOf(any); result = _(object).methodOf(any, any); result = _(object).methodOf(any, any, any); } { let result: _.LoDashExplicitObjectWrapper; result = _(object).chain().methodOf(); result = _(object).chain().methodOf(any); result = _(object).chain().methodOf(any, any); result = _(object).chain().methodOf(any, any, any); } } // _.mixin namespace TestMixin { let source: _.Dictionary; let options: {chain?: boolean}; { let result: TResult; result = _.mixin({}, source); result = _.mixin({}, source, options); result = _.mixin(source); result = _.mixin(source, options); } { let result: _.LoDashImplicitObjectWrapper; result = _({}).mixin(source); result = _({}).mixin(source, options); result = _(source).mixin(); result = _(source).mixin(options); } { let result: _.LoDashExplicitObjectWrapper; result = _({}).chain().mixin(source); result = _({}).chain().mixin(source, options); result = _(source).chain().mixin(); result = _(source).chain().mixin(options); } } // _.noConflict namespace TestNoConflict { { let result: typeof _; result = _.noConflict(); result = _(42).noConflict(); result = _([]).noConflict(); result = _({}).noConflict(); } { let result: _.LoDashExplicitObjectWrapper; result = _(42).chain().noConflict(); result = _([]).chain().noConflict(); result = _({}).chain().noConflict(); } } // _.noop namespace TestNoop { { let result: void; result = _.noop(); result = _.noop(1); result = _.noop('a', 1); result = _.noop(true, 'a', 1); result = _('a').noop(true, 'a', 1); result = _([1]).noop(true, 'a', 1); result = _([]).noop(true, 'a', 1); result = _({}).noop(true, 'a', 1); result = _(any).noop(true, 'a', 1); } { let result: _.LoDashExplicitWrapper; result = _('a').chain().noop(true, 'a', 1); result = _([1]).chain().noop(true, 'a', 1); result = _([]).chain().noop(true, 'a', 1); result = _({}).chain().noop(true, 'a', 1); result = _(any).chain().noop(true, 'a', 1); } } namespace TestNthArg { type SampleFunc = (...args: any[]) => any; { let result: SampleFunc; result = _.nthArg(); result = _.nthArg(1); } { let result: _.LoDashImplicitObjectWrapper; result = _(1).nthArg(); } { let result: _.LoDashExplicitObjectWrapper; result = _(1).chain().nthArg(); } } // _.over namespace TestOver { { let result: (...args: any[]) => number[]; result = _.over(Math.max); result = _.over(Math.max, Math.min); result = _.over([Math.max]); result = _.over([Math.max], [Math.min]); } { let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => number[]>; result = _(Math.max).over(); result = _(Math.max).over(Math.min); result = _([Math.max]).over(); result = _([Math.max]).over([Math.min]); } { let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => number[]>; result = _(Math.max).chain().over(); result = _(Math.max).chain().over(Math.min); result = _([Math.max]).chain().over(); result = _([Math.max]).chain().over([Math.min]); } } // _.overEvery namespace TestOverEvery { { let result: (...args: any[]) => boolean; result = _.overEvery(() => true); result = _.overEvery(() => true, () => true); result = _.overEvery([() => true]); result = _.overEvery([() => true], [() => true]); } { let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; result = _(Math.max).overEvery(); result = _(Math.max).overEvery(() => true); result = _([Math.max]).overEvery(); result = _([Math.max]).overEvery([() => true]); } { let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; result = _(Math.max).chain().overEvery(); result = _(Math.max).chain().overEvery(() => true); result = _([Math.max]).chain().overEvery(); result = _([Math.max]).chain().overEvery([() => true]); } } // _.overSome namespace TestOverSome { { let result: (...args: any[]) => boolean; result = _.overSome(() => true); result = _.overSome(() => true, () => true); result = _.overSome([() => true]); result = _.overSome([() => true], [() => true]); } { let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; result = _(Math.max).overSome(); result = _(Math.max).overSome(() => true); result = _([Math.max]).overSome(); result = _([Math.max]).overSome([() => true]); } { let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; result = _(Math.max).chain().overSome(); result = _(Math.max).chain().overSome(() => true); result = _([Math.max]).chain().overSome(); result = _([Math.max]).chain().overSome([() => true]); } } // _.property namespace TestProperty { interface SampleObject { a: { b: number[]; } } { let result: (object: SampleObject) => number; result = _.property('a.b[0]'); result = _.property(['a', 'b', 0]); } { let result: _.LoDashImplicitObjectWrapper<(object: SampleObject) => number>; result = _('a.b[0]').property(); result = _(['a', 'b', 0]).property(); } { let result: _.LoDashExplicitObjectWrapper<(object: SampleObject) => number>; result = _('a.b[0]').chain().property(); result = _(['a', 'b', 0]).chain().property(); } } // _.propertyOf namespace TestPropertyOf { interface SampleObject { a: { b: number[]; } } let object: SampleObject; { let result: (path: string|string[]) => any; result = _.propertyOf({}); result = _.propertyOf(object); } { let result: _.LoDashImplicitObjectWrapper<(path: string|string[]) => any>; result = _({}).propertyOf(); } { let result: _.LoDashExplicitObjectWrapper<(path: string|string[]) => any>; result = _({}).chain().propertyOf(); } } // _.range namespace TestRange { { let result: number[]; result = _.range(10); result = _.range(1, 11); result = _.range(0, 30, 5); } { let result: _.LoDashImplicitArrayWrapper; result = _(10).range(); result = _(1).range(11); result = _(0).range(30, 5); } { let result: _.LoDashExplicitArrayWrapper; result = _(10).chain().range(); result = _(1).chain().range(11); result = _(0).chain().range(30, 5); } } // _.rangeRight namespace TestRangeRight { { let result: number[]; result = _.rangeRight(10); result = _.rangeRight(1, 11); result = _.rangeRight(0, 30, 5); } { let result: _.LoDashImplicitArrayWrapper; result = _(10).rangeRight(); result = _(1).rangeRight(11); result = _(0).rangeRight(30, 5); } { let result: _.LoDashExplicitArrayWrapper; result = _(10).chain().rangeRight(); result = _(1).chain().rangeRight(11); result = _(0).chain().rangeRight(30, 5); } } // _.runInContext { let result: typeof _; result = _.runInContext(); result = _.runInContext({}); result = _({}).runInContext(); } // _.times namespace TestTimes { let iteratee: (num: number) => TResult; { let result: number[]; result = _.times(42); result = _(42).times(); } { let result: TResult[]; result = _.times(42, iteratee); result = _(42).times(iteratee); } { let result: _.LoDashExplicitArrayWrapper; result = _(42).chain().times(); } { let result: _.LoDashExplicitArrayWrapper; result = _(42).chain().times(iteratee); } } // _.toPath namespace TestToPath { { let result: string[]; result = _.toPath(true); result = _.toPath(1); result = _.toPath('a'); result = _.toPath(["a"]); result = _.toPath({}); } { let result: _.LoDashImplicitWrapper; result = _(true).toPath(); result = _(1).toPath(); result = _('a').toPath(); result = _([1]).toPath(); result = _(["a"]).toPath(); result = _({}).toPath(); } } // _.uniqueId namespace TestUniqueId { { let result: string; result = _.uniqueId(); result = _.uniqueId(''); result = _('').uniqueId(); } { let result: _.LoDashExplicitWrapper; result = _('').chain().uniqueId(); } } result = _.VERSION; result = <_.TemplateSettings>_.templateSettings; // _.partial & _.partialRight { function func0(): number { return 42; } function func1(arg1: number): number { return arg1 * 2; } function func2(arg1: number, arg2: string): number { return arg1 * arg2.length; } function func3(arg1: number, arg2: string, arg3: boolean): number { return arg1 * arg2.length + (arg3 ? 1 : 0); } function func4(arg1: number, arg2: string, arg3: boolean, arg4: number): number { return arg1 * arg2.length + (arg3 ? 1 : 0) - arg4; } let res____: () => number; let res1___: (arg1: number ) => number; let res_2__: ( arg2: string ) => number; let res__3_: ( arg3: boolean ) => number; let res___4: ( arg4: number) => number; let res12__: (arg1: number, arg2: string ) => number; let res1_3_: (arg1: number, arg3: boolean ) => number; let res1__4: (arg1: number, arg4: number) => number; let res_23_: ( arg2: string, arg3: boolean ) => number; let res_2_4: ( arg2: string, arg4: number) => number; let res__34: ( arg3: boolean, arg4: number) => number; let res123_: (arg1: number, arg2: string, arg3: boolean ) => number; let res12_4: (arg1: number, arg2: string, arg4: number) => number; let res1_34: (arg1: number, arg3: boolean, arg4: number) => number; let res_234: ( arg2: string, arg3: boolean, arg4: number) => number; let res1234: (arg1: number, arg2: string, arg3: boolean, arg4: number) => number; // // _.partial // // with arity 0 function res____ = _.partial(func0); // with arity 1 function res____ = _.partial(func1, 42 ); res1___ = _.partial(func1 ); // with arity 2 function res12__ = _.partial(func2 ); res_2__ = _.partial(func2, 42 ); res1___ = _.partial(func2, _, "foo"); res____ = _.partial(func2, 42, "foo"); // with arity 3 function res123_ = _.partial(func3 ); res_23_ = _.partial(func3, 42 ); res1_3_ = _.partial(func3, _, "foo" ); res__3_ = _.partial(func3, 42, "foo" ); res12__ = _.partial(func3, _, _, true); res_2__ = _.partial(func3, 42, _, true); res1___ = _.partial(func3, _, "foo", true); res____ = _.partial(func3, 42, "foo", true); // with arity 4 function res1234 = _.partial(func4 ); res_234 = _.partial(func4, 42 ); res1_34 = _.partial(func4, _, "foo" ); res__34 = _.partial(func4, 42, "foo" ); res12_4 = _.partial(func4, _, _, true ); res_2_4 = _.partial(func4, 42, _, true ); res1__4 = _.partial(func4, _, "foo", true ); res___4 = _.partial(func4, 42, "foo", true ); res123_ = _.partial(func4, _, _, _, 100); res_23_ = _.partial(func4, 42, _, _, 100); res1_3_ = _.partial(func4, _, "foo", _, 100); res__3_ = _.partial(func4, 42, "foo", _, 100); res12__ = _.partial(func4, _, _, true, 100); res_2__ = _.partial(func4, 42, _, true, 100); res1___ = _.partial(func4, _, "foo", true, 100); res____ = _.partial(func4, 42, "foo", true, 100); // // _.partialRight // // with arity 0 function res____ = _.partialRight(func0); // with arity 1 function res____ = _.partialRight(func1, 42 ); res1___ = _.partialRight(func1 ); // with arity 2 function res12__ = _.partialRight(func2 ); res_2__ = _.partialRight(func2, 42, _); res1___ = _.partialRight(func2, "foo"); res____ = _.partialRight(func2, 42, "foo"); // with arity 3 function res123_ = _.partialRight(func3 ); res_23_ = _.partialRight(func3, 42, _, _); res1_3_ = _.partialRight(func3, "foo", _); res__3_ = _.partialRight(func3, 42, "foo", _); res12__ = _.partialRight(func3, true); res_2__ = _.partialRight(func3, 42, _, true); res1___ = _.partialRight(func3, "foo", true); res____ = _.partialRight(func3, 42, "foo", true); // with arity 4 function res1234 = _.partialRight(func4 ); res_234 = _.partialRight(func4, 42, _, _, _); res1_34 = _.partialRight(func4, "foo", _, _); res__34 = _.partialRight(func4, 42, "foo", _, _); res12_4 = _.partialRight(func4, true, _); res_2_4 = _.partialRight(func4, 42, _, true, _); res1__4 = _.partialRight(func4, "foo", true, _); res___4 = _.partialRight(func4, 42, "foo", true, _); res123_ = _.partialRight(func4, 100); res_23_ = _.partialRight(func4, 42, _, _, 100); res1_3_ = _.partialRight(func4, "foo", _, 100); res__3_ = _.partialRight(func4, 42, "foo", _, 100); res12__ = _.partialRight(func4, true, 100); res_2__ = _.partialRight(func4, 42, _, true, 100); res1___ = _.partialRight(func4, "foo", true, 100); res____ = _.partialRight(func4, 42, "foo", true, 100); }