diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index f097e358b..309c64a5a 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -5114,57 +5114,9 @@ result = _.property(['a', 'b'])(testProperty result = (_('a.b').property().value())(testPropertyObject); result = (_(['a', 'b']).property().value())(testPropertyObject); -// _.propertyOf -module 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 -result = _.range(10); -result = _.range(1, 11); -result = _.range(0, 30, 5); -result = _(10).range().value(); -result = _(1).range(11).value(); -result = _(0).range(30, 5).value(); - -class Mage { - public castSpell(n: number) { - return n; - } - - public cast(n: number) { - return n; - } -} - -/********* -* String -*********/ +/********** + * String * + **********/ // _.camelCase module TestCamelCase { @@ -6118,6 +6070,63 @@ module TestNoop { } } +// _.propertyOf +module 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 +module 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); + } +} + // _.runInContext { let result: typeof _; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index a7a81bd95..878df08ed 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -11668,6 +11668,7 @@ declare module _ { * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length * range is created unless a negative step is specified. + * * @param start The start of the range. * @param end The end of the range. * @param step The value to increment or decrement by. @@ -11676,14 +11677,16 @@ declare module _ { range( start: number, end: number, - step?: number): number[]; + step?: number + ): number[]; /** * @see _.range */ range( end: number, - step?: number): number[]; + step?: number + ): number[]; } interface LoDashImplicitWrapper { @@ -11692,7 +11695,18 @@ declare module _ { */ range( end?: number, - step?: number): LoDashImplicitArrayWrapper; + step?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashExplicitArrayWrapper; } //_.runInContext