Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

path-normalize

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

path-normalize - npm Package Compare versions

Comparing version 4.0.9 to 4.0.10

39

lib/index.js

@@ -28,6 +28,12 @@ "use strict";

var dots = 0;
var code;
var code; // eslint-disable-next-line fp/no-loops
for (var i = 0; i <= path.length; ++i) {
if (i < path.length) code = path.charCodeAt(i);else if (code === SLASH) break;else code = SLASH;
if (i < path.length) {
code = path.charCodeAt(i);
} else if (code === SLASH) {
break;
} else {
code = SLASH;
}

@@ -64,3 +70,8 @@ if (code === SLASH) {

if (allowAboveRoot) {
if (res.length > 0) res += '/..';else res = '..';
if (res.length > 0) {
res += '/..';
} else {
res = '..';
}
lastSegmentLength = 2;

@@ -101,3 +112,7 @@ }

var path = p;
if (path.length === 0) return '.';
if (path.length === 0) {
return '.';
}
var isAbsolute = path.charCodeAt(0) === SLASH;

@@ -107,5 +122,15 @@ var trailingSeparator = path.charCodeAt(path.length - 1) === SLASH;

path = posixNormalize(path, !isAbsolute);
if (path.length === 0 && !isAbsolute) path = '.';
if (path.length > 0 && trailingSeparator) path += '/';
if (isAbsolute) return '/' + path;
if (path.length === 0 && !isAbsolute) {
path = '.';
}
if (path.length > 0 && trailingSeparator) {
path += '/';
}
if (isAbsolute) {
return '/' + path;
}
return path;

@@ -112,0 +137,0 @@ };

10

package.json
{
"name": "path-normalize",
"description": "Zero-dependency browser-oriented path.normalize",
"version": "4.0.9",
"version": "4.0.10",
"author": {

@@ -28,3 +28,3 @@ "email": "zac@zacanger.com",

"test": "run-s -s test:lint test:tape",
"test:lint": "standard src",
"test:lint": "eslint -c .eslintrc.json src",
"test:tape": "babel-tape-runner src/test.js"

@@ -50,6 +50,8 @@ },

"babel-tape-runner": "3.0.0",
"eslint": "6.8.0",
"eslint-plugin-zacanger": "1.1.2",
"npm-run-all": "4.1.5",
"nyc": "15.0.0",
"sortpack": "2.1.1",
"standard": "14.3.1",
"prettier": "1.19.1",
"sortpack": "2.1.2",
"tape": "4.13.2"

@@ -56,0 +58,0 @@ },

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