diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3a1c51f18..6a0b68075 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -149,13 +149,13 @@ result = <_.Dictionary>_({ a: 1, b: 2}).mapValues(function(num: number) // * Arrays * // *************/ result = _.chunk([1, '2', '3', false]); -result = <_.LoDashArrayWrapper>_([1, '2', '3', false]).chunk(); +result = <_.LoDashArrayWrapper>_([1, '2', '3', false]).chunk(); result = _.chunk([1, '2', '3', false], 2); -result = <_.LoDashArrayWrapper>_([1, '2', '3', false]).chunk(2); +result = <_.LoDashArrayWrapper>_([1, '2', '3', false]).chunk(2); result = _.chunk([1, 2, 3, 4]); -result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).chunk(); +result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).chunk(); result = _.chunk([1, 2, 3, 4], 2); -result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).chunk(2); +result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).chunk(2); result = _.compact([0, 1, false, 2, '', 3]); result = <_.LoDashArrayWrapper>_([0, 1, false, 2, '', 3]).compact(); @@ -622,7 +622,9 @@ result = <_.LoDashArrayWrapper>_([1, 2, 3]).shuffle(); result = <_.LoDashArrayWrapper<_.Dictionary>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).shuffle(); result = _.size([1, 2]); +result = _([1, 2]).size(); result = _.size({ 'one': 1, 'two': 2, 'three': 3 }); +result = _({ 'one': 1, 'two': 2, 'three': 3 }).size(); result = _.size('curly'); result = _.some([null, 0, 'yes', false], Boolean); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index fcf468577..6a839596d 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -279,7 +279,7 @@ declare module _ { /** * @see _.chunk **/ - chunk(size?: number): LoDashArrayWrapper; + chunk(size?: number): LoDashArrayWrapper; } //_.compact @@ -4526,6 +4526,20 @@ declare module _ { size(aString: string): number; } + interface LoDashArrayWrapper { + /** + * @see _.size + **/ + size(): number; + } + + interface LoDashObjectWrapper { + /** + * @see _.size + **/ + size(): number; + } + //_.some interface LoDashStatic { /**