{"library":"lodash._basecopy","title":"Lodash Internal BaseCopy","description":"lodash._basecopy is an internal Lodash module, specifically version 3.0.1, published over a decade ago in April 2015. It exposes the `baseCopy` function, which is a core utility used internally by Lodash for copying object properties. This package is part of the older Lodash v3 ecosystem, which predates the significant breaking changes and modularization introduced in Lodash v4. While Lodash itself (currently v4.18.1) is actively maintained with a regular release cadence addressing bugs and security, `lodash._basecopy` is effectively abandoned as a standalone, directly consumable package. Modern Lodash encourages direct function imports from `lodash` or `lodash-es` rather than using these older, internal micro-modules, many of which are slated for removal in Lodash v5.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install lodash._basecopy"],"cli":null},"imports":["const baseCopy = require('lodash._basecopy');","import { assign } from 'lodash';\n// Or for deep cloning:\nimport { cloneDeep } from 'lodash';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const baseCopy = require('lodash._basecopy');\n\nconst source = { a: 1, b: { c: 2 } };\nconst destination = {};\n\n// Using baseCopy to copy properties. Note: baseCopy is a low-level internal function\n// and doesn't handle deep cloning or complex scenarios by itself.\n// It typically expects a mutatable destination and source object.\nfunction customCopy(dest, src) {\n  baseCopy(src, dest);\n  return dest;\n}\n\nconst copiedObject = customCopy({}, source);\n\nconsole.log('Source:', source); // { a: 1, b: { c: 2 } }\nconsole.log('Copied:', copiedObject); // { a: 1, b: { c: 2 } }\nconsole.log('Are they the same object for key `b`?', copiedObject.b === source.b); // true (shallow copy)\n\n// Demonstrating direct Lodash v4+ equivalent for shallow copy\nconst _ = require('lodash');\nconst shallowCopyModern = _.assign({}, source);\nconsole.log('Modern Lodash assign (shallow):', shallowCopyModern);\nconsole.log('Are they the same object for key `b` (modern)?', shallowCopyModern.b === source.b); // true (shallow copy)\n\n// For deep copy, which baseCopy alone wouldn't provide:\nconst deepCopyModern = _.cloneDeep(source);\nconsole.log('Modern Lodash cloneDeep (deep):', deepCopyModern);\nconsole.log('Are they the same object for key `b` (deep)?', deepCopyModern.b === source.b); // false (deep copy)\n","lang":"javascript","description":"Demonstrates how to use the `lodash._basecopy` CommonJS module for shallow copying and compares it to modern Lodash public API equivalents for shallow and deep copies.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}