import { Meta, Source } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/functional-basic/Functions/copyObject - Copy an object'/>

# `copyObject`

Creates a deep copy of an object for independent data management. The goal of the method is to obtain a completely separate instance of the data to prevent unintended mutations in the original object.

**Parameters:**
- `value: T` — The object or array to be copied.

**Returns:**
`T` — A new copy of the object.

## Examples

<Source
  language='typescript'
  code={`
import { copyObject } from '@dxtmisha/functional-basic'

const original = { 
  name: 'John', 
  age: 30,
  details: { role: 'admin' }
}

const copy = copyObject(original)
// copy is a completely new object for independent management
  `}
/>
