Socket
Socket
Sign inDemoInstall

bare-path

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-path - npm Package Compare versions

Comparing version 1.0.6 to 1.1.0

46

index.js
const posix = makePath(false)
const win32 = makePath(true)
posix.win32 = win32
win32.posix = posix
posix.win32 = win32.win32 = win32
posix.posix = win32.posix = posix

@@ -12,9 +12,6 @@ module.exports = process.platform === 'win32' ? win32 : posix

path.posix = path
path.win32 = path
const sep = path.sep = windows ? '\\' : '/'
if (windows) {
path.isAbsolute = function isAbsolute (p) {
path.isAbsolute = windows
? function isAbsolute (p) {
if (p.length === 0) return false

@@ -25,4 +22,8 @@ return (p[0] === '\\' || p[0] === '/') ||

}
: function isAbsolute (p) {
return p.length > 0 && p[0] === '/'
}
path.root = function root (p) {
path.root = windows
? function root (p) {
if (p.length === 0) return ''

@@ -38,11 +39,28 @@

}
} else {
path.isAbsolute = function isAbsolute (p) {
return p.length > 0 && p[0] === '/'
: function root (p) {
return path.isAbsolute(p) ? '/' : ''
}
path.root = function root (p) {
return path.isAbsolute(p) ? '/' : ''
path.toNamespacedPath = windows
? function toNamespacedPath (p) {
if (p.length === 0) return ''
const r = path.resolve(p)
if (r.length <= 2) return p
if (r[0] === '\\') {
if (r[1] === '\\') {
if (r[2] !== '?' && r[2] !== '.') {
return '\\\\?\\UNC\\' + r.slice(2)
}
}
} else if (r[1] === ':' && (r[2] === '\\' || r[2] === '/')) {
return '\\\\?\\' + r
}
return p
}
}
: function toNamespacedPath (p) {
return p
}

@@ -49,0 +67,0 @@ path.basename = function basename (p) {

{
"name": "bare-path",
"version": "1.0.6",
"version": "1.1.0",
"description": "Path manipulation library for JavaScript",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc