{"id":21028232,"url":"https://github.com/ahme-dev/pocketbase-expandless","last_synced_at":"2025-10-10T06:05:44.706Z","repository":{"id":112960268,"uuid":"609905110","full_name":"ahme-dev/pocketbase-expandless","owner":"ahme-dev","description":"Library to remove expands from pocketbase records.","archived":false,"fork":false,"pushed_at":"2023-03-15T13:55:46.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T18:37:35.338Z","etag":null,"topics":["pocketbase"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pocketbase-expandless","language":"TypeScript","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/ahme-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-05T15:36:19.000Z","updated_at":"2023-03-06T16:41:22.000Z","dependencies_parsed_at":"2023-05-30T03:00:13.369Z","dependency_job_id":null,"html_url":"https://github.com/ahme-dev/pocketbase-expandless","commit_stats":null,"previous_names":["ahme-dev/pocketbase-expandless"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahme-dev%2Fpocketbase-expandless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahme-dev%2Fpocketbase-expandless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahme-dev%2Fpocketbase-expandless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahme-dev%2Fpocketbase-expandless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahme-dev","download_url":"https://codeload.github.com/ahme-dev/pocketbase-expandless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243217883,"owners_count":20255616,"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":["pocketbase"],"created_at":"2024-11-19T11:54:31.846Z","updated_at":"2025-10-10T06:05:39.672Z","avatar_url":"https://github.com/ahme-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Pocketbase Expandless\n\n![npm](https://img.shields.io/npm/v/pocketbase-expandless?label=latest\u0026style=flat-square\u0026color=red)\n![npm bundle size](https://img.shields.io/bundlephobia/min/pocketbase-expandless?label=minified\u0026style=flat-square)\n![npm](https://img.shields.io/npm/dm/pocketbase-expandless?color=indigo\u0026style=flat-square)\n\nThis library is made to remove expands from pocketbase records, and instead set the properties inside of them as the record's properties.\n\nThis means that the regular way to access expanded fields will change from:\n\n```typescript\nproduct.expand.category_id;\n\ntransaction.expand.product_id.expand.category_id;\n```\n\nInto an easier way:\n\n```typescript\nproduct.category_id;\n\ntransaction.product_id.category_id;\n```\n\n### Install\n```bash\nnpm i pocketbase-expandless\n```\n\n### Usage\n```typescript\n  // import the main function from the the library\n  import { moveExpandsInline } from \"pocketbase-expandless\";\n\n  // fetch your data as you would\n  let transactions = await pb.collection(\"transactions\").getList(1, 25, {\n    expand: \"transaction_product_ids.product_id.category_id, customer_id\",\n  });\n\n  // give the list of items to the function and get a list without expands\n  const itemsExpandless = moveExpandsInline(transactions.items);\n  \n  // use the items as you want\n  items.map((item)=\u003e{\n    console.log(\"category with no expand = \",item.product_id.category_id)\n  })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahme-dev%2Fpocketbase-expandless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahme-dev%2Fpocketbase-expandless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahme-dev%2Fpocketbase-expandless/lists"}