{"_id":"form-fix-array","_rev":"4-0b72991de596d8db8211ba994254ec60","name":"form-fix-array","description":"Fixes key names for HTTP form data, to ensure that arrays are handled correctly.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"form-fix-array","version":"1.0.0","description":"Fixes key names for HTTP form data, to ensure that arrays are handled correctly.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/joepie91/node-form-fix-array"},"keywords":["form-data","http","array"],"author":{"name":"Sven Slootweg"},"license":"WTFPL","devDependencies":{"gulp":"~3.8.0","gulp-cached":"~0.0.3","gulp-coffee":"~2.0.1","gulp-concat":"~2.2.0","gulp-livereload":"~2.1.0","gulp-nodemon":"~1.0.4","gulp-plumber":"~0.6.3","gulp-remember":"~0.2.0","gulp-rename":"~1.2.0","gulp-util":"~2.2.17"},"gitHead":"687d85598d5a2658d1e79ad68836d433f6a8308e","bugs":{"url":"https://github.com/joepie91/node-form-fix-array/issues"},"homepage":"https://github.com/joepie91/node-form-fix-array","_id":"form-fix-array@1.0.0","_shasum":"a1347a47e53117ab7bcdbf3e2f3ec91c66769bc8","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.10.32","_npmUser":{"name":"joepie91","email":"admin@cryto.net"},"maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"dist":{"shasum":"a1347a47e53117ab7bcdbf3e2f3ec91c66769bc8","tarball":"https://registry.npmjs.org/form-fix-array/-/form-fix-array-1.0.0.tgz","integrity":"sha512-f3qXI4CcvW7/6vqTKwCftcrFgfEBfWYPQTfvXrHYevHbJVfc107/SVvXvwUAYMaUAHdvu9ENQvLufJKphQI14w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEk/BMaDqP6vVQNRb6ePceCLNnocBag2yOyCHv0P2JM5AiEA9Lmzqh0XWe1Nse8npEYDd+a48Ro5PRov7oIoAipO/bo="}]}}},"readme":"# form-fix-array\n\nThis makes sure that form data is handled correctly when sent to a server.\n\nWhile arrays are a natively supported feature of HTTP form data (whether URL-encoded or multipart/form-data), implementation differences exist. Especially PHP is notorious for refusing to recognize a field as an array unless it specifically has array brackets in the field name. This means that `field=val1&field=val2` will simply be interpreted as `val2`, whereas `field[]=val1&field[]=val2` will be interpreted as an array containing `val1` and `val2`.\n\nThis module ensures that all fields containing an array of values have a `[]` suffix, adding it where necessary (and doing nothing where it is already there). That way, every receiving server should be able to handle the request.\n\nIt does not currently support objects ('associative arrays'), only plain arrays.\n\n## License\n\n[WTFPL](http://www.wtfpl.net/txt/copying/) or [CC0](https://creativecommons.org/publicdomain/zero/1.0/), whichever you prefer. A donation and/or attribution are appreciated, but not required.\n\n## Donate\n\nMy income consists entirely of donations for my projects. If this module is useful to you, consider [making a donation](http://cryto.net/~joepie91/donate.html)!\n\nYou can donate using Bitcoin, PayPal, Gratipay, Flattr, cash-in-mail, SEPA transfers, and pretty much anything else.\n\n## Contributing\n\nPull requests welcome. Please make sure your modifications are in line with the overall code style, and ensure that you're editing the `.coffee` files, not the `.js` files.\n\nBuild tool of choice is `gulp`; simply run `gulp` while developing, and it will watch for changes.\n\nBe aware that by making a pull request, you agree to release your modifications under the licenses stated above.\n\n## Usage\n\n```javascript\nvar formFixArray = require(\"form-fix-array\");\n\nvar sampleFormData = {\n\t\"fieldOne\": \"value 1\",\n\t\"fieldTwo\": [\"value 2a\", \"value 2b\"],\n\t\"fieldThree[]\": [\"value 3a\", \"value 3b\"]\n}\n\nvar fixedFormData = formFixArray(sampleFormData);\n\n/* Result:\n{\n\t\"fieldOne\": \"value 1\",\n\t\"fieldTwo[]\": [\"value 2a\", \"value 2b\"],\n\t\"fieldThree[]\": [\"value 3a\", \"value 3b\"]\n}\n*/\n```\n","maintainers":[{"name":"joepie91","email":"admin@cryto.net"}],"time":{"modified":"2022-06-18T03:01:00.569Z","created":"2015-01-20T09:54:52.934Z","1.0.0":"2015-01-20T09:54:52.934Z"},"homepage":"https://github.com/joepie91/node-form-fix-array","keywords":["form-data","http","array"],"repository":{"type":"git","url":"git://github.com/joepie91/node-form-fix-array"},"author":{"name":"Sven Slootweg"},"bugs":{"url":"https://github.com/joepie91/node-form-fix-array/issues"},"license":"WTFPL","readmeFilename":"README.md"}