From 52748a3a2a4738497f2cced0b30dcd7f5edcbb21 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 22 Oct 2015 20:58:22 +0500 Subject: [PATCH] lodash: signatures of the method _.ceil changed --- lodash/lodash-tests.ts | 34 +++++++++++++++++------------- lodash/lodash.d.ts | 47 ++++++++++++++++++++++++++---------------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index c083edd4c..0fa21aa46 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -1943,20 +1943,6 @@ module TestMap { } } -// _.ceil -result = _.ceil(4.006); -// → 5 -result = _.ceil(6.004, 2); -// → 6.01 -result = _.ceil(6040, -2); -// → 6100 -result = _(4.006).ceil(); -// → 5 -result = _(6.004).ceil(2); -// → 6.01 -result = _(6040).ceil(-2); -// → 6100 - // _.floor result = _.floor(4.006); // → 4 @@ -2863,6 +2849,26 @@ module TestToPlainObject { result = _.add(1, 1); result = _(1).add(1); +// _.ceil +module 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); + } +} + // _.max module TestMax { let array: number[]; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 881124328..a0077934f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -4537,24 +4537,6 @@ declare module _ { ): LoDashImplicitArrayWrapper; } - //_.ceil - interface LoDashStatic { - /** - * Calculates n rounded up to precision. - * @param n The number to round up. - * @param precision The precision to round up to. - * @return Returns the rounded up number. - */ - ceil(n: number, precision?: number): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): number; - } - //_.floor interface LoDashStatic { /** @@ -7411,6 +7393,35 @@ declare module _ { add(addend: number): number; } + //_.ceil + interface LoDashStatic { + /** + * Calculates n rounded up to precision. + * + * @param n The number to round up. + * @param precision The precision to round up to. + * @return Returns the rounded up number. + */ + ceil( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): LoDashExplicitWrapper; + } + //_.max interface LoDashStatic { /**