{"id":32305908,"url":"https://github.com/letyletylety/deepcopy","last_synced_at":"2025-10-23T06:58:06.351Z","repository":{"id":177408197,"uuid":"660336805","full_name":"letyletylety/deepcopy","owner":"letyletylety","description":"recursive deep copy for nested collections","archived":false,"fork":false,"pushed_at":"2023-12-06T07:19:21.000Z","size":368,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T06:57:49.062Z","etag":null,"topics":["collection","copy","dart","deep-copy","deepcopy","flutter","recursive-copy"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/deepcopy","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/letyletylety.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-29T19:27:36.000Z","updated_at":"2025-01-19T21:24:36.000Z","dependencies_parsed_at":"2023-12-12T15:06:08.275Z","dependency_job_id":"bd561e49-9e84-44a0-a26c-819d424e0f06","html_url":"https://github.com/letyletylety/deepcopy","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"7fe703ae76a65405f1057952da5bff94f59a7bb9"},"previous_names":["letyletylety/clone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/letyletylety/deepcopy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letyletylety%2Fdeepcopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letyletylety%2Fdeepcopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letyletylety%2Fdeepcopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letyletylety%2Fdeepcopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letyletylety","download_url":"https://codeload.github.com/letyletylety/deepcopy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letyletylety%2Fdeepcopy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280577135,"owners_count":26354073,"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","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["collection","copy","dart","deep-copy","deepcopy","flutter","recursive-copy"],"created_at":"2025-10-23T06:58:04.893Z","updated_at":"2025-10-23T06:58:06.343Z","avatar_url":"https://github.com/letyletylety.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deepcopy\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/letyletylety/deepcopy/main/logos/deepcopy_logo%404x.png\" height=\"256\" alt=\"deepcopy\"\nbackground-color='transparent'/\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003erecursive deep copy for nested collections\n\u003c/h2\u003e\n\n[![pub package](https://img.shields.io/pub/v/deepcopy.svg?label=deepcopy\u0026color=blue)](https://pub.dev/packages/deepcopy)\n\nThis plugin helps with recursive [deep copy](https://developer.mozilla.org/en-US/docs/Glossary/Deep_copy) for nested collections, such as [List](https://api.flutter.dev/flutter/dart-core/List-class.html), [Map](https://api.flutter.dev/flutter/dart-core/Map-class.html), [Set](https://api.flutter.dev/flutter/dart-core/Set-class.html), ensuring that the cloned object is independent and does not share references with the original object, so that the cloned and existing object do not affect each other.\n\n## Install\n\nAdd the following dependency to your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n    deepcopy: ^1.1.2\n```\n\n## Features\n\n- Deep copying of lists, maps, and sets with nested structures.\n- Easy to use by using extensions.\n- Measuring the benchmarks (vs. JSON, vs. FIC)\n\n## Usage\n\n```dart\n// import this\nimport 'package:deepcopy/deepcopy.dart';\n\n// clone it!\nList clonedList = originalList.deepcopy();\nMap clonedMap = originalMap.deepcopy();\nSet clonedSet = originalSet.deepcopy();\n```\n\nthat's it!\n\nIf you're interested in learning more, check out the\n[example usage](example/bin/example.dart)\n\n## Internal Implementation\n\nThe internal implementation is simple. I used the intuitive method of adding items one by one to a new `MutableList`.\n\nYou can check it out here :\n[implementation](lib/src/cloner.dart)\n\n- ### vs Json Decode/Encode ?\n\n    We may also implement deepcopy using `jsonEncode/jsonDecode`. However, there were performance benefits to just adding them to the `MutableList` one by one.\n\n- ### why not use [fast_immutable_collections (FIC)](https://pub.dev/packages/fast_immutable_collections) ?\n\n    When I first thought about creating this plugin, the first thing I thought of was FIC.\n    But unlike `IList\u003cint\u003e`, the benchmarks for `IList\u003cdynamic\u003e` were actually even worse.\n\nYou can check the benchmark result out here :\n[benchmark](test/benchmark/output/bench_test.txt)\n\nYou can also run your own benchmark code if you want.\n\n```bash\ncd test/benchmark\ndart benchmark.dart\n```\n\n## Todos\n\n- [x] add benchmarks for list\n- [ ] add benchmarks for set\n- [ ] add benchmarks for map\n\n## The story behind naming this plugin\n\nAt first I thought of names like \"deepcopy\" or \"clone\". I chose the shorter of the two, \"clone\". It didn't show up when I searched it in pub.dev. After implementing all the code, creating a logo, and writing the README,\nI got an unauthorized error trying to deploy version 1.0.\nIt wasn't until I typed \"\u003chttps://pub.dev/packages/clone\u003e\" into the address bar that I realized that the name had been taken six years earlier. I didn't realize that I might not be able to find the plugin on pub. I thought of \"deepcopy\" as the next best thing.\n\n## Contribute\n\nIf you have a better way, feel free to pull request it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletyletylety%2Fdeepcopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletyletylety%2Fdeepcopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletyletylety%2Fdeepcopy/lists"}