{"id":25899044,"url":"https://github.com/terran-source/dart-extend","last_synced_at":"2026-05-08T03:39:03.844Z","repository":{"id":56828579,"uuid":"396802992","full_name":"Terran-Source/dart-extend","owner":"Terran-Source","description":"A Dart port of classic extend() method from jQuery.  Empower `Map` to be `extend()`-ed","archived":false,"fork":false,"pushed_at":"2021-09-14T10:06:37.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-31T21:36:19.778Z","etag":null,"topics":["dart","dart-platform","flutter"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/extend","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Terran-Source.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-16T13:18:04.000Z","updated_at":"2021-08-17T13:59:49.000Z","dependencies_parsed_at":"2022-08-26T14:10:39.976Z","dependency_job_id":null,"html_url":"https://github.com/Terran-Source/dart-extend","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Terran-Source%2Fdart-extend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Terran-Source%2Fdart-extend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Terran-Source%2Fdart-extend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Terran-Source%2Fdart-extend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Terran-Source","download_url":"https://codeload.github.com/Terran-Source/dart-extend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241592618,"owners_count":19987396,"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":["dart","dart-platform","flutter"],"created_at":"2025-03-03T01:19:51.007Z","updated_at":"2025-10-30T14:51:25.235Z","avatar_url":"https://github.com/Terran-Source.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# extend [![Pub version](https://img.shields.io/pub/v/extend.svg?style=plastic)](https://pub.dev/packages/extend) [![GitHub](https://img.shields.io/github/license/Terran-Source/dart-extend?logo=github\u0026style=plastic)](LICENSE)\n\nA Dart port of classic `extend()` method from jQuery. It `extend` an existing Mutable Map with another `source`. It can be extended by multiple additional `sources` in a sequence.\n\n***Beware***: the original Map will be modified and will be returned.\n\nExample:\n```Dart\n// Don't use `const` or `final`. It'll make the Map `Immutable`\nvar baseObj = {\n  'dummy': 'x',\n  'complex': {\n    'subKey': 'subValue',\n    'subComplex': {\n      'deepKey': 'deepValue',\n    },\n    'subUndefined': null\n  },\n  'baseUndefined': null\n};\n\nfinal result = baseObj.extend({\n  'complex': {\n    'subKey': 'subValueOther',\n    'subComplex': {'deepNewKey': 'deepNewValue'}\n  },\n  'newKey': 'newValue'\n});\n// beware, the original object is also changed\nprint(baseObj);\n// Hence, you may discard using result\nprint(result);\n// in case, if you have one Immutable Map or don't want to change the\n// original Map, try to extend an empty Map\nfinal result = {}.extend(baseObj, [\n  {\n    'complex': {\n      'subKey': 'subValueOther',\n      'subComplex': {'deepNewKey': 'deepNewValue'}\n    },\n    'newKey': 'newValue'\n  }\n]);\n\nprint(result);\n```\nOutput:\n```Json\n{\n  \"dummy\": \"x\",\n  \"complex\": {\n    \"subKey\": \"subValueOther\", // 👈 is extended\n    \"subComplex\": {\n      \"deepKey\": \"deepValue\", // 👈 remains unchanged\n      \"deepNewKey\": \"deepNewValue\"  // 👈 is added\n    },\n    \"subUndefined\": null\n  },\n  \"baseUndefined\": null,\n  \"newKey\": \"newValue\"  // 👈 is added\n}\n```\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/Terran-Source/dart-extend/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterran-source%2Fdart-extend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterran-source%2Fdart-extend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterran-source%2Fdart-extend/lists"}