From 7e573a3f2d676c941866cc28716ef47244e72713 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 5 Sep 2022 12:31:05 -0400 Subject: [PATCH] feat: replace querystring with fast-querystring --- README.md | 2 +- index.js | 2 +- package.json | 1 + test/custom-querystring-parser.test.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 26221bb..a8a2e9a 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ const router = require('find-my-way')({ }) ``` -The default query string parser that find-my-way uses is the Node.js's core querystring module. You can change this default setting by passing the option querystringParser and use a custom one, such as [qs](https://www.npmjs.com/package/qs). +The default query string parser that find-my-way uses is [fast-querystring](https://www.npmjs.com/package/fast-querystring) module. You can change this default setting by passing the option querystringParser and use a custom one, such as [qs](https://www.npmjs.com/package/qs). ```js const qs = require('qs') diff --git a/index.js b/index.js index cece7a0..18ec1f0 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ const assert = require('assert') const http = require('http') -const querystring = require('querystring') +const querystring = require('fast-querystring') const isRegexSafe = require('safe-regex2') const deepEqual = require('fast-deep-equal') const { flattenNode, compressFlattenedNode, prettyPrintFlattenedNode, prettyPrintRoutesArray } = require('./lib/pretty-print') diff --git a/package.json b/package.json index 41833d3..818f202 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ }, "dependencies": { "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", "safe-regex2": "^2.0.0" }, "tsd": { diff --git a/test/custom-querystring-parser.test.js b/test/custom-querystring-parser.test.js index 4944233..e6792b5 100644 --- a/test/custom-querystring-parser.test.js +++ b/test/custom-querystring-parser.test.js @@ -2,7 +2,7 @@ const t = require('tap') const test = t.test -const querystring = require('querystring') +const querystring = require('fast-querystring') const FindMyWay = require('../') test('Custom querystring parser', t => {