Comparing version 1.0.1 to 2.0.0
@@ -7,6 +7,6 @@ #! /usr/bin/env node | ||
if (result) { | ||
console.log(result); | ||
process.exit(0); | ||
console.log(result); | ||
process.exit(0); | ||
} else { | ||
process.exit(1); | ||
process.exit(1); | ||
} |
10
lib.js
@@ -19,8 +19,8 @@ const url = require('url'); | ||
if (!u.protocol) { | ||
return ''; | ||
return ''; | ||
} else { | ||
return [`${u.protocol}//${u.auth}${u.host}${u.pathname}${!isEmpty(u.query) ? '?' : ''}`, | ||
u.query ? queryLines(u.query) : '', | ||
!isEmpty(hash) ? '#' + queryLines(hash) : '' | ||
].filter(line => line.length > 0).join('\n'); | ||
return [`${u.protocol}//${u.auth}${u.host}${u.pathname}`, | ||
!isEmpty(u.query) ? '?' + queryLines(u.query) : '', | ||
!isEmpty(hash) ? '#' + queryLines(hash) : '' | ||
].filter(line => line.length > 0).join('\n'); | ||
} | ||
@@ -27,0 +27,0 @@ }; |
{ | ||
"name": "fqs", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Pretty-print URLs", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "node test/test.js" | ||
"test": "eslint . && node test/test.js" | ||
}, | ||
@@ -24,3 +24,4 @@ "repository": { | ||
"devDependencies": { | ||
"assert": "^1.4.1" | ||
"assert": "^1.4.1", | ||
"eslint": "^3.5.0" | ||
}, | ||
@@ -27,0 +28,0 @@ "dependencies": { |
@@ -5,4 +5,4 @@ const assert = require('assert'); | ||
const expected = [ | ||
'https://example.com/foo?', | ||
'c=2', | ||
'https://example.com/foo', | ||
'?c=2', | ||
'd=3', | ||
@@ -9,0 +9,0 @@ '#a=0', |
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
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
21351
8
56
2