{"id":19197896,"url":"https://github.com/flarebyte/object-crumble","last_synced_at":"2026-05-18T14:04:25.888Z","repository":{"id":42537397,"uuid":"441938805","full_name":"flarebyte/object-crumble","owner":"flarebyte","description":"Creative ways to cook your object","archived":false,"fork":false,"pushed_at":"2023-01-08T03:19:00.000Z","size":269,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-26T19:02:30.285Z","etag":null,"topics":["npm-package"],"latest_commit_sha":null,"homepage":"","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/flarebyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-26T16:44:53.000Z","updated_at":"2023-05-13T06:54:03.000Z","dependencies_parsed_at":"2023-02-08T04:32:01.009Z","dependency_job_id":null,"html_url":"https://github.com/flarebyte/object-crumble","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/flarebyte%2Fobject-crumble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fobject-crumble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fobject-crumble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flarebyte%2Fobject-crumble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flarebyte","download_url":"https://codeload.github.com/flarebyte/object-crumble/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271540,"owners_count":19774859,"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":["npm-package"],"created_at":"2024-11-09T12:19:13.237Z","updated_at":"2026-05-18T14:04:20.844Z","avatar_url":"https://github.com/flarebyte.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Object-crumble\n\n![npm](https://img.shields.io/npm/v/object-crumble) ![Build\nstatus](https://github.com/flarebyte/object-crumble/actions/workflows/main.yml/badge.svg)\n![npm bundle size](https://img.shields.io/bundlephobia/min/object-crumble)\n![Codacy\nBadge](https://app.codacy.com/project/badge/Grade/60b7f9751c214b0fa16ef3a6acf6c2c8)\n\n![npm type definitions](https://img.shields.io/npm/types/object-crumble)\n![node-current](https://img.shields.io/node/v/object-crumble)\n![NPM](https://img.shields.io/npm/l/object-crumble)\n\n\u003e Creative ways to cook your objects\n\nThe main motivation is to boost the writing of unit tests by simplifying the\nprocess of creating new data content. This is achieved by mutating\nprogrammatically existing data:\n\n-   Written in `Typescript`.\n\n-   Uses JSON-like object as an input.\n\n-   Can be used with any testing framework (Jest, ...)\n\n-   A simpler and experimental alternative to property testing. **No need\n    for a schema**. You should still consider, property based testing\n    framework\n    like[fast-check](https://dubzzz.github.io/fast-check.github.com/) that\n    can help find bugs in unexplored code paths.\n\n## Usage\n\nConvert any object to an abstract representation of the object structure\n\nabstractObject({name: \"Jane\", homepage: \"\u003chttp://mywebsite.com\u003e\" })\n\nwill return:\n\n```typescript\n[\n  {\n    path: \"name\",\n    kind: \"string\",\n  },\n  {\n    path: \"homepage\",\n    kind: \"url\",\n  },\n];\n```\n\nMutates an object applying a mutation.\n\n```typescript\nconst mutation = {\n  path: \"name\",\n  kind: \"string\",\n  mutationName: \"string =\u003e empty\",\n};\n\nmutateObject(mutatorRules)(mutation)({\n  name: \"Picasso\",\n  firstName: \"Pablo\",\n});\n```\n\nwill return empty field for `name`:\n\n```typescript\n{\nname: '',\nfirstName: 'Pablo'\n}\n```\n\nA more exhaustive documentation of the api is [available](API.md)\n\n## Documentation and links\n\n-   [Code Maintenance](MAINTENANCE.md)\n-   [Code Of Conduct](CODE_OF_CONDUCT.md)\n-   [Api for object-crumble](API.md)\n-   [Contributing](CONTRIBUTING.md)\n-   [Glossary](GLOSSARY.md)\n-   [Diagram for the code base](INTERNAL.md)\n-   [Vocabulary used in the code base](CODE_VOCABULARY.md)\n-   [Architectural Decision Records](DECISIONS.md)\n-   [Contributors](https://github.com/flarebyte/object-crumble/graphs/contributors)\n-   [Dependencies](https://github.com/flarebyte/object-crumble/network/dependencies)\n\n## Installation\n\nThis package is [ESM\nonly](https://blog.sindresorhus.com/get-ready-for-esm-aa53530b3f77).\n\n```bash\nyarn add object-crumble\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarebyte%2Fobject-crumble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflarebyte%2Fobject-crumble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflarebyte%2Fobject-crumble/lists"}