path-browser-wrapper
Advanced tools
Comparing version
13
os.js
let os; | ||
const ua = window.navigator.userAgent; | ||
if(ua) { | ||
if (ua.includes("Linux")) { | ||
os = "Linux"; | ||
} else if (ua.includes("Windows")) { | ||
if (ua) { | ||
if (ua.includes('Linux')) { | ||
os = 'Linux'; | ||
} else if (ua.includes('Windows')) { | ||
os = "WINNT"; | ||
} else if (ua.includes("Mac")) { | ||
os = "Darwin"; | ||
} else if (ua.includes('Mac')) { | ||
os = 'Darwin'; | ||
} | ||
@@ -11,0 +12,0 @@ } |
{ | ||
"name": "path-browser-wrapper", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A wrapper module to allow NodeJS ’path’ module to execute in the browser context.", | ||
@@ -5,0 +5,0 @@ "main": "path.js", |
@@ -7,5 +7,6 @@ /** | ||
const isWin = require("os") === "WINNT"; | ||
const win32 = Object.assign({}, require("path").win32); | ||
const posix = Object.assign({}, require("path").posix); | ||
const path = require('path'); | ||
const isWin = require('./os') === "WINNT"; | ||
const win32 = Object.assign({}, path.win32); | ||
const posix = Object.assign({}, path.posix); | ||
@@ -18,2 +19,3 @@ win32.resolve = posix.resolve = undefined; | ||
new URL(url); | ||
return true; | ||
@@ -20,0 +22,0 @@ } catch (e) { |
15703
330.34%7
16.67%39
2.63%