From f3eb4c978daab82553985859e417c1bc8cea77c5 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 28 Oct 2015 22:22:38 +0500 Subject: [PATCH] lodash: signatures of the method _.noop changed --- lodash/lodash-tests.ts | 39 ++++++++++++++++++++++++++++----------- lodash/lodash.d.ts | 8 ++++++++ 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..749a13963 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3687,17 +3687,6 @@ result = _(new TestValueIn()).valuesIn().value(); * Utility * ***********/ -// _.noop -result = _.noop(); -result = _.noop(1); -result = _.noop('a', 1); -result = _.noop(true, 'a', 1); -result = _('a').noop(true, 'a', 1); -result = _([1]).noop(true, 'a', 1); -result = _([]).noop(true, 'a', 1); -result = _({}).noop(true, 'a', 1); -result = _(any).noop(true, 'a', 1); - // _.property interface TestPropertyObject { a: { @@ -4398,6 +4387,34 @@ module TestMixin { result = _({}).noConflict(); } +// _.noop +module TestNoop { + { + let result: void; + + result = _.noop(); + result = _.noop(1); + result = _.noop('a', 1); + result = _.noop(true, 'a', 1); + + result = _('a').noop(true, 'a', 1); + result = _([1]).noop(true, 'a', 1); + result = _([]).noop(true, 'a', 1); + result = _({}).noop(true, 'a', 1); + result = _(any).noop(true, 'a', 1); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('a').chain().noop(true, 'a', 1); + result = _([1]).chain().noop(true, 'a', 1); + result = _([]).chain().noop(true, 'a', 1); + result = _({}).chain().noop(true, 'a', 1); + result = _(any).chain().noop(true, 'a', 1); + } +} + // _.runInContext { let result: typeof _; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e65..fe94fffc1 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10160,6 +10160,7 @@ declare module _ { interface LoDashStatic { /** * A no-operation function that returns undefined regardless of the arguments it receives. + * * @return undefined */ noop(...args: any[]): void; @@ -10172,6 +10173,13 @@ declare module _ { noop(...args: any[]): void; } + interface LoDashExplicitWrapperBase { + /** + * @see _.noop + */ + noop(...args: any[]): _.LoDashExplicitWrapper; + } + //_.property interface LoDashStatic { /**