{"library":"lodash._createassigner","title":"Lodash Internal createAssigner Module","description":"lodash._createassigner is a low-level, internal utility module originating from the Lodash v3 ecosystem. Its primary function is to provide the core logic for object assignment operations, which are then used by public Lodash functions like `_.assign` and `_.assignIn`. This module is considered an internal implementation detail and is not intended for direct public consumption; its API is subject to change without notice and it may not be compatible with newer Lodash versions. The current stable version for this specific package is 3.1.1, corresponding to the Lodash v3 major release cycle. Modern Lodash (v4.x and newer) typically advocates for importing specific functions directly from the main `lodash` or `lodash-es` packages for improved tree-shaking and module resolution, rendering these older, granular internal modules largely obsolete. This package does not maintain an independent release cadence but is tied to the Lodash monorepo's overarching development.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install lodash._createassigner"],"cli":null},"imports":["const createAssigner = require('lodash._createassigner');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const createAssigner = require('lodash._createassigner');\n\n// lodash._createassigner exports a higher-order function that generates\n// specialized assignment functions. This example demonstrates how it\n// might be used internally by Lodash to create a simple assignment utility.\n// In modern Lodash (v4+), you would typically use `_.assign` or `_.assignIn` directly.\n\n// This is a simplified 'base' function that handles the core property copying logic.\n// The `createAssigner` function takes this as an argument.\nconst baseAssign = function(object, source) {\n  if (object == null || source == null) return object;\n  for (const key in source) {\n    if (Object.prototype.hasOwnProperty.call(source, key)) {\n      object[key] = source[key];\n    }\n  }\n  return object;\n};\n\n// Use createAssigner to get an actual assignment function.\n// The parameters to createAssigner (e.g., handling defaults, customizers)\n// are complex and reflect internal Lodash logic.\n// For a basic 'assign' equivalent, we pass our base function.\nconst assignFunction = createAssigner(baseAssign);\n\nconst target = { a: 1 };\nconst source1 = { b: 2 };\nconst source2 = { c: 3 };\n\n// The generated function behaves like Lodash's _.assign, taking multiple source objects.\nconst result = assignFunction(target, source1, source2);\n\nconsole.log('Initial target:', { a: 1 });\nconsole.log('Source 1:', source1);\nconsole.log('Source 2:', source2);\nconsole.log('Result of internal assignment:', result); // Expected: { a: 1, b: 2, c: 3 }\n\n// For comparison, modern public API usage would be:\n// import { assign } from 'lodash';\n// const modernResult = assign({ a: 1 }, { b: 2 }, { c: 3 });\n// console.log('Modern Lodash assign result:', modernResult);","lang":"javascript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}