Comparing version 4.0.0 to 5.0.0
{ | ||
"name": "qs", | ||
"main": "dist/qs.js", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"homepage": "https://github.com/hapijs/qs", | ||
@@ -6,0 +6,0 @@ "authors": [ |
## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=open) | ||
## [**4.0.1**](https://github.com/hapijs/qs/issues?milestone=27&state=open) | ||
- [**#100**](https://github.com/hapijs/qs/issues/100) include dist to npm | ||
## [**4.0.0**](https://github.com/hapijs/qs/issues?milestone=26&state=closed) | ||
- [**#98**](https://github.com/hapijs/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional | ||
## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=closed) | ||
- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" | ||
## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed) | ||
- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties | ||
- [**#77**](https://github.com/hapijs/qs/issues/77) Perf boost | ||
- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing | ||
- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties | ||
- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object | ||
@@ -10,0 +16,0 @@ - [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option |
@@ -15,3 +15,4 @@ // Load modules | ||
plainObjects: false, | ||
allowPrototypes: false | ||
allowPrototypes: false, | ||
allowDots: false | ||
}; | ||
@@ -161,3 +162,3 @@ | ||
options.parseArrays = options.parseArrays !== false; | ||
options.allowDots = options.allowDots !== false; | ||
options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; | ||
options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; | ||
@@ -164,0 +165,0 @@ options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; |
{ | ||
"name": "qs", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "A querystring parser that supports nesting and arrays, with a depth limit", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/hapijs/qs", |
@@ -50,6 +50,6 @@ /* eslint no-extend-native:0 */ | ||
it('allows disabling dot notation', function (done) { | ||
it('allows enabling dot notation', function (done) { | ||
expect(Qs.parse('a.b=c')).to.deep.equal({ a: { b: 'c' } }); | ||
expect(Qs.parse('a.b=c', { allowDots: false })).to.deep.equal({ 'a.b': 'c' }); | ||
expect(Qs.parse('a.b=c')).to.deep.equal({ 'a.b': 'c' }); | ||
expect(Qs.parse('a.b=c', { allowDots: true })).to.deep.equal({ a: { b: 'c' } }); | ||
done(); | ||
@@ -179,12 +179,12 @@ }); | ||
expect(Qs.parse('foo[0].baz=bar&fool.bad=baz')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); | ||
expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); | ||
expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz')).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); | ||
expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2')).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] }); | ||
expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2')).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] }); | ||
expect(Qs.parse('foo.bad=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); | ||
expect(Qs.parse('foo.bad=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); | ||
expect(Qs.parse('foo[]=bar&foo.bad=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); | ||
expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); | ||
expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); | ||
expect(Qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); | ||
expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); | ||
expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); | ||
expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] }); | ||
expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] }); | ||
expect(Qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); | ||
expect(Qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); | ||
expect(Qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true })).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); | ||
expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); | ||
expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true })).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); | ||
done(); | ||
@@ -377,3 +377,3 @@ }); | ||
var result = Qs.parse(input); | ||
var result = Qs.parse(input, { allowDots: true }); | ||
@@ -380,0 +380,0 @@ expect(result).to.deep.equal(expected); |
@@ -219,4 +219,5 @@ /* eslint no-extend-native:0 */ | ||
delete global.Buffer; | ||
expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d'); | ||
var result = Qs.stringify({ a: 'b', c: 'd' }); | ||
global.Buffer = tempBuffer; | ||
expect(result).to.equal('a=b&c=d'); | ||
done(); | ||
@@ -223,0 +224,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70659
17
1346
2