Comparing version 2.0.1 to 2.0.2
@@ -5,3 +5,4 @@ const url = require('url'); | ||
const queryLines = function (parsedQuery) { | ||
return parsedQuery ? Object.keys(parsedQuery).sort().map(k => `${k}=${parsedQuery[k]}`).join('\n') : ''; | ||
const queryElement = key => parsedQuery[key] ? `${key}=${parsedQuery[key]}` : key; | ||
return parsedQuery ? Object.keys(parsedQuery).sort().map(queryElement).join('\n') : ''; | ||
}; | ||
@@ -8,0 +9,0 @@ |
{ | ||
"name": "fqs", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Pretty-print URLs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,3 +12,9 @@ const assert = require('assert'); | ||
const expectedNoEquals = [ | ||
'https://example.com/', | ||
'#/foo' | ||
].join('\n'); | ||
assert.equal(fqs('https://example.com/foo?d=3&c=2#b=1&a=0'), expected); | ||
assert.equal(fqs('https://example.com/#/foo'), expectedNoEquals); | ||
assert.equal(fqs(''), ''); |
Sorry, the diff of this file is not supported yet
21623
64