{"id":23053498,"url":"https://github.com/component/to-function","last_synced_at":"2025-08-30T07:04:26.624Z","repository":{"id":4740691,"uuid":"5890034","full_name":"component/to-function","owner":"component","description":"Convert property access strings to a function (\"user.name.first\" etc)","archived":false,"fork":false,"pushed_at":"2015-03-12T01:25:50.000Z","size":311,"stargazers_count":65,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-23T10:44:30.715Z","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/component.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-20T17:12:53.000Z","updated_at":"2025-02-14T15:50:43.000Z","dependencies_parsed_at":"2022-08-30T09:10:34.929Z","dependency_job_id":null,"html_url":"https://github.com/component/to-function","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/component/to-function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fto-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fto-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fto-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fto-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/component","download_url":"https://codeload.github.com/component/to-function/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/component%2Fto-function/sbom","scorecard":{"id":301474,"data":{"date":"2025-08-11","repo":{"name":"github.com/component/to-function","commit":"cb4af4f23511369ae435b81cec368226c8b897c7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 2/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T20:44:47.391Z","repository_id":4740691,"created_at":"2025-08-17T20:44:47.391Z","updated_at":"2025-08-17T20:44:47.391Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272815839,"owners_count":24997662,"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-08-30T02:00:09.474Z","response_time":77,"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":[],"created_at":"2024-12-16T00:18:24.553Z","updated_at":"2025-08-30T07:04:26.602Z","avatar_url":"https://github.com/component.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# to-function\n\n  Convert property access strings into functions\n\n## Installation\n\n    $ component install component/to-function\n\n## Examples\n\n```js\nvar toFunction = require('to-function');\nvar fn = toFunction('name.first');\nvar user = { name: { first: 'Tobi' }};\nfn(user);\n// =\u003e \"Tobi\"\n```\n\n### Dot access\n\n```js\n\nvar _ = require('..');\n\nvar users = [\n  { name: { first: 'Tobi' }},\n  { name: { first: 'Loki' }},\n  { name: { first: 'Jane' }},\n  { name: { first: 'Manny' }}\n];\n\nvar short = users.map(_('name.first'));\nconsole.log(short);\n// =\u003e [ 'Tobi', 'Loki', 'Jane', 'Manny' ]\n```\n\n### Equality\n\n```js\nvar _ = require('..');\n\nvar tobi = { name: { first: 'Tobi' }, age: 2 };\nvar loki = { name: { first: 'Loki' }, age: 2 };\nvar jane = { name: { first: 'Jane' }, age: 6 };\n\nvar users = [tobi, loki, jane];\n\nvar user = users.filter(_(loki)).pop();\nconsole.log(user);\n// =\u003e { name: { first: 'Loki' }, age: 2 }\n```\n\n### Expressions\n\n```js\nvar _ = require('..');\n\nvar users = [\n  { name: { first: 'Tobi' }, age: 2 },\n  { name: { first: 'Loki' }, age: 2 },\n  { name: { first: 'Jane' }, age: 6 }\n];\n\nvar oldPets = users.filter(_('age \u003e 2 \u0026\u0026 age \u003c 10'));\nconsole.log(oldPets);\n// =\u003e [ { name: { first: 'Jane' }, age: 6 } ]\n```\n\n### Regular expressions\n\n```js\nvar _ = require('..');\n\nvar users = [\n  'Tobi',\n  'Loki',\n  'Jane'\n];\n\nvar t = users.filter(_(/^T/));\n\nconsole.log(t);\n// =\u003e [ 'Tobi' ]\n```\n\n### Nesting\n\n```js\nvar _ = require('..');\n\nvar users = [\n  { name: { first: 'Tobi', last: 'Ferret' }, age: 2 },\n  { name: { first: 'Loki', last: 'Ferret' }, age: 2 },\n  { name: { first: 'Luna', last: 'Cat' }, age: 2 },\n  { name: { first: 'Manny', last: 'Cat' }, age: 3 }\n];\n\n// single-key\n\nvar query = _({\n  name: {\n    last: 'Cat'\n  }\n});\n\nconsole.log(users.filter(query));\n// =\u003e [ { name: { first: 'Luna', last: 'Cat' }, age: 2 },\n//      { name: { first: 'Manny', last: 'Cat' }, age: 3 } ]\n\n// multi-key\n\nvar query = _({\n  name: {\n    first: /^L/,\n    last: 'Cat'\n  }\n});\n\nconsole.log(users.filter(query));\n// =\u003e [ { name: { first: 'Luna', last: 'Cat' }, age: 2 } ]\n\n// multi-level\n\nvar query = _({\n  name: { last: 'Cat' },\n  age: 3\n});\n\nconsole.log(users.filter(query));\n// =\u003e [ { name: { first: 'Manny', last: 'Cat' }, age: 3 } ]\n```\n\n## License\n\n  MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fto-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomponent%2Fto-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomponent%2Fto-function/lists"}