{"id":18317940,"url":"https://github.com/idiocc/test-form-data","last_synced_at":"2025-04-09T13:51:53.549Z","repository":{"id":57128719,"uuid":"195243324","full_name":"idiocc/test-form-data","owner":"idiocc","description":"Data For Testing Multipart/Form-Data Algorithms.","archived":false,"fork":false,"pushed_at":"2019-07-04T13:19:10.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T07:48:59.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://idio.cc","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idiocc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-07-04T13:05:14.000Z","updated_at":"2019-07-04T13:19:12.000Z","dependencies_parsed_at":"2022-08-31T18:31:00.113Z","dependency_job_id":null,"html_url":"https://github.com/idiocc/test-form-data","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Ftest-form-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Ftest-form-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Ftest-form-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Ftest-form-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiocc","download_url":"https://codeload.github.com/idiocc/test-form-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054218,"owners_count":21039951,"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":[],"created_at":"2024-11-05T18:07:56.618Z","updated_at":"2025-04-09T13:51:53.524Z","avatar_url":"https://github.com/idiocc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @multipart/test-form-data\n\n[![npm version](https://badge.fury.io/js/%40multipart%2Ftest-form-data.svg)](https://npmjs.org/package/@multipart/test-form-data)\n\n`@multipart/test-form-data` is Data For Testing Multipart/Form-Data Algorithms Written As [Zoroaster Mask](https://contexttesting.com).\n\n```sh\nyarn add -D @multipart/test-form-data\n```\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n- [`updateStore(store: Object)`](#updatestorestore-object-void)\n- [Copyright](#copyright)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\"/.documentary/section-breaks/0.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## API\n\nThe package is available by importing its named function, and by referencing the mask result file:\n\n```js\nimport makeTestSuite from '@zoroaster/mask'\nimport { updateStore } from '@multipart/test-form-data'\n\nexport default makeTestSuite('node_modules/@multipart/test-form-data', {\n  getResults() {\n    // ... must return the store for comparison\n  }\n})\n```\n\n```markdown\n## basic keys\n[\n  {\n    \"key\": \"name\",\n    \"value\": \"Bender\"\n  },\n  {\n    \"key\": \"hind\",\n    \"value\": \"Bitable\"\n  },\n  {\n    \"key\": \"shiny\",\n    \"value\": \"Yes\"\n  }\n]\n\n/* expected */\n{\n  \"name\": \"Bender\",\n  \"hind\": \"Bitable\",\n  \"shiny\": \"Yes\"\n}\n/**/\n\n## multiple values\n[\n  {\n    \"key\": \"bottle-on-wall\",\n    \"value\": \"1\"\n  },\n  {\n    \"key\": \"bottle-on-wall\",\n    \"value\": \"2\"\n  },\n  {\n    \"key\": \"bottle-on-wall\",\n    \"value\": \"3\"\n  }\n]\n\n/* expected */\n{\n  \"bottle-on-wall\": [\n    \"1\",\n    \"2\",\n    \"3\"\n  ]\n}\n/**/\n\n## deeper structure\n[\n  {\n    \"key\": \"pet[species]\",\n    \"value\": \"Dahut\"\n  },\n  {\n    \"key\": \"pet[name]\",\n    \"value\": \"Hypatia\"\n  },\n  {\n    \"key\": \"kids[1]\",\n    \"value\": \"Thelma\"\n  },\n  {\n    \"key\": \"kids[0]\",\n    \"value\": \"Ashley\"\n  }\n]\n\n/* expected */\n{\n  \"pet\": {\n    \"species\": \"Dahut\",\n    \"name\": \"Hypatia\"\n  },\n  \"kids\": [\n    \"Ashley\",\n    \"Thelma\"\n  ]\n}\n/**/\n\n## sparse arrays\n[\n  {\n    \"key\": \"heartbeat[0]\",\n    \"value\": \"thunk\"\n  },\n  {\n    \"key\": \"heartbeat[2]\",\n    \"value\": \"thunk\"\n  }\n]\n\n/* expected */\n{\n  \"heartbeat\": [\n    \"thunk\",\n    null,\n    \"thunk\"\n  ]\n}\n/**/\n\n## even deeper\n[\n  {\n    \"key\": \"pet[0][species]\",\n    \"value\": \"Dahut\"\n  },\n  {\n    \"key\": \"pet[0][name]\",\n    \"value\": \"Hypatia\"\n  },\n  {\n    \"key\": \"pet[1][species]\",\n    \"value\": \"Felis Stultus\"\n  },\n  {\n    \"key\": \"pet[1][name]\",\n    \"value\": \"Billie\"\n  }\n]\n\n/* expected */\n{\n  \"pet\": [\n    {\n      \"species\": \"Dahut\",\n      \"name\": \"Hypatia\"\n    },\n    {\n      \"species\": \"Felis Stultus\",\n      \"name\": \"Billie\"\n    }\n  ]\n}\n/**/\n\n## such deep\n[\n  {\n    \"key\": \"wow[such][deep][3][much][power][!]\",\n    \"value\": \"Amaze\"\n  }\n]\n\n/* expected */\n{\n  \"wow\": {\n    \"such\": {\n      \"deep\": [\n        null,\n        null,\n        null,\n        {\n          \"much\": {\n            \"power\": {\n              \"!\": \"Amaze\"\n            }\n          }\n        }\n      ]\n    }\n  }\n}\n/**/\n\n## merge behaviour\n[\n  {\n    \"key\": \"mix\",\n    \"value\": \"scalar\"\n  },\n  {\n    \"key\": \"mix[0]\",\n    \"value\": \"array 1\"\n  },\n  {\n    \"key\": \"mix[2]\",\n    \"value\": \"array 2\"\n  },\n  {\n    \"key\": \"mix[key]\",\n    \"value\": \"key key\"\n  },\n  {\n    \"key\": \"mix[car]\",\n    \"value\": \"car key\"\n  }\n]\n\n/* expected */\n{\n  \"mix\": {\n    \"0\": \"array 1\",\n    \"2\": \"array 2\",\n    \"\": \"scalar\",\n    \"key\": \"key key\",\n    \"car\": \"car key\"\n  }\n}\n/**/\n\n## bad fields\n[\n  {\n    \"key\": \"error[good]\",\n    \"value\": \"BOOM!\"\n  },\n  {\n    \"key\": \"error[bad\",\n    \"value\": \"BOOM BOOM!\"\n  }\n]\n\n/* expected */\n{\n  \"error\": {\n    \"good\": \"BOOM!\"\n  },\n  \"error[bad\": \"BOOM BOOM!\"\n}\n/**/\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\"/.documentary/section-breaks/1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## `updateStore(`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`store: Object,`\u003cbr/\u003e`): void`\n\nUpdates the store to make `undefined` in sparse arrays appear as nulls for `deepStrictEqual` comparison.\n\n```js\nimport { updateStore } from '@multipart/test-form-data'\n\nconst hello = []\nhello[2] = 'test'\n\nconst store = { hello }\nupdateStore(store)\nconsole.log(store)\n```\n```\n{ hello: [ null, null, 'test' ] }\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\"/.documentary/section-breaks/2.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Copyright\n\nOriginal data by [Linus Unnebäck](https://github.com/LinusU/testdata-w3c-json-form).\n\n---\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://artd.eco\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/wrote/wrote/master/images/artdeco.png\" alt=\"Art Deco\"\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e© \u003ca href=\"https://artd.eco\"\u003eArt Deco\u003c/a\u003e for \u003ca href=\"https://idio.cc\"\u003eIdio\u003c/a\u003e 2019\u003c/th\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://idio.cc\"\u003e\n        \u003cimg src=\"https://avatars3.githubusercontent.com/u/40834161?s=100\" width=\"100\" alt=\"Idio\"\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://www.technation.sucks\" title=\"Tech Nation Visa\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/artdecoweb/www.technation.sucks/master/anim.gif\"\n          alt=\"Tech Nation Visa\"\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e\u003ca href=\"https://www.technation.sucks\"\u003eTech Nation Visa Sucks\u003c/a\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\"/.documentary/section-breaks/-1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiocc%2Ftest-form-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiocc%2Ftest-form-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiocc%2Ftest-form-data/lists"}