The standalone lodash.noop package as a vendorable file. Useful when you want a named no-op helper without adding a dependency.
Why copy this?
This page ships the published lodash.noop file in both raw and normalized forms. The value is to preserve a familiar tiny helper locally when existing code already expects it.
Native alternative: An empty arrow function is trivial to write, but vendoring the known helper can still be useful when replacing an existing dependency.
Note: Raw and normalized views are both available. Use normalized when you want an ESM and TypeScript-friendly file, and raw when you want the original published package shape.
This copy is your responsibility once you adopt it. It does not
automatically receive upstream bug fixes or security updates.
Snippet
Copy-first distribution
Project-specific, rule-based variant for easier Node.js and Bun copy-paste use. Not an official upstream distribution.
Keeps the published package shape as-is.
Normalized
ESM / TS / normalized
Runtime: node, bun
/**
* Derived from [email protected]
* Rule-based normalized variant generated by this repository.
* Preserve the upstream license and attribution notices when copying this file.
*/
/**
* Derived from [email protected]
* Rule-based normalized variant generated by this repository.
* See THIRD_PARTY_NOTICES.md for upstream license and attribution details.
*/
/**
* lodash 3.0.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize include="noop" exports="npm" -o ./foo`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
/**
* A no-operation function that returns `undefined` regardless of the
* arguments it receives.
*
* @static
* @memberOf _
* @category Util
* @example
*
* var object = { 'user': 'fred' };
*
* _.noop(object) === undefined;
* // => true
*/
function noop() {
// No operation performed.
}
export default noop;
Variant note: Rule-based normalization for modern TS projects. The goal is easier import and build compatibility, not changed behavior.