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

slash

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slash - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

license

10

index.js
'use strict';
module.exports = function (str) {
var isExtendedLengthPath = /^\\\\\?\\/.test(str);
var hasNonAscii = /[^\x00-\x80]+/.test(str);
module.exports = input => {
const isExtendedLengthPath = /^\\\\\?\\/.test(input);
const hasNonAscii = /[^\u0000-\u0080]+/.test(input); // eslint-disable-line no-control-regex
if (isExtendedLengthPath || hasNonAscii) {
return str;
return input;
}
return str.replace(/\\/g, '/');
return input.replace(/\\/g, '/');
};
{
"name": "slash",
"version": "1.0.0",
"description": "Convert Windows backslash paths to slash paths",
"keywords": [
"path",
"seperator",
"sep",
"slash",
"backslash",
"windows",
"win"
],
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "http://sindresorhus.com"
},
"repository": "sindresorhus/slash",
"scripts": {
"test": "mocha"
},
"devDependencies": {
"mocha": "*"
},
"engines": {
"node": ">=0.10.0"
},
"license": "MIT",
"files": [
"index.js"
]
"name": "slash",
"version": "2.0.0",
"description": "Convert Windows backslash paths to slash paths",
"license": "MIT",
"repository": "sindresorhus/slash",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"path",
"seperator",
"sep",
"slash",
"backslash",
"windows",
"win"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
}

@@ -12,5 +12,5 @@ # slash [![Build Status](https://travis-ci.org/sindresorhus/slash.svg?branch=master)](https://travis-ci.org/sindresorhus/slash)

```sh
$ npm install --save slash
```
$ npm install slash
```

@@ -21,6 +21,6 @@

```js
var path = require('path');
var slash = require('slash');
const path = require('path');
const slash = require('slash');
var str = path.join('foo', 'bar');
const str = path.join('foo', 'bar');
// Unix => foo/bar

@@ -46,2 +46,2 @@ // Windows => foo\\bar

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)
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