From f5e2c38ad7c42922bd9191c1e07a16ffb89f18a5 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 29 Jul 2015 10:13:34 +0500 Subject: [PATCH] added _.gt(), _.gte(), _.lt() and _.lte() methods --- lodash/lodash-tests.ts | 24 ++++++++++++++ lodash/lodash.d.ts | 72 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 877364ef0f60bb..08ca8c57f8f683 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -932,6 +932,30 @@ helloWrap2(); * Lang * ********/ +// _.gt +result = _.gt(1, 2); +result = _(1).gt(2); +result = _([]).gt(2); +result = _({}).gt(2); + +// _.gte +result = _.gte(1, 2); +result = _(1).gte(2); +result = _([]).gte(2); +result = _({}).gte(2); + +// _.lt +result = _.lt(1, 2); +result = _(1).lt(2); +result = _([]).lt(2); +result = _({}).lt(2); + +// _.lte +result = _.lte(1, 2); +result = _(1).lte(2); +result = _([]).lte(2); +result = _({}).lte(2); + // _.toPlainObject result = _.toPlainObject(); result = _.toPlainObject(true); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 7bbb65a54cc9ec..71ba61252901e2 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -5570,6 +5570,78 @@ declare module _ { * Lang * ********/ + //_.gt + interface LoDashStatic { + /** + * Checks if value is greater than other. + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than other, else false. + */ + gt(value: any, other: any): boolean; + } + + interface LoDashWrapperBase { + /** + * @see _.gt + */ + gt(other: any): boolean; + } + + //_.gte + interface LoDashStatic { + /** + * Checks if value is greater than or equal to other. + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than or equal to other, else false. + */ + gte(value: any, other: any): boolean; + } + + interface LoDashWrapperBase { + /** + * @see _.gte + */ + gte(other: any): boolean; + } + + //_.lt + interface LoDashStatic { + /** + * Checks if value is less than other. + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than other, else false. + */ + lt(value: any, other: any): boolean; + } + + interface LoDashWrapperBase { + /** + * @see _.lt + */ + lt(other: any): boolean; + } + + //_.lte + interface LoDashStatic { + /** + * Checks if value is less than or equal to other. + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than or equal to other, else false. + */ + lte(value: any, other: any): boolean; + } + + interface LoDashWrapperBase { + /** + * @see _.lte + */ + lte(other: any): boolean; + } + //_.toPlainObject interface LoDashStatic { /**