Skip to content

Commit 1ad68b6

Browse files
committed
fix: use correct types for the package
1 parent 4535136 commit 1ad68b6

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ test
66
benchmark
77
.idea
88
.github
9+
rome.json
10+
LICENSE

lib/index.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
declare namespace FastQuerystring {
2-
export function stringify(value: string): Record<string, any>;
3-
export function parse(value: Record<string, any>): string;
2+
export function stringify(value: Record<string, any>): string;
3+
export function parse(value: string): Record<string, any>;
44
}
5+
6+
export default FastQuerystring;

lib/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
const parse = require("./parse");
44
const stringify = require("./stringify");
55

6-
module.exports = {
6+
const fastQuerystring = {
77
parse,
88
stringify,
99
};
10+
11+
/**
12+
* Enable TS and JS support
13+
*
14+
* - `const qs = require('fast-querystring')`
15+
* - `import qs from 'fast-querystring'`
16+
*/
17+
module.exports = fastQuerystring;
18+
module.exports.default = fastQuerystring;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "lib/index.js",
66
"type": "commonjs",
7-
"types": "./lib/index.d.ts",
7+
"types": "lib/index.d.ts",
88
"scripts": {
99
"format": "rome format . --write",
1010
"format:ci": "rome format .",

0 commit comments

Comments
 (0)