From f7ae294142f1677f910a571da283868080c95b54 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Fri, 6 Nov 2015 03:54:04 +0500 Subject: [PATCH] lodash: signatures of the method _.range have been changed --- lodash/lodash-tests.ts | 111 ++++++++++++++++++++++------------------- lodash/lodash.d.ts | 20 ++++++-- 2 files changed, 77 insertions(+), 54 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 876547fd6..d40e2dd86 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4778,57 +4778,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 { @@ -5754,6 +5706,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 359cc0fb9..56cdf8af3 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -11455,6 +11455,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. @@ -11463,14 +11464,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 { @@ -11479,7 +11482,18 @@ declare module _ { */ range( end?: number, - step?: number): LoDashImplicitArrayWrapper; + step?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashExplicitArrayWrapper; } //_.runInContext