{"id":22828638,"url":"https://github.com/busterc/pickapart","last_synced_at":"2025-03-31T01:17:39.339Z","repository":{"id":57323845,"uuid":"149323740","full_name":"busterc/pickapart","owner":"busterc","description":":monkey::bread: deep immutable destructuring with omit","archived":false,"fork":false,"pushed_at":"2018-09-18T17:09:47.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T11:31:52.684Z","etag":null,"topics":["destructuring","immutable","omit"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/busterc.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":"2018-09-18T17:02:49.000Z","updated_at":"2023-09-08T17:45:12.000Z","dependencies_parsed_at":"2022-09-18T20:51:36.273Z","dependency_job_id":null,"html_url":"https://github.com/busterc/pickapart","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpickapart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpickapart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpickapart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busterc%2Fpickapart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/busterc","download_url":"https://codeload.github.com/busterc/pickapart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246399803,"owners_count":20770909,"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":["destructuring","immutable","omit"],"created_at":"2024-12-12T19:11:12.424Z","updated_at":"2025-03-31T01:17:39.316Z","avatar_url":"https://github.com/busterc.png","language":"JavaScript","readme":"# pickapart [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]\n\n\u003e deep immutable destructuring with omit\n\n- If your app is already using `Lodash`, then just [use the `lodash-pickapart` mixin](https://github.com/busterc/lodash-pickapart).\n\n## Installation\n\n```sh\n$ npm install --save pickapart\n```\n\n## Usage\n\n```js\nconst pickapart = require('pickapart');\n\n// pickapart(paths, source)\n// * paths: String|Array (optional, if source is an Array)\n// * source: Object|Array\n\nconst payload = { name: 'abc', meta: { token: 123, easy: true } };\n\nconst [token, data] = pickapart('meta.token', payload);\nconsole.log('=\u003e ', payload);\n// =\u003e { name: 'abc', meta: { token: 123, easy: true }}\nconsole.log('=\u003e ', token);\n// =\u003e 123\nconsole.log('=\u003e ', data);\n// =\u003e { name: 'abc', meta: { easy: true }}\n\nconst [is, ez] = pickapart(['name', 'meta.easy'], payload);\nconsole.log('=\u003e ', is);\n// =\u003e 'abc'\nconsole.log('=\u003e ', ez);\n// =\u003e true\n\nconst flavors = ['chocolate', 'vanilla', 'strawberry'];\n\nconst [plain, others] = pickapart('[1]', flavors);\nconsole.log('=\u003e ', plain);\n// =\u003e 'vanilla'\nconsole.log('=\u003e ', others);\n// =\u003e [ 'chocolate', 'strawberry' ]\n\nconst [choco, notChoco] = pickapart(flavors);\n\nconsole.log('=\u003e ', choco);\n// =\u003e 'chocolate'\nconsole.log('=\u003e ', notChoco);\n// =\u003e [ 'vanilla', 'strawberry' ]\n```\n\n## License\n\nISC © [Buster Collings]()\n\n[npm-image]: https://badge.fury.io/js/pickapart.svg\n[npm-url]: https://npmjs.org/package/pickapart\n[travis-image]: https://travis-ci.org/busterc/pickapart.svg?branch=master\n[travis-url]: https://travis-ci.org/busterc/pickapart\n[daviddm-image]: https://david-dm.org/busterc/pickapart.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/busterc/pickapart\n[coveralls-image]: https://coveralls.io/repos/busterc/pickapart/badge.svg\n[coveralls-url]: https://coveralls.io/r/busterc/pickapart\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fpickapart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusterc%2Fpickapart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusterc%2Fpickapart/lists"}