{"id":16400549,"url":"https://github.com/evanpipta/object-clone","last_synced_at":"2025-02-23T14:15:34.094Z","repository":{"id":57312555,"uuid":"47723780","full_name":"evanpipta/object-clone","owner":"evanpipta","description":"npm package for cloning js objects","archived":false,"fork":false,"pushed_at":"2016-06-26T22:02:10.000Z","size":497,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T10:36:45.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evanpipta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-09T22:45:34.000Z","updated_at":"2016-02-29T15:07:33.000Z","dependencies_parsed_at":"2022-09-06T19:41:11.200Z","dependency_job_id":null,"html_url":"https://github.com/evanpipta/object-clone","commit_stats":null,"previous_names":["747823/object-clone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanpipta%2Fobject-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanpipta%2Fobject-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanpipta%2Fobject-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanpipta%2Fobject-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanpipta","download_url":"https://codeload.github.com/evanpipta/object-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240324071,"owners_count":19783455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T05:27:58.589Z","updated_at":"2025-02-23T14:15:34.039Z","avatar_url":"https://github.com/evanpipta.png","language":"JavaScript","readme":"# object-clone\nobject-clone is a small package for cloning js objects\n\n### Introduction\nNormally when you assign an object to a new variable in Javascript, the original variable and the new variable will both point to the same object in memory. So for example:\n```\nvar x = { y: { z: 0 } };\nvar test = x;\ntest.y.z = 2;\n// x.y.z === 2\n```\n\nWe don't always want the above behavior, and sometimes it's very inconvenient. This package adds an Object.clone method which returns a totally new object, not a reference to the original.\n\n###Usage\n```\nrequire('object-clone');\n\nvar x = { y: { z: 0 } };\nvar test = Object.clone( x );\ntest.y.z = 2;\n// test.y.z === 2\n// x.y.z === 0\n```\n\n###Notes\n* Test cases have been added in version 1.0.0 so it should be relatively reliable now\n* Passing an object with circular references into Object.clone will now throw a TypeError instead of looping forever\n\n###Version Updates\n* 1.0.0: \n\t* Added fixed and random tests\n\t* Fixed a bug that would attempt to call a constructor for null values\n\t* Added error handling for circular referenes\n* 0.1.2: \n\t* Enabled strict mode and fixed a bug where the key variable in the for..in loop was put in the global scope\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanpipta%2Fobject-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanpipta%2Fobject-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanpipta%2Fobject-clone/lists"}