A utility function to create a deep copy of a JSON object.
You can install the package using npm:
npm install copy-json
In your JavaScript file, import the copyJSON
function and use it to create a deep copy of a JSON object:
import copyJSON from 'copy-json';
const originalObj = { name: 'John', age: 25 };
const copiedObj = copyJSON(originalObj);
console.log(originalObj); // { name: 'John', age: 25 }
console.log(copiedObj); // { name: 'John', age: 25 }
console.log(originalObj === copiedObj); // false (they are separate objects)
Creates a deep copy of a JSON object.
jsonObj
: The JSON object to be copied.
Returns a deep copy of the input JSON object.
This package is licensed under the MIT License. See the LICENSE file for more information.
Feel free to customize the README file based on your specific needs and additional information about the package. Include any relevant details about the function, usage examples, configuration options, or any other information that might be helpful for users of your package.