From 3e85fd136534ec18375247662f22535631b9c893 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Fri, 12 Feb 2016 20:03:18 +0500 Subject: [PATCH] lodash: changed _.identity --- lodash/lodash-3.10-tests.ts | 52 +++++++++++++++++++++++++++---------- lodash/lodash-3.10.d.ts | 22 ++++++++++++++++ lodash/lodash-tests.ts | 52 +++++++++++++++++++++++++++---------- lodash/lodash.d.ts | 22 ++++++++++++++++ 4 files changed, 122 insertions(+), 26 deletions(-) diff --git a/lodash/lodash-3.10-tests.ts b/lodash/lodash-3.10-tests.ts index c4048bb26..63a67aa8f 100644 --- a/lodash/lodash-3.10-tests.ts +++ b/lodash/lodash-3.10-tests.ts @@ -9763,19 +9763,45 @@ namespace TestConstant { } // _.identity -{ - let testIdentityValue: TResult; - let result: TResult; - result = _.identity(testIdentityValue); - result = _(testIdentityValue).identity(); -} -{ - let result: number; - result = _(42).identity(); -} -{ - let result: boolean[]; - result = _([]).identity(); +namespace TestIdentity { + { + let result: number; + + result = _.identity(42); + result = _(42).identity(); + } + + { + let result: number[]; + + result = _.identity([42]); + result = _([42]).identity(); + } + + { + let result: {a: number}; + + result = _.identity({a: 42}); + result = _({a: 42}).identity(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(42).chain().identity(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _([42]).chain().identity(); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: number}>; + + result = _({a: 42}).chain().identity(); + } } // _.iteratee diff --git a/lodash/lodash-3.10.d.ts b/lodash/lodash-3.10.d.ts index c673e0300..97c517458 100644 --- a/lodash/lodash-3.10.d.ts +++ b/lodash/lodash-3.10.d.ts @@ -14898,6 +14898,7 @@ declare module _ { interface LoDashStatic { /** * This method returns the first argument provided to it. + * * @param value Any value. * @return Returns value. */ @@ -14925,6 +14926,27 @@ declare module _ { identity(): T; } + interface LoDashExplicitWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitObjectWrapper; + } + //_.iteratee interface LoDashStatic { /** diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 0f739288a..9556720f7 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -10999,19 +10999,45 @@ namespace TestConstant { } // _.identity -{ - let testIdentityValue: TResult; - let result: TResult; - result = _.identity(testIdentityValue); - result = _(testIdentityValue).identity(); -} -{ - let result: number; - result = _(42).identity(); -} -{ - let result: boolean[]; - result = _([]).identity(); +namespace TestIdentity { + { + let result: number; + + result = _.identity(42); + result = _(42).identity(); + } + + { + let result: number[]; + + result = _.identity([42]); + result = _([42]).identity(); + } + + { + let result: {a: number}; + + result = _.identity({a: 42}); + result = _({a: 42}).identity(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(42).chain().identity(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _([42]).chain().identity(); + } + + { + let result: _.LoDashExplicitObjectWrapper<{a: number}>; + + result = _({a: 42}).chain().identity(); + } } // _.iteratee diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 86bd909de..c06b0bcb5 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -18056,6 +18056,7 @@ declare module _ { interface LoDashStatic { /** * This method returns the first argument provided to it. + * * @param value Any value. * @return Returns value. */ @@ -18083,6 +18084,27 @@ declare module _ { identity(): T; } + interface LoDashExplicitWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitObjectWrapper; + } + //_.iteratee interface LoDashStatic { /**