Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
createAssigner
✓ const createAssigner = require('lodash._createassigner');
✗ import { createAssigner } from 'lodash._createassigner';
This module is a CommonJS export from the Lodash v3 era and is not directly compatible with ES Modules (ESM). It is an internal Lodash function and not part of the public API; direct usage is discouraged.
Demonstrates the internal mechanism of `lodash._createassigner` by using it to construct a basic object assignment function, similar to how Lodash itself creates `_.assign`. It highlights the module's role as a higher-order function that processes a base assignment logic into a fully-fledged assignment utility.
const createAssigner = require('lodash._createassigner');
// lodash._createassigner exports a higher-order function that generates
// specialized assignment functions. This example demonstrates how it
// might be used internally by Lodash to create a simple assignment utility.
// In modern Lodash (v4+), you would typically use `_.assign` or `_.assignIn` directly.
// This is a simplified 'base' function that handles the core property copying logic.
// The `createAssigner` function takes this as an argument.
const baseAssign = function(object, source) {
if (object == null || source == null) return object;
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
object[key] = source[key];
}
}
return object;
};
// Use createAssigner to get an actual assignment function.
// The parameters to createAssigner (e.g., handling defaults, customizers)
// are complex and reflect internal Lodash logic.
// For a basic 'assign' equivalent, we pass our base function.
const assignFunction = createAssigner(baseAssign);
const target = { a: 1 };
const source1 = { b: 2 };
const source2 = { c: 3 };
// The generated function behaves like Lodash's _.assign, taking multiple source objects.
const result = assignFunction(target, source1, source2);
console.log('Initial target:', { a: 1 });
console.log('Source 1:', source1);
console.log('Source 2:', source2);
console.log('Result of internal assignment:', result); // Expected: { a: 1, b: 2, c: 3 }
// For comparison, modern public API usage would be:
// import { assign } from 'lodash';
// const modernResult = assign({ a: 1 }, { b: 2 }, { c: 3 });
// console.log('Modern Lodash assign result:', modernResult);
Debug
Known issues
breakingThis package is frozen at version 3.1.1 and corresponds to the Lodash v3 major release. It is not compatible with the internal structures or assumptions of Lodash v4.0.0 and subsequent versions, which introduced significant breaking changes. Relying on this package with a Lodash v4+ installation is likely to cause runtime errors or unexpected behavior.fixMigrate to using the public API of the main `lodash` package (v4.x) or `lodash-es` for assignment functions like `_.assign` or `_.assignIn`. Avoid direct usage of internal modules like `lodash._createassigner`.
affects: >=4.0.0 (of main lodash)
gotchaThis module is an internal implementation detail of Lodash, not part of its public API. Direct usage is strongly discouraged as its behavior, API signature, or even its existence can change without notice across Lodash major, minor, or even patch versions. Such usage can lead to fragile code that breaks unpredictably.fixAlways use the public API functions provided by the main `lodash` or `lodash-es` packages (e.g., `_.assign`, `_.assignIn`). These functions are stable and well-documented.
affects: >=3.1.1
breakingAs an older, internal module from the Lodash v3 era, `lodash._createassigner` does not receive direct security patches. Modern Lodash (v4.18.0+) has addressed critical prototype pollution vulnerabilities (GHSA-f23m-r3pf-42rh) in functions like `_.unset` and `_.omit` which, while not directly related to `createAssigner`, highlight the risks of using outdated internal modules from a security perspective.fixEnsure your project exclusively uses the latest versions of the official `lodash` or `lodash-es` packages to benefit from all security fixes and ongoing maintenance.
affects: 3.x.x
gotchaThis package is exported as a CommonJS module (`require`). It is not designed for direct import using ES module syntax (`import`) in modern JavaScript environments without a build step (like webpack or Rollup) that can transpile CommonJS modules. Attempting direct ESM import will result in runtime errors.fixIf you must use this specific internal module (which is not recommended), ensure your environment supports CommonJS `require()` syntax. For modern module usage, rely on `lodash` or `lodash-es` and their ESM-compatible exports.
affects: >=3.1.1
Errors
Common errors & fixes
TypeError: createAssigner is not a function
Attempting to call `createAssigner` directly as an assignment function, or importing it incorrectly in an ESM-only context.
fixEnsure you are using `require('lodash._createassigner')` in a CommonJS environment. Remember that `createAssigner` is a higher-order function that *returns* an assigner function, it doesn't perform assignment itself directly. Error: Cannot find module 'lodash._createassigner'
The package might not be explicitly installed, or the module resolver cannot find it.
fixRun `npm install lodash._createassigner` to ensure the package is available. Also verify that your module resolution paths are correctly configured, especially in non-standard environments.
ReferenceError: SomeInternalLodashHelper is not defined
This internal module might rely on other Lodash internal helpers that are not globally available or correctly resolved when `lodash._createassigner` is used in isolation outside the full Lodash build context.
fixThis error strongly indicates misuse of an internal Lodash component. The recommended fix is to stop using `lodash._createassigner` and instead use the official, stable `_.assign` or `_.assignIn` functions from the main `lodash` package.
Audit
Dependencies
No dependency data recorded yet.