{"id":18317919,"url":"https://github.com/idiocc/append-field","last_synced_at":"2025-04-09T13:51:24.791Z","repository":{"id":57128689,"uuid":"195033635","full_name":"idiocc/append-field","owner":"idiocc","description":"[fork] W3C HTML JSON form compliant field appender Written In ES6 And Optimised With JavaScript Compiler.","archived":false,"fork":false,"pushed_at":"2019-07-04T13:30:29.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-17T07:09:24.912Z","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-03T10:39:33.000Z","updated_at":"2019-07-04T13:30:31.000Z","dependencies_parsed_at":"2022-08-31T18:32:23.136Z","dependency_job_id":null,"html_url":"https://github.com/idiocc/append-field","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fappend-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fappend-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fappend-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fappend-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiocc","download_url":"https://codeload.github.com/idiocc/append-field/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:51.458Z","updated_at":"2025-04-09T13:51:24.759Z","avatar_url":"https://github.com/idiocc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @goa/append-field\n\n[![npm version](https://badge.fury.io/js/%40goa%2Fappend-field.svg)](https://npmjs.org/package/@goa/append-field)\n\n`@goa/append-field` is a fork of [W3C HTML JSON form compliant field appender](https://github.com/LinusU/node-append-field) Written In ES6 And Optimised With [JavaScript Compiler](https://compiler.page).\n\nA [W3C HTML JSON forms spec](http://www.w3.org/TR/html-json-forms/) compliant field appender (for lack of a better name). Useful for people implementing `application/x-www-form-urlencoded` and `multipart/form-data parsers`.\n\n```sh\nyarn add @goa/append-field\n```\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n- [`appendField(store: Object, key: string, value: string)`](#appendfieldstore-objectkey-stringvalue-string-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 default function:\n\n```js\nimport appendField from '@goa/append-field'\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## `appendField(`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`store: Object,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`key: string,`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`value: string,`\u003cbr/\u003e`): void`\n\nAdds the field named `key` with the value `value` to the object store.\n\n```js\nimport appendField from '@goa/append-field'\n\nconst obj = {}\n\nappendField(obj, 'pets[0][species]', 'Dahut')\nappendField(obj, 'pets[0][name]', 'Hypatia')\nappendField(obj, 'pets[1][species]', 'Felis Stultus')\nappendField(obj, 'pets[1][name]', 'Billie')\n\nconsole.log(obj)\n```\n```js\n{ pets: \n   [ { species: 'Dahut', name: 'Hypatia' },\n     { species: 'Felis Stultus', name: 'Billie' } ] }\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 Work by [Linus Unnebäck](https://github.com/LinusU/node-append-field).\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%2Fappend-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiocc%2Fappend-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiocc%2Fappend-field/lists"}