Comparing version 2.1.0 to 2.1.1
19
index.js
@@ -95,2 +95,7 @@ /* | ||
// The '..' prefix is removed above so add it back if need be | ||
if (p1.indexOf('..') === 0) { | ||
combined.unshift('..'); | ||
} | ||
return combined.length === 0 ? '' : combined.join('/'); | ||
@@ -115,2 +120,11 @@ } | ||
function combineURIs (u1, u2) { | ||
// Empty out paths to the current location so we do not attempt to join them unnecessarily | ||
if (u1 === '.') { | ||
u1 = undefined; | ||
} | ||
if (u2 === '.') { | ||
u2 = undefined; | ||
} | ||
// Convert Windows paths | ||
@@ -138,3 +152,3 @@ if (isType(u1, 'String')) { | ||
// Join the paths | ||
combinedDetails.path = URI.normalize(combinePaths(u1Details.path, u2Details.path)); | ||
combinedDetails.path = combinePaths(u1Details.path, u2Details.path); | ||
@@ -151,3 +165,4 @@ // Join query parameters | ||
return URI.serialize(combinedDetails); | ||
// URI.serialize will remove the '../' prefix | ||
return (combinedDetails.path.indexOf('../') === 0 ? '../' : '') + URI.serialize(combinedDetails); | ||
} | ||
@@ -154,0 +169,0 @@ |
{ | ||
"name": "json-refs", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Various utilities for JSON References (http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,2 +76,10 @@ # json-refs | ||
If you plan on using the `json-refs` CLI executable, you can install json-refs globally like this: | ||
``` | ||
npm install json-refs --global | ||
``` | ||
After this, feel free to run `json-refs help` to see what you can do or view the CLI documentation linked above | ||
[bower]: http://bower.io/ | ||
@@ -78,0 +86,0 @@ [issue-42]: https://github.com/whitlockjc/json-refs/issues/42 |
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
54862
1154
90