@vxrn/query-string 1.1.275

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nate Wienert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,36 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var src_exports = {};
16
+ __export(src_exports, {
17
+ default: () => src_default,
18
+ parse: () => parse
19
+ });
20
+ module.exports = __toCommonJS(src_exports);
21
+ const parse = (queryString) => {
22
+ const params = new URLSearchParams(queryString), result = {};
23
+ return params.forEach((value, key) => {
24
+ result[key] ? Array.isArray(result[key]) ? result[key].push(value) : result[key] = [result[key], value] : result[key] = value;
25
+ }), result;
26
+ }, stringify = (obj) => {
27
+ const params = new URLSearchParams();
28
+ return Object.entries(obj).forEach(([key, value]) => {
29
+ Array.isArray(value) ? value.forEach((v) => params.append(key, v)) : params.append(key, value);
30
+ }), params.toString();
31
+ };
32
+ var src_default = {
33
+ parse,
34
+ stringify
35
+ };
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,MAAM,QAAQ,CAAC,gBAAwB;AAC5C,QAAM,SAAS,IAAI,gBAAgB,WAAW,GACxC,SAA4C,CAAC;AAEnD,gBAAO,QAAQ,CAAC,OAAO,QAAQ;AAC7B,IAAI,OAAO,GAAG,IACR,MAAM,QAAQ,OAAO,GAAG,CAAC,IACzB,OAAO,GAAG,EAAe,KAAK,KAAK,IAErC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,GAAa,KAAK,IAG7C,OAAO,GAAG,IAAI;AAAA,EAElB,CAAC,GAEM;AACT,GAGM,YAAY,CAAC,QAA2C;AAC5D,QAAM,SAAS,IAAI,gBAAgB;AAEnC,gBAAO,QAAQ,GAAG,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC5C,IAAI,MAAM,QAAQ,KAAK,IACrB,MAAM,QAAQ,CAAC,MAAM,OAAO,OAAO,KAAK,CAAC,CAAC,IAE1C,OAAO,OAAO,KAAK,KAAK;AAAA,EAE5B,CAAC,GAEM,OAAO,SAAS;AACzB;AAEA,IAAO,cAAQ;AAAA,EACb;AAAA,EACA;AACF;",
5
+ "names": []
6
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: !0 });
10
+ }, __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from == "object" || typeof from == "function")
12
+ for (let key of __getOwnPropNames(from))
13
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ return to;
15
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")), __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
+ var index_native_exports = {};
24
+ __export(index_native_exports, {
25
+ default: () => index_native_default
26
+ });
27
+ module.exports = __toCommonJS(index_native_exports);
28
+ var import_query_string = __toESM(require("query-string"));
29
+ __reExport(index_native_exports, require("query-string"), module.exports);
30
+ var index_native_default = import_query_string.default;
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ ...require("query-string")
34
+ });
35
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Users/n8/vxrn/packages/query-string/src/index.native.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;0BAAe;AAEf,iCAAc,yBAFd;AAIA,IAAA,uBAAeA,oBAAAA;",
5
+ "names": ["qs"]
6
+ }
@@ -0,0 +1,20 @@
1
+ const parse = (queryString) => {
2
+ const params = new URLSearchParams(queryString), result = {};
3
+ return params.forEach((value, key) => {
4
+ result[key] ? Array.isArray(result[key]) ? result[key].push(value) : result[key] = [result[key], value] : result[key] = value;
5
+ }), result;
6
+ }, stringify = (obj) => {
7
+ const params = new URLSearchParams();
8
+ return Object.entries(obj).forEach(([key, value]) => {
9
+ Array.isArray(value) ? value.forEach((v) => params.append(key, v)) : params.append(key, value);
10
+ }), params.toString();
11
+ };
12
+ var src_default = {
13
+ parse,
14
+ stringify
15
+ };
16
+ export {
17
+ src_default as default,
18
+ parse
19
+ };
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.tsx"],
4
+ "mappings": "AACO,MAAM,QAAQ,CAAC,gBAAwB;AAC5C,QAAM,SAAS,IAAI,gBAAgB,WAAW,GACxC,SAA4C,CAAC;AAEnD,gBAAO,QAAQ,CAAC,OAAO,QAAQ;AAC7B,IAAI,OAAO,GAAG,IACR,MAAM,QAAQ,OAAO,GAAG,CAAC,IACzB,OAAO,GAAG,EAAe,KAAK,KAAK,IAErC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,GAAa,KAAK,IAG7C,OAAO,GAAG,IAAI;AAAA,EAElB,CAAC,GAEM;AACT,GAGM,YAAY,CAAC,QAA2C;AAC5D,QAAM,SAAS,IAAI,gBAAgB;AAEnC,gBAAO,QAAQ,GAAG,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC5C,IAAI,MAAM,QAAQ,KAAK,IACrB,MAAM,QAAQ,CAAC,MAAM,OAAO,OAAO,KAAK,CAAC,CAAC,IAE1C,OAAO,OAAO,KAAK,KAAK;AAAA,EAE5B,CAAC,GAEM,OAAO,SAAS;AACzB;AAEA,IAAO,cAAQ;AAAA,EACb;AAAA,EACA;AACF;",
5
+ "names": []
6
+ }
@@ -0,0 +1,19 @@
1
+ const parse = queryString => {
2
+ const params = new URLSearchParams(queryString),
3
+ result = {};
4
+ return params.forEach((value, key) => {
5
+ result[key] ? Array.isArray(result[key]) ? result[key].push(value) : result[key] = [result[key], value] : result[key] = value;
6
+ }), result;
7
+ },
8
+ stringify = obj => {
9
+ const params = new URLSearchParams();
10
+ return Object.entries(obj).forEach(([key, value]) => {
11
+ Array.isArray(value) ? value.forEach(v => params.append(key, v)) : params.append(key, value);
12
+ }), params.toString();
13
+ };
14
+ var src_default = {
15
+ parse,
16
+ stringify
17
+ };
18
+ export { src_default as default, parse };
19
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["parse","queryString","params","URLSearchParams","result","forEach","value","key","Array","isArray","push","stringify","obj","Object","entries","v","append","toString","src_default"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AACO,MAAMA,KAAA,GAASC,WAAA,IAAwB;IAC5C,MAAMC,MAAA,GAAS,IAAIC,eAAA,CAAgBF,WAAW;MACxCG,MAAA,GAA4C,CAAC;IAEnD,OAAAF,MAAA,CAAOG,OAAA,CAAQ,CAACC,KAAA,EAAOC,GAAA,KAAQ;MACzBH,MAAA,CAAOG,GAAG,IACRC,KAAA,CAAMC,OAAA,CAAQL,MAAA,CAAOG,GAAG,CAAC,IACzBH,MAAA,CAAOG,GAAG,EAAeG,IAAA,CAAKJ,KAAK,IAErCF,MAAA,CAAOG,GAAG,IAAI,CAACH,MAAA,CAAOG,GAAG,GAAaD,KAAK,IAG7CF,MAAA,CAAOG,GAAG,IAAID,KAAA;IAElB,CAAC,GAEMF,MAAA;EACT;EAGMO,SAAA,GAAaC,GAAA,IAA2C;IAC5D,MAAMV,MAAA,GAAS,IAAIC,eAAA,CAAgB;IAEnC,OAAAU,MAAA,CAAOC,OAAA,CAAQF,GAAG,EAAEP,OAAA,CAAQ,CAAC,CAACE,GAAA,EAAKD,KAAK,MAAM;MACxCE,KAAA,CAAMC,OAAA,CAAQH,KAAK,IACrBA,KAAA,CAAMD,OAAA,CAASU,CAAA,IAAMb,MAAA,CAAOc,MAAA,CAAOT,GAAA,EAAKQ,CAAC,CAAC,IAE1Cb,MAAA,CAAOc,MAAA,CAAOT,GAAA,EAAKD,KAAK;IAE5B,CAAC,GAEMJ,MAAA,CAAOe,QAAA,CAAS;EACzB;AAEA,IAAOC,WAAA,GAAQ;EACblB,KAAA;EACAW;AACF","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import qs from "query-string";
2
+ export * from "query-string";
3
+ var index_native_default = qs;
4
+ export { index_native_default as default };
5
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["qs","index_native_default"],"sources":["../../src/Users/n8/vxrn/packages/query-string/src/index.native.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,EAAA,MAAQ;AAEf,cAAc;AAEd,IAAAC,oBAAA,GAAeD,EAAA","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@vxrn/query-string",
3
+ "version": "1.1.275",
4
+ "sideEffects": false,
5
+ "source": "src/index.ts",
6
+ "types": "./types/index.d.ts",
7
+ "main": "dist/cjs",
8
+ "module": "dist/esm",
9
+ "exports": {
10
+ "./package.json": "./package.json",
11
+ ".": {
12
+ "react-native-import": "./dist/esm/index.native.js",
13
+ "react-native": "./dist/cjs/index.native.js",
14
+ "types": "./types/index.d.ts",
15
+ "import": "./dist/esm/index.mjs",
16
+ "require": "./dist/cjs/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "src",
21
+ "types",
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "tamagui-build",
26
+ "watch": "tamagui-build --watch",
27
+ "lint": "npx biome check src",
28
+ "lint:fix": "npx biome check --apply-unsafe src",
29
+ "clean": "tamagui-build clean",
30
+ "clean:build": "tamagui-build clean:build"
31
+ },
32
+ "dependencies": {
33
+ "query-string": "^9.1.0"
34
+ },
35
+ "devDependencies": {
36
+ "@tamagui/build": "^1.112.13"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ }
41
+ }
@@ -0,0 +1,5 @@
1
+ import qs from 'query-string'
2
+
3
+ export * from 'query-string'
4
+
5
+ export default qs
package/src/index.tsx ADDED
@@ -0,0 +1,39 @@
1
+ // Parse a query string
2
+ export const parse = (queryString: string) => {
3
+ const params = new URLSearchParams(queryString)
4
+ const result: Record<string, string | string[]> = {}
5
+
6
+ params.forEach((value, key) => {
7
+ if (result[key]) {
8
+ if (Array.isArray(result[key])) {
9
+ ;(result[key] as string[]).push(value)
10
+ } else {
11
+ result[key] = [result[key] as string, value]
12
+ }
13
+ } else {
14
+ result[key] = value
15
+ }
16
+ })
17
+
18
+ return result
19
+ }
20
+
21
+ // Stringify an object to query string
22
+ const stringify = (obj: Record<string, string | string[]>) => {
23
+ const params = new URLSearchParams()
24
+
25
+ Object.entries(obj).forEach(([key, value]) => {
26
+ if (Array.isArray(value)) {
27
+ value.forEach((v) => params.append(key, v))
28
+ } else {
29
+ params.append(key, value)
30
+ }
31
+ })
32
+
33
+ return params.toString()
34
+ }
35
+
36
+ export default {
37
+ parse,
38
+ stringify,
39
+ }
@@ -0,0 +1,7 @@
1
+ export declare const parse: (queryString: string) => Record<string, string | string[]>;
2
+ declare const _default: {
3
+ parse: (queryString: string) => Record<string, string | string[]>;
4
+ stringify: (obj: Record<string, string | string[]>) => string;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,eAAO,MAAM,KAAK,gBAAiB,MAAM,sCAiBxC,CAAA;;yBAjBkC,MAAM;qBAoBjB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;;AAczD,wBAGC"}
@@ -0,0 +1,4 @@
1
+ import qs from 'query-string';
2
+ export * from 'query-string';
3
+ export default qs;
4
+ //# sourceMappingURL=index.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,cAAc,CAAA;AAE7B,cAAc,cAAc,CAAA;AAE5B,eAAe,EAAE,CAAA"}