{"id":20727934,"url":"https://github.com/mobilehero-archive/titanium-querystring","last_synced_at":"2025-12-24T07:34:00.020Z","repository":{"id":57166735,"uuid":"119895588","full_name":"mobilehero-archive/titanium-querystring","owner":"mobilehero-archive","description":"⭐  Axway Amplify module adding querystring support to Appcelerator Titanium SDK","archived":false,"fork":false,"pushed_at":"2022-04-11T17:42:48.000Z","size":2912,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-23T16:19:43.567Z","etag":null,"topics":["api-builder","axway","axway-amplify","axway-module","axway-plugin","axway-sdk","brenton-house","mobile","sdk","titanium","titanium-alloy","titanium-mobile","titanium-module","titanium-sdk"],"latest_commit_sha":null,"homepage":"https://brenton.house/saying-goodbye-to-axway-amplify-titanium-31a44f3671de","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mobilehero-archive.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-01T21:25:44.000Z","updated_at":"2022-01-11T03:18:54.000Z","dependencies_parsed_at":"2022-08-30T13:10:48.161Z","dependency_job_id":null,"html_url":"https://github.com/mobilehero-archive/titanium-querystring","commit_stats":null,"previous_names":["brentonhouse/titanium-querystring"],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/mobilehero-archive/titanium-querystring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilehero-archive%2Ftitanium-querystring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilehero-archive%2Ftitanium-querystring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilehero-archive%2Ftitanium-querystring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilehero-archive%2Ftitanium-querystring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mobilehero-archive","download_url":"https://codeload.github.com/mobilehero-archive/titanium-querystring/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilehero-archive%2Ftitanium-querystring/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27997415,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-builder","axway","axway-amplify","axway-module","axway-plugin","axway-sdk","brenton-house","mobile","sdk","titanium","titanium-alloy","titanium-mobile","titanium-module","titanium-sdk"],"created_at":"2024-11-17T04:34:51.969Z","updated_at":"2025-12-24T07:34:00.006Z","avatar_url":"https://github.com/mobilehero-archive.png","language":"JavaScript","readme":"[//]: # (header-start)\n\n\u003ch1 align=\"center\"\u003e\n\t\u003ca href=\"https://blog.axway.com/mobile-apps/changes-to-application-development-services\"\u003e\n\t\tPreparing for end of Axway\n\t\u003c/a\u003e\t\n\u003c/h1\u003e\n\u003ch2 align=\"center\"\u003e\n\t👇 \u0026nbsp; support for Amplify Cloud and Mobile   \u0026nbsp; 👇\n\u003c/h2\u003e\t\n\n\u003ca href=\"https://brenton.house/saying-goodbye-to-axway-amplify-titanium-31a44f3671de\"\u003e\n\t\u003cp align=\"center\"\u003e\n\t\t\u003cimg src=\"https://cdn.secure-api.org/images/RIP-Axway-Amplify-Titanium.png\" alt=\"RIP Axway Amplify Titanium (2010 - 2022)\" width=\"80%\" /\u003e\n\t\u003c/p\u003e\n\u003c/a\u003e\t\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://blog.axway.com/mobile-apps/changes-to-application-development-services\"\u003e\n\t\t\t🪦 \u0026nbsp; RIP Axway Amplify Titanium (2010 - 2022)\n\t\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://blog.axway.com/mobile-apps/prepare-your-apps-for-appcelerator-end-of-support\"\u003e\n\t\t\t🪦 \u0026nbsp; RIP Axway Amplify Cloud Services (2012 - 2022)\n\t\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://blog.axway.com/mobile-apps/prepare-your-apps-for-appcelerator-end-of-support\"\u003e\n\t\t\t🪦 \u0026nbsp; RIP Axway Amplify Crash Analytics (2015 - 2022)\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\u003ch4 align=\"center\"\u003e\n🛑 \u0026nbsp;\u0026nbsp; \u003ca href=\"https://blog.axway.com/mobile-apps/prepare-your-apps-for-appcelerator-end-of-support\"\u003eAxway support for Amplify products has ended\u003c/a\u003e for most products related to mobile and cloud. \n\u003c/h4\u003e\n\n\u003ch4 align=\"center\"\u003e\nA few of the open-source versions of Axway Amplify products will live on after \u003ca href=\"\"\u003eAxway Amplify End-of-Life\u003c/a\u003e (EOL) announcements.  However, all closed-source projects and most open-source projects are now dead.  \n\t\u003c/h4\u003e\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n\u003e 👉 \u0026nbsp;\u0026nbsp; A group of Axway employees, ex-Axway employees, and some developers from Titanium community have created a legal org and now officially decide all matters related to future of these products.  \n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003chr\u003e\n\n\n## API FAQ:\n\n* [API Best Practices](https://brenton.house)\n* [What is API Security?](https://brenton.house/what-is-api-security-5ca8117d4911)\n* [OWASP Top 10 List for API Security](https://www.youtube.com/watch?v=GLVHDj0Cpg4)\n* [What is API Security?](https://brenton.house/what-is-api-security-5ca8117d4911)\n* [Top API Trends for 2022](https://brenton.house/top-10-api-integration-trends-for-2022-49b05f2ef299)\n* [What is a Frankenstein API?](https://brenton.house/what-is-a-frankenstein-api-4d6e59fca6)\n* [What is a Zombie API?](https://brenton.house/what-is-a-zombie-api-6e5427c39b6a)\n* [API Developer Experience](https://brenton.house/keys-to-winning-with-an-awesome-api-developer-experience-62dd2fa668f4)\n* [API Cybersecurity 101](https://brenton.house/what-is-api-security-5ca8117d4911)\n* [YouTube API Videos](https://youtube.com/brentonhouse)\n* [YouTube API Shorts Videos](https://youtube.com/apishorts)\n\n\u0026nbsp;\n\n[![Click to watch on Youtube](https://img.youtube.com/vi/GLVHDj0Cpg4/0.jpg)](https://www.youtube.com/watch?v=GLVHDj0Cpg4\u0026list=PLsy9MwYlG1pew6sktCAIFD5tbrXy9HUQ7  \"Click to watch on YouTube\")\n\n\n\u003e \u0026nbsp; [↑ Watch video on YouTube ↑](https://www.youtube.com/watch?v=GLVHDj0Cpg4\u0026list=PLsy9MwYlG1pew6sktCAIFD5tbrXy9HUQ7)\n\n\u0026nbsp;\n\n\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003chr\u003e\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n[//]: # (header-end)\n\n# @titanium/querystring\n\n[![@titanium/querystring version](https://img.shields.io/npm/v/@titanium/querystring.png)](https://www.npmjs.com/package/@titanium/querystring)\n[![@titanium/querystring downloads](https://img.shields.io/npm/dm/@titanium/querystring.svg)](https://www.npmjs.com/package/@titanium/querystring)\n[![@titanium/querystring dependencies](https://img.shields.io/librariesio/release/npm/@titanium/querystring.svg)](https://www.npmjs.com/package/@titanium/querystring)\n\n\n\n\u003e A querystring parsing and stringifying library with some added security.  Based on https://github.com/ljharb/qs by [Jordan Harband](https://github.com/ljharb)   \n\nThe **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).\n\n* [API FAQ:](#api-faq)\n* [🚀 Getting Started](#-getting-started)\n* [Usage](#usage)\n\t* [Parsing Objects](#parsing-objects)\n\t* [Parsing Arrays](#parsing-arrays)\n\t* [Stringifying](#stringifying)\n\t* [Handling of `null` values](#handling-of-null-values)\n\t* [Dealing with special character sets](#dealing-with-special-character-sets)\n\t* [RFC 3986 and RFC 1738 space encoding](#rfc-3986-and-rfc-1738-space-encoding)\n* [Security](#security)\n\n## 🚀 Getting Started\n\nInstall `@titanium/querystring` in root of project\n\n```\nnpm install @titanium/querystring\n```\n\nUse one of the following require statements in your Titanium native mobile app code:\n\n\u003e Any of the following statements will work in your code\n\n```\nconst qs = require('@titanium/querystring');\nconst qs = require('qs');\nconst qs = require('querystring');\n\n```\n\n## Usage\n\n```javascript\nvar qs = require('qs');\nvar assert = require('assert');\n\nvar obj = qs.parse('a=c');\nassert.deepEqual(obj, { a: 'c' });\n\nvar str = qs.stringify(obj);\nassert.equal(str, 'a=c');\n```\n\n### Parsing Objects\n\n[](#preventEval)\n```javascript\nqs.parse(string, [options]);\n```\n\n**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.\nFor example, the string `'foo[bar]=baz'` converts to:\n\n```javascript\nassert.deepEqual(qs.parse('foo[bar]=baz'), {\n    foo: {\n        bar: 'baz'\n    }\n});\n```\n\nWhen using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:\n\n```javascript\nvar nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });\nassert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } });\n```\n\nBy default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.\n\n```javascript\nvar protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });\nassert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });\n```\n\nURI encoded strings work too:\n\n```javascript\nassert.deepEqual(qs.parse('a%5Bb%5D=c'), {\n    a: { b: 'c' }\n});\n```\n\nYou can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:\n\n```javascript\nassert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {\n    foo: {\n        bar: {\n            baz: 'foobarbaz'\n        }\n    }\n});\n```\n\nBy default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like\n`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:\n\n```javascript\nvar expected = {\n    a: {\n        b: {\n            c: {\n                d: {\n                    e: {\n                        f: {\n                            '[g][h][i]': 'j'\n                        }\n                    }\n                }\n            }\n        }\n    }\n};\nvar string = 'a[b][c][d][e][f][g][h][i]=j';\nassert.deepEqual(qs.parse(string), expected);\n```\n\nThis depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`:\n\n```javascript\nvar deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });\nassert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });\n```\n\nThe depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.\n\nFor similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:\n\n```javascript\nvar limited = qs.parse('a=b\u0026c=d', { parameterLimit: 1 });\nassert.deepEqual(limited, { a: 'b' });\n```\n\nTo bypass the leading question mark, use `ignoreQueryPrefix`:\n\n```javascript\nvar prefixed = qs.parse('?a=b\u0026c=d', { ignoreQueryPrefix: true });\nassert.deepEqual(prefixed, { a: 'b', c: 'd' });\n```\n\nAn optional delimiter can also be passed:\n\n```javascript\nvar delimited = qs.parse('a=b;c=d', { delimiter: ';' });\nassert.deepEqual(delimited, { a: 'b', c: 'd' });\n```\n\nDelimiters can be a regular expression too:\n\n```javascript\nvar regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });\nassert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });\n```\n\nOption `allowDots` can be used to enable dot notation:\n\n```javascript\nvar withDots = qs.parse('a.b=c', { allowDots: true });\nassert.deepEqual(withDots, { a: { b: 'c' } });\n```\n\nIf you have to deal with legacy browsers or services, there's\nalso support for decoding percent-encoded octets as iso-8859-1:\n\n```javascript\nvar oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' });\nassert.deepEqual(oldCharset, { a: '§' });\n```\n\nSome services add an initial `utf8=✓` value to forms so that old\nInternet Explorer versions are more likely to submit the form as\nutf-8. Additionally, the server can check the value against wrong\nencodings of the checkmark character and detect that a query string\nor `application/x-www-form-urlencoded` body was *not* sent as\nutf-8, eg. if the form had an `accept-charset` parameter or the\ncontaining page had a different character set.\n\n**qs** supports this mechanism via the `charsetSentinel` option.\nIf specified, the `utf8` parameter will be omitted from the\nreturned object. It will be used to switch to `iso-8859-1`/`utf-8`\nmode depending on how the checkmark is encoded.\n\n**Important**: When you specify both the `charset` option and the\n`charsetSentinel` option, the `charset` will be overridden when\nthe request contains a `utf8` parameter from which the actual\ncharset can be deduced. In that sense the `charset` will behave\nas the default charset rather than the authoritative charset.\n\n```javascript\nvar detectedAsUtf8 = qs.parse('utf8=%E2%9C%93\u0026a=%C3%B8', {\n    charset: 'iso-8859-1',\n    charsetSentinel: true\n});\nassert.deepEqual(detectedAsUtf8, { a: 'ø' });\n\n// Browsers encode the checkmark as \u0026#10003; when submitting as iso-8859-1:\nvar detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B\u0026a=%F8', {\n    charset: 'utf-8',\n    charsetSentinel: true\n});\nassert.deepEqual(detectedAsIso8859_1, { a: 'ø' });\n```\n\nIf you want to decode the `\u0026#...;` syntax to the actual character,\nyou can specify the `interpretNumericEntities` option as well:\n\n```javascript\nvar detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', {\n    charset: 'iso-8859-1',\n    interpretNumericEntities: true\n});\nassert.deepEqual(detectedAsIso8859_1, { a: '☺' });\n```\n\nIt also works when the charset has been detected in `charsetSentinel`\nmode.\n\n### Parsing Arrays\n\n**qs** can also parse arrays using a similar `[]` notation:\n\n```javascript\nvar withArray = qs.parse('a[]=b\u0026a[]=c');\nassert.deepEqual(withArray, { a: ['b', 'c'] });\n```\n\nYou may specify an index as well:\n\n```javascript\nvar withIndexes = qs.parse('a[1]=c\u0026a[0]=b');\nassert.deepEqual(withIndexes, { a: ['b', 'c'] });\n```\n\nNote that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number\nto create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving\ntheir order:\n\n```javascript\nvar noSparse = qs.parse('a[1]=b\u0026a[15]=c');\nassert.deepEqual(noSparse, { a: ['b', 'c'] });\n```\n\nNote that an empty string is also a value, and will be preserved:\n\n```javascript\nvar withEmptyString = qs.parse('a[]=\u0026a[]=b');\nassert.deepEqual(withEmptyString, { a: ['', 'b'] });\n\nvar withIndexedEmptyString = qs.parse('a[0]=b\u0026a[1]=\u0026a[2]=c');\nassert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });\n```\n\n**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will\ninstead be converted to an object with the index as the key. This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array.\n\n```javascript\nvar withMaxIndex = qs.parse('a[100]=b');\nassert.deepEqual(withMaxIndex, { a: { '100': 'b' } });\n```\n\nThis limit can be overridden by passing an `arrayLimit` option:\n\n```javascript\nvar withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });\nassert.deepEqual(withArrayLimit, { a: { '1': 'b' } });\n```\n\nTo disable array parsing entirely, set `parseArrays` to `false`.\n\n```javascript\nvar noParsingArrays = qs.parse('a[]=b', { parseArrays: false });\nassert.deepEqual(noParsingArrays, { a: { '0': 'b' } });\n```\n\nIf you mix notations, **qs** will merge the two items into an object:\n\n```javascript\nvar mixedNotation = qs.parse('a[0]=b\u0026a[b]=c');\nassert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });\n```\n\nYou can also create arrays of objects:\n\n```javascript\nvar arraysOfObjects = qs.parse('a[][b]=c');\nassert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });\n```\n\nSome people use comma to join array, **qs** can parse it:\n```javascript\nvar arraysOfObjects = qs.parse('a=b,c', { comma: true })\nassert.deepEqual(arraysOfObjects, { a: ['b', 'c'] })\n```\n(_this cannot convert nested objects, such as `a={b:1},{c:d}`_)\n\n### Stringifying\n\n[](#preventEval)\n```javascript\nqs.stringify(object, [options]);\n```\n\nWhen stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:\n\n```javascript\nassert.equal(qs.stringify({ a: 'b' }), 'a=b');\nassert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');\n```\n\nThis encoding can be disabled by setting the `encode` option to `false`:\n\n```javascript\nvar unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });\nassert.equal(unencoded, 'a[b]=c');\n```\n\nEncoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`:\n```javascript\nvar encodedValues = qs.stringify(\n    { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },\n    { encodeValuesOnly: true }\n);\nassert.equal(encodedValues,'a=b\u0026c[0]=d\u0026c[1]=e%3Df\u0026f[0][0]=g\u0026f[1][0]=h');\n```\n\nThis encoding can also be replaced by a custom encoding method set as `encoder` option:\n\n```javascript\nvar encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) {\n    // Passed in values `a`, `b`, `c`\n    return // Return encoded string\n}})\n```\n\n_(Note: the `encoder` option does not apply if `encode` is `false`)_\n\nAnalogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values:\n\n```javascript\nvar decoded = qs.parse('x=z', { decoder: function (str) {\n    // Passed in values `x`, `z`\n    return // Return decoded string\n}})\n```\n\nExamples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.\n\nWhen arrays are stringified, by default they are given explicit indices:\n\n```javascript\nqs.stringify({ a: ['b', 'c', 'd'] });\n// 'a[0]=b\u0026a[1]=c\u0026a[2]=d'\n```\n\nYou may override this by setting the `indices` option to `false`:\n\n```javascript\nqs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });\n// 'a=b\u0026a=c\u0026a=d'\n```\n\nYou may use the `arrayFormat` option to specify the format of the output array:\n\n```javascript\nqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })\n// 'a[0]=b\u0026a[1]=c'\nqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })\n// 'a[]=b\u0026a[]=c'\nqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })\n// 'a=b\u0026a=c'\nqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' })\n// 'a=b,c'\n```\n\nWhen objects are stringified, by default they use bracket notation:\n\n```javascript\nqs.stringify({ a: { b: { c: 'd', e: 'f' } } });\n// 'a[b][c]=d\u0026a[b][e]=f'\n```\n\nYou may override this to use dot notation by setting the `allowDots` option to `true`:\n\n```javascript\nqs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true });\n// 'a.b.c=d\u0026a.b.e=f'\n```\n\nEmpty strings and null values will omit the value, but the equals sign (=) remains in place:\n\n```javascript\nassert.equal(qs.stringify({ a: '' }), 'a=');\n```\n\nKey with no values (such as an empty object or array) will return nothing:\n\n```javascript\nassert.equal(qs.stringify({ a: [] }), '');\nassert.equal(qs.stringify({ a: {} }), '');\nassert.equal(qs.stringify({ a: [{}] }), '');\nassert.equal(qs.stringify({ a: { b: []} }), '');\nassert.equal(qs.stringify({ a: { b: {}} }), '');\n```\n\nProperties that are set to `undefined` will be omitted entirely:\n\n```javascript\nassert.equal(qs.stringify({ a: null, b: undefined }), 'a=');\n```\n\nThe query string may optionally be prepended with a question mark:\n\n```javascript\nassert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b\u0026c=d');\n```\n\nThe delimiter may be overridden with stringify as well:\n\n```javascript\nassert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');\n```\n\nIf you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option:\n\n```javascript\nvar date = new Date(7);\nassert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A'));\nassert.equal(\n    qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }),\n    'a=7'\n);\n```\n\nYou may use the `sort` option to affect the order of parameter keys:\n\n```javascript\nfunction alphabeticalSort(a, b) {\n    return a.localeCompare(b);\n}\nassert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c\u0026b=f\u0026z=y');\n```\n\nFinally, you can use the `filter` option to restrict which keys will be included in the stringified output.\nIf you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you\npass an array, it will be used to select properties and array indices for stringification:\n\n```javascript\nfunction filterFunc(prefix, value) {\n    if (prefix == 'b') {\n        // Return an `undefined` value to omit a property.\n        return;\n    }\n    if (prefix == 'e[f]') {\n        return value.getTime();\n    }\n    if (prefix == 'e[g][0]') {\n        return value * 2;\n    }\n    return value;\n}\nqs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc });\n// 'a=b\u0026c=d\u0026e[f]=123\u0026e[g][0]=4'\nqs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });\n// 'a=b\u0026e=f'\nqs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });\n// 'a[0]=b\u0026a[2]=d'\n```\n\n### Handling of `null` values\n\nBy default, `null` values are treated like empty strings:\n\n```javascript\nvar withNull = qs.stringify({ a: null, b: '' });\nassert.equal(withNull, 'a=\u0026b=');\n```\n\nParsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.\n\n```javascript\nvar equalsInsensitive = qs.parse('a\u0026b=');\nassert.deepEqual(equalsInsensitive, { a: '', b: '' });\n```\n\nTo distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`\nvalues have no `=` sign:\n\n```javascript\nvar strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });\nassert.equal(strictNull, 'a\u0026b=');\n```\n\nTo parse values without `=` back to `null` use the `strictNullHandling` flag:\n\n```javascript\nvar parsedStrictNull = qs.parse('a\u0026b=', { strictNullHandling: true });\nassert.deepEqual(parsedStrictNull, { a: null, b: '' });\n```\n\nTo completely skip rendering keys with `null` values, use the `skipNulls` flag:\n\n```javascript\nvar nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });\nassert.equal(nullsSkipped, 'a=b');\n```\n\nIf you're communicating with legacy systems, you can switch to `iso-8859-1`\nusing the `charset` option:\n\n```javascript\nvar iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' });\nassert.equal(iso, '%E6=%E6');\n```\n\nCharacters that don't exist in `iso-8859-1` will be converted to numeric\nentities, similar to what browsers do:\n\n```javascript\nvar numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' });\nassert.equal(numeric, 'a=%26%239786%3B');\n```\n\nYou can use the `charsetSentinel` option to announce the character by\nincluding an `utf8=✓` parameter with the proper encoding if the checkmark,\nsimilar to what Ruby on Rails and others do when submitting forms.\n\n```javascript\nvar sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true });\nassert.equal(sentinel, 'utf8=%E2%9C%93\u0026a=%E2%98%BA');\n\nvar isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' });\nassert.equal(isoSentinel, 'utf8=%26%2310003%3B\u0026a=%E6');\n```\n\n### Dealing with special character sets\n\nBy default the encoding and decoding of characters is done in `utf-8`,\nand `iso-8859-1` support is also built in via the `charset` parameter.\n\nIf you wish to encode querystrings to a different character set (i.e.\n[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the\n[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library:\n\n```javascript\nvar encoder = require('qs-iconv/encoder')('shift_jis');\nvar shiftJISEncoded = qs.stringify({ a: 'こんにちは！' }, { encoder: encoder });\nassert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I');\n```\n\nThis also works for decoding of query strings:\n\n```javascript\nvar decoder = require('qs-iconv/decoder')('shift_jis');\nvar obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder });\nassert.deepEqual(obj, { a: 'こんにちは！' });\n```\n\n### RFC 3986 and RFC 1738 space encoding\n\nRFC3986 used as default option and encodes ' ' to *%20* which is backward compatible.\nIn the same time, output can be stringified as per RFC1738 with ' ' equal to '+'.\n\n```\nassert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');\nassert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c');\nassert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c');\n```\n\n## Security\n\nPlease email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.\n\n[1]: https://npmjs.org/package/qs\n[2]: http://versionbadg.es/ljharb/qs.svg\n[3]: https://api.travis-ci.org/ljharb/qs.svg\n[4]: https://travis-ci.org/ljharb/qs\n[5]: https://david-dm.org/ljharb/qs.svg\n[6]: https://david-dm.org/ljharb/qs\n[7]: https://david-dm.org/ljharb/qs/dev-status.svg\n[8]: https://david-dm.org/ljharb/qs?type=dev\n[9]: https://ci.testling.com/ljharb/qs.png\n[10]: https://ci.testling.com/ljharb/qs\n[11]: https://nodei.co/npm/qs.png?downloads=true\u0026stars=true\n[license-image]: http://img.shields.io/npm/l/qs.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/qs.svg\n[downloads-url]: http://npm-stat.com/charts.html?package=qs","funding_links":["https://tidelift.com/security"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilehero-archive%2Ftitanium-querystring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobilehero-archive%2Ftitanium-querystring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilehero-archive%2Ftitanium-querystring/lists"}