{"id":16690574,"url":"https://github.com/jonkemp/pick-util","last_synced_at":"2025-04-10T00:51:05.906Z","repository":{"id":43044766,"uuid":"241518666","full_name":"jonkemp/pick-util","owner":"jonkemp","description":"Return a copy of the object only containing the whitelisted properties","archived":false,"fork":false,"pushed_at":"2025-02-01T21:42:12.000Z","size":318,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:51:00.894Z","etag":null,"topics":["object","pick","properties","util","utility"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/jonkemp.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":"2020-02-19T02:55:38.000Z","updated_at":"2025-02-01T21:42:16.000Z","dependencies_parsed_at":"2022-09-18T11:00:58.812Z","dependency_job_id":null,"html_url":"https://github.com/jonkemp/pick-util","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fpick-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fpick-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fpick-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fpick-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonkemp","download_url":"https://codeload.github.com/jonkemp/pick-util/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137997,"owners_count":21053775,"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":["object","pick","properties","util","utility"],"created_at":"2024-10-12T16:04:19.350Z","updated_at":"2025-04-10T00:51:05.886Z","avatar_url":"https://github.com/jonkemp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pick-util ![Build Status](https://github.com/jonkemp/pick-util/actions/workflows/main.yml/badge.svg?branch=master)\n\n\u003e Return a copy of the object only containing the whitelisted properties. Alternatively accepts a predicate indicating which keys to pick.\n\nInspired by `_.pick`. 😄\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/pick-util)\n\n```\n$ npm install pick-util\n```\n\nOr [unpkg](https://unpkg.com/pick-util/)\n\n```\n\u003cscript src=\"https://unpkg.com/pick-util@1.1.5/umd/index.js\" /\u003e\n```\n\nCheck out the unit tests on [CodePen](https://codepen.io/jonkemp/full/OJVXabQ).\n\n## Usage\n\n```js\nconst pick = require('pick-util');\n\npick({ 'a': 1, 'b': '2', 'c': 3 }, ['a', 'c']);\n//=\u003e { 'a': 1, 'c': 3 }\n\npick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age');\n//=\u003e { name: 'moe', age: 50 }\n\nconst isNumber = obj =\u003e toString.call(obj) === '[object Number]';\n\npick({ name: 'moe', age: 50, userid: 'moe1' }, (value) =\u003e isNumber(value));\n//=\u003e { age: 50 }\n```\n\n---\n| **Like us a lot?** Help others know why you like us! **Review this package on [pkgreview.dev](https://pkgreview.dev/npm/pick-util)** | ➡   | [![Review us on pkgreview.dev](https://i.ibb.co/McjVMfb/pkgreview-dev.jpg)](https://pkgreview.dev/npm/pick-util) |\n| ----------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------------------------------------------------------------------- |\n\n## API\n\n### pick(object, *keys)\n\n#### object\n\nType: `object`  \nDefault: `none`\n\nThe object to filter.\n\n#### keys\n\nType: `array` or comma separated list of `string` values or `function`  \nDefault: `none`\n\nKeys for the picked properties. Or a predicate indicating which keys to pick. \n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonkemp%2Fpick-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonkemp%2Fpick-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonkemp%2Fpick-util/lists"}