aboutsummaryrefslogtreecommitdiff
path: root/node_modules/remove-trailing-separator
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/remove-trailing-separator')
-rw-r--r--node_modules/remove-trailing-separator/history.md17
-rw-r--r--node_modules/remove-trailing-separator/index.js17
-rw-r--r--node_modules/remove-trailing-separator/license3
-rw-r--r--node_modules/remove-trailing-separator/package.json68
-rw-r--r--node_modules/remove-trailing-separator/readme.md51
5 files changed, 156 insertions, 0 deletions
diff --git a/node_modules/remove-trailing-separator/history.md b/node_modules/remove-trailing-separator/history.md
new file mode 100644
index 0000000..e15e8a4
--- /dev/null
+++ b/node_modules/remove-trailing-separator/history.md
@@ -0,0 +1,17 @@
+## History
+
+### 1.1.0 - 16th Aug 2017
+
+- [f4576e3](https://github.com/darsain/remove-trailing-separator/commit/f4576e3638c39b794998b533fffb27854dcbee01) Implement faster slash slicing
+
+### 1.0.2 - 07th Jun 2017
+
+- [8e13ecb](https://github.com/darsain/remove-trailing-separator/commit/8e13ecbfd7b9f5fdf97c5d5ff923e4718b874e31) ES5 compatibility
+
+### 1.0.1 - 25th Sep 2016
+
+- [b78606d](https://github.com/darsain/remove-trailing-separator/commit/af90b4e153a4527894741af6c7005acaeb78606d) Remove backslash only on win32 systems
+
+### 1.0.0 - 24th Sep 2016
+
+Initial release.
diff --git a/node_modules/remove-trailing-separator/index.js b/node_modules/remove-trailing-separator/index.js
new file mode 100644
index 0000000..512306b
--- /dev/null
+++ b/node_modules/remove-trailing-separator/index.js
@@ -0,0 +1,17 @@
+var isWin = process.platform === 'win32';
+
+module.exports = function (str) {
+ var i = str.length - 1;
+ if (i < 2) {
+ return str;
+ }
+ while (isSeparator(str, i)) {
+ i--;
+ }
+ return str.substr(0, i + 1);
+};
+
+function isSeparator(str, i) {
+ var char = str[i];
+ return i > 0 && (char === '/' || (isWin && char === '\\'));
+}
diff --git a/node_modules/remove-trailing-separator/license b/node_modules/remove-trailing-separator/license
new file mode 100644
index 0000000..a169aff
--- /dev/null
+++ b/node_modules/remove-trailing-separator/license
@@ -0,0 +1,3 @@
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file
diff --git a/node_modules/remove-trailing-separator/package.json b/node_modules/remove-trailing-separator/package.json
new file mode 100644
index 0000000..70cd347
--- /dev/null
+++ b/node_modules/remove-trailing-separator/package.json
@@ -0,0 +1,68 @@
+{
+ "_args": [
+ [
+ "/home/dstaesse/git/website"
+ ]
+ ],
+ "_development": true,
+ "_from": "[email protected]",
+ "_id": "[email protected]",
+ "_inBundle": false,
+ "_integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
+ "_location": "/remove-trailing-separator",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "[email protected]",
+ "name": "remove-trailing-separator",
+ "escapedName": "remove-trailing-separator",
+ "rawSpec": "1.1.0",
+ "saveSpec": null,
+ "fetchSpec": "1.1.0"
+ },
+ "_requiredBy": [
+ "/normalize-path"
+ ],
+ "_resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
+ "_spec": "1.1.0",
+ "_where": "/home/dstaesse/git/website",
+ "author": {
+ "name": "darsain"
+ },
+ "bugs": {
+ "url": "https://github.com/darsain/remove-trailing-separator/issues"
+ },
+ "description": "Removes separators from the end of the string.",
+ "devDependencies": {
+ "ava": "^0.16.0",
+ "coveralls": "^2.11.14",
+ "nyc": "^8.3.0",
+ "xo": "^0.16.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/darsain/remove-trailing-separator#readme",
+ "keywords": [
+ "remove",
+ "strip",
+ "trailing",
+ "separator"
+ ],
+ "license": "ISC",
+ "main": "index.js",
+ "name": "remove-trailing-separator",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/darsain/remove-trailing-separator.git"
+ },
+ "scripts": {
+ "lint": "xo",
+ "pretest": "npm run lint",
+ "report": "nyc report --reporter=html",
+ "test": "nyc ava"
+ },
+ "version": "1.1.0"
+}
diff --git a/node_modules/remove-trailing-separator/readme.md b/node_modules/remove-trailing-separator/readme.md
new file mode 100644
index 0000000..747086a
--- /dev/null
+++ b/node_modules/remove-trailing-separator/readme.md
@@ -0,0 +1,51 @@
+# remove-trailing-separator
+
+[![NPM version][npm-img]][npm-url] [![Build Status: Linux][travis-img]][travis-url] [![Build Status: Windows][appveyor-img]][appveyor-url] [![Coverage Status][coveralls-img]][coveralls-url]
+
+Removes all separators from the end of a string.
+
+## Install
+
+```
+npm install remove-trailing-separator
+```
+
+## Examples
+
+```js
+const removeTrailingSeparator = require('remove-trailing-separator');
+
+removeTrailingSeparator('/foo/bar/') // '/foo/bar'
+removeTrailingSeparator('/foo/bar///') // '/foo/bar'
+
+// leaves only/last separator
+removeTrailingSeparator('/') // '/'
+removeTrailingSeparator('///') // '/'
+
+// returns empty string
+removeTrailingSeparator('') // ''
+```
+
+## Notable backslash, or win32 separator behavior
+
+`\` is considered a separator only on WIN32 systems. All POSIX compliant systems
+see backslash as a valid file name character, so it would break POSIX compliance
+to remove it there.
+
+In practice, this means that this code will return different things depending on
+what system it runs on:
+
+```js
+removeTrailingSeparator('\\foo\\')
+// UNIX => '\\foo\\'
+// WIN32 => '\\foo'
+```
+
+[npm-url]: https://npmjs.org/package/remove-trailing-separator
+[npm-img]: https://badge.fury.io/js/remove-trailing-separator.svg
+[travis-url]: https://travis-ci.org/darsain/remove-trailing-separator
+[travis-img]: https://travis-ci.org/darsain/remove-trailing-separator.svg?branch=master
+[appveyor-url]: https://ci.appveyor.com/project/darsain/remove-trailing-separator/branch/master
+[appveyor-img]: https://ci.appveyor.com/api/projects/status/wvg9a93rrq95n2xl/branch/master?svg=true
+[coveralls-url]: https://coveralls.io/github/darsain/remove-trailing-separator?branch=master
+[coveralls-img]: https://coveralls.io/repos/github/darsain/remove-trailing-separator/badge.svg?branch=master