diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 03253f463..627dda565 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -506,6 +506,20 @@ result = _([1, 2, 3]).collect(function (num) { return num * 3; }).valu result = _({ 'one': 1, 'two': 2, 'three': 3 }).collect(function (num: number) { return num * 3; }).value(); result = _(stoogesAges).collect('name').value(); +// _.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 + result = _.max([4, 2, 8, 6]); result = _.max(stoogesAges, function (stooge) { return stooge.age; }); result = _.max(stoogesAges, 'age'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 0cbdd9f4f..7bc1df648 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -3554,6 +3554,24 @@ declare module _ { thisArg?: any): LoDashArrayWrapper; } + //_.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 LoDashWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): number; + } + //_.max interface LoDashStatic { /**