diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index a9e955617..b4b8c38d7 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3739,17 +3739,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: { @@ -4462,6 +4451,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 128a07edf..748f94e08 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10173,6 +10173,7 @@ declare module _ { interface LoDashStatic { /** * A no-operation function that returns undefined regardless of the arguments it receives. + * * @return undefined */ noop(...args: any[]): void; @@ -10185,6 +10186,13 @@ declare module _ { noop(...args: any[]): void; } + interface LoDashExplicitWrapperBase { + /** + * @see _.noop + */ + noop(...args: any[]): _.LoDashExplicitWrapper; + } + //_.property interface LoDashStatic { /**