@apidevtools/json-schema-ref-parser
Advanced tools
Comparing version
@@ -93,13 +93,16 @@ "use strict"; | ||
function cwd() { | ||
if (typeof window !== "undefined") { | ||
if (typeof window !== "undefined" && window.location) { | ||
return location.href; | ||
} | ||
const path = process.cwd(); | ||
const lastChar = path.slice(-1); | ||
if (lastChar === "/" || lastChar === "\\") { | ||
return path; | ||
if (typeof process !== "undefined" && process.cwd) { | ||
const path = process.cwd(); | ||
const lastChar = path.slice(-1); | ||
if (lastChar === "/" || lastChar === "\\") { | ||
return path; | ||
} | ||
else { | ||
return path + "/"; | ||
} | ||
} | ||
else { | ||
return path + "/"; | ||
} | ||
return "/"; | ||
} | ||
@@ -106,0 +109,0 @@ /** |
@@ -47,14 +47,17 @@ import convertPathToPosix from "./convert-path-to-posix"; | ||
export function cwd() { | ||
if (typeof window !== "undefined") { | ||
if (typeof window !== "undefined" && window.location) { | ||
return location.href; | ||
} | ||
const path = process.cwd(); | ||
if (typeof process !== "undefined" && process.cwd) { | ||
const path = process.cwd(); | ||
const lastChar = path.slice(-1); | ||
if (lastChar === "/" || lastChar === "\\") { | ||
return path; | ||
} else { | ||
return path + "/"; | ||
const lastChar = path.slice(-1); | ||
if (lastChar === "/" || lastChar === "\\") { | ||
return path; | ||
} else { | ||
return path + "/"; | ||
} | ||
} | ||
return "/"; | ||
} | ||
@@ -61,0 +64,0 @@ |
{ | ||
"name": "@apidevtools/json-schema-ref-parser", | ||
"version": "13.0.1", | ||
"version": "13.0.2", | ||
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers", | ||
@@ -5,0 +5,0 @@ "scripts": { |
329540
0.07%7856
0.08%