{"id":21018952,"url":"https://github.com/reactabular/table-resolver","last_synced_at":"2025-10-27T16:04:30.185Z","repository":{"id":65419325,"uuid":"74825392","full_name":"reactabular/table-resolver","owner":"reactabular","description":"Table resolution utilities (MIT)","archived":false,"fork":false,"pushed_at":"2025-05-18T18:58:50.000Z","size":51,"stargazers_count":3,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T07:52:41.774Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactabular.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-26T12:49:24.000Z","updated_at":"2025-05-18T18:58:54.000Z","dependencies_parsed_at":"2023-01-22T18:15:28.830Z","dependency_job_id":null,"html_url":"https://github.com/reactabular/table-resolver","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/reactabular/table-resolver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactabular%2Ftable-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactabular%2Ftable-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactabular%2Ftable-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactabular%2Ftable-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactabular","download_url":"https://codeload.github.com/reactabular/table-resolver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactabular%2Ftable-resolver/sbom","scorecard":{"id":765793,"data":{"date":"2025-08-11","repo":{"name":"github.com/reactabular/table-resolver","commit":"6f5abf50e19e801cdd23386f7c962eab4be68877"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"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":"Code-Review","score":2,"reason":"Found 5/20 approved changesets -- score normalized to 2","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":"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":"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":"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":"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":"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":"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":"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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 15 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-23T00:45:06.330Z","repository_id":65419325,"created_at":"2025-08-23T00:45:06.330Z","updated_at":"2025-08-23T00:45:06.330Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281295820,"owners_count":26476760,"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-27T02:00:05.855Z","response_time":61,"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-11-19T10:28:19.960Z","updated_at":"2025-10-27T16:04:30.180Z","avatar_url":"https://github.com/reactabular.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# table-resolver - Table resolution utilities\n\nSometimes your rows might come in a nested format or it might have a representation that maps to the underlying value. A name split to first and last parts is an example of the former. Country code to country mapping is an example of the latter.\n\n```javascript\nimport * as resolve from 'table-resolver';\n\n// Or you can cherry-pick\nimport { nested } from 'table-resolver';\nimport { nested as resolveNested } from 'table-resolver';\n```\n\n## API\n\nThe API consists of two parts: **row resolvers** and **column resolvers**. If you have complex data, use the former. Latter come in handy if you have a nested column definition that needs to be flattened so that it works with a component like Reactabular.\n\n## Row Resolvers\n\n`table-resolver` uses an iterator that accepts rows and then transforms it using a specific resolver method (or several, if they have been composed into one).\n\n### `resolve.resolve`\n\n**`({ columns: \u003ccolumns\u003e, method: \u003cresolver function\u003e, indexKey = '_index' }) =\u003e \u003crows\u003e =\u003e \u003crows\u003e`**\n\nThe `resolve` iterator is the heart of this package. It accepts columns and a method. When applied with rows, it will return resolved rows. The method is a function with signature like: `({ column }) =\u003e (rowData) =\u003e \u003cresolved row\u003e`. In most cases, the `nested` and `byFunction` methods provided in this package (or a composition of them) will be all you need.\n\nThe `resolve` iterator automatically injects into every resolved row object a field named `_index` containing the row's index. If `method` is not provided, `_index` is injected to the data automatically.\n\nIf your own resolver (e.g. `byFunction`) happens to also output a field named `_index`, it will overwrite the default one. In that case, if you still need the row index, you may wish to pass a different `indexKey` when calling `resolve`.\n\nNote that columns are resolved in order.  This means the `rowData` passed into a custom resolver will contain properties from earlier columns.\n\n### Method `resolve.nested`\n\n**`({ column }) =\u003e (rowData) =\u003e \u003cresolved row\u003e`**\n\nThe `nested` resolver digs rows from a `property: 'name.first'` kind of definition and maps the received value to property name. It replaces the original value with the resolved one. *Note*: instead of defining a path string `property: 'name.first'`, you may provide a custom getter function `property: data =\u003e (data.name || {}).first` directly. This may be slightly faster but needs to be done carefully to prevent TypeErrors due to missing values.\n\nThis is not intended to be called directly.  Pass it as a method to `resolve.resolve()`.\n\n### Method creator `resolve.byFunction`\n\n**`(path: \u003cstring\u003e) =\u003e ({ column }) =\u003e (rowData) =\u003e \u003cresolved row\u003e`**\n\nThe `byFunction` resolver accepts a path from where to look for a resolving function. It could be `column.cell.resolve` for example and you can use a nested definition for getting it from your column definition.\n\nInstead of replacing the original value, `byFunction` generates `_\u003cproperty\u003e` kind of field to the resulting rows. This sort of implicit rule is useful for other functionality as it can rely on the same convention.\n\nThis is not intended to be called directly.  Pass it as a method to `resolve.resolve()`.\n\n## Column Resolvers\n\n### `resolve.columnChildren`\n\n**`({ columns, childrenField = 'children' }) =\u003e \u003cresolved columns\u003e`**\n\nAssuming your column definition is nested, this function resolves it to a flat format.\n\n### `resolve.headerRows`\n\n**`({ columns, childrenField = 'children' }) =\u003e \u003cresolved columns\u003e`**\n\nIf your column definition is nested, you have to resolve it to header rows. `resolve.headerRows` has been designed exactly for this purpose.\n\n## Combining Resolver Methods\n\nYou can easily combine resolver methods like this:\n\n```javascript\nconst resolver = resolve.resolve({\n  columns,\n  method: ({ rowData, column }) =\u003e resolve.byFunction('cell.resolve')({\n    rowData: resolve.nested({ rowData, column }),\n    column\n  })\n});\n```\n\nor if you are already using Redux:\n\n```javascript\nimport { compose } from 'redux';\n\n...\n\nconst resolver = resolve.resolve({\n  columns,\n  method: (extra) =\u003e compose(\n    resolve.byFunction('cell.resolve')(extra),\n    resolve.nested(extra)\n  )\n});\n```\n\n## Resolution Example\n\nThe following example shows how you to resolve nested values.\n\n**Example:**\n\n```jsx\n/*\nimport * as resolve from 'table-resolver';\n*/\n\nconst columns = [\n  {\n    property: 'color',\n    header: {\n      label: 'Color'\n    }\n  },\n  {\n    header: {\n      label: 'Name'\n    },\n    children: [\n      {\n        property: 'name.first',\n        header: {\n          label: 'First Name'\n        }\n      },\n      {\n        property: 'name.last',\n        header: {\n          label: 'Last Name'\n        }\n      }\n    ]\n  },\n  {\n    header: {\n      label: 'About'\n    },\n    children: [\n      {\n        property: 'company',\n        header: {\n          label: 'Company'\n        }\n      },\n      {\n        property: 'sentence',\n        header: {\n          label: 'Sentence'\n        }\n      }\n    ]\n  }\n];\n\nconst rows = [\n  {\n    id: 1,\n    color: 'red',\n    name: {\n      first: 'John',\n      last: 'Johnson'\n    },\n    company: 'John Inc.',\n    sentence: 'consequatur nihil minima corporis omnis nihil rem'\n  },\n  {\n    id: 2,\n    color: 'blue',\n    name: {\n      first: 'Mike',\n      last: 'Mikeson'\n    },\n    company: 'Mike Inc.',\n    sentence: 'a sequi doloremque sed id quo voluptatem voluptatem ut voluptatibus'\n  }\n];\n\n\u003cul\u003e{\n  resolve.resolve(\n    {\n      columns: resolve.columnChildren({ columns }),\n      method: resolve.nested\n    }\n  )(rows).map((d, i) =\u003e\n    \u003cli key={`value-${i}`}\u003e{JSON.stringify(d, null, 2)}\u003c/li\u003e\n  )\n}\u003c/ul\u003e\n```\n\n## License\n\nMIT. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactabular%2Ftable-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactabular%2Ftable-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactabular%2Ftable-resolver/lists"}