{"id":15792767,"url":"https://github.com/nfour/lutils-clone","last_synced_at":"2025-03-31T18:51:21.213Z","repository":{"id":143888142,"uuid":"52188734","full_name":"nfour/lutils-clone","owner":"nfour","description":"Reliably and recursively clone javascript objects","archived":false,"fork":false,"pushed_at":"2017-01-10T10:57:18.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-26T18:46:48.674Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nfour.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-21T03:25:02.000Z","updated_at":"2016-02-21T05:58:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd105f3c-b13a-454b-99bc-b8a2927d9666","html_url":"https://github.com/nfour/lutils-clone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Flutils-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Flutils-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Flutils-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Flutils-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nfour","download_url":"https://codeload.github.com/nfour/lutils-clone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523897,"owners_count":20791444,"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-04T23:04:03.458Z","updated_at":"2025-03-31T18:51:21.189Z","avatar_url":"https://github.com/nfour.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clone `lutils-clone`\nReliably and recursively clone javascript objects\n\n`npm install lutils-clone`\n\n## API\n\n### `clone([mixed], [[options]])`\nClones an object, recursively.\n\n\n```js\nimport clone from 'lutils-clone'\n\nconst test = new class Test {}\n\nconst obj = {\n    a  : { b: 2 },\n    fn : function() {}\n    test,\n}\n\nconst newObj = clone(obj)\n\nnewObj.a.b = 5\n\nobj.a.b               // 2\nnewObj.a === obj.a    // false\nnewObj.test === test  // false\nnewObj.test.__proto__ === test.__proto__ // true\nnewObj.fn === obj.fn  // true\n```\n\n## Advanced usage\n\n### Options\n```js\n{\n    // Decremented with each recursion for each nested object, halting the clone at 0\n    // A halted clone will preserve references to any remaining values\n    depth: 8,\n\n    // Determines whether recursing will occur. When this type matches, it will be iterated over.\n    types: { object: true, array: true }\n    types: [ \"object\", \"array\" ] // Can also be an array of type strings\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfour%2Flutils-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnfour%2Flutils-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfour%2Flutils-clone/lists"}