From abd94a7f5a50f43c797a11b53549ae48fff667c3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Oct 2016 03:43:44 +0200 Subject: add node_modules to address #4364 --- node_modules/remove-trailing-separator/history.md | 9 ++ node_modules/remove-trailing-separator/index.js | 13 +++ node_modules/remove-trailing-separator/license | 3 + .../remove-trailing-separator/package.json | 100 +++++++++++++++++++++ node_modules/remove-trailing-separator/readme.md | 51 +++++++++++ 5 files changed, 176 insertions(+) create mode 100644 node_modules/remove-trailing-separator/history.md create mode 100644 node_modules/remove-trailing-separator/index.js create mode 100644 node_modules/remove-trailing-separator/license create mode 100644 node_modules/remove-trailing-separator/package.json create mode 100644 node_modules/remove-trailing-separator/readme.md (limited to 'node_modules/remove-trailing-separator') diff --git a/node_modules/remove-trailing-separator/history.md b/node_modules/remove-trailing-separator/history.md new file mode 100644 index 000000000..a9ca22235 --- /dev/null +++ b/node_modules/remove-trailing-separator/history.md @@ -0,0 +1,9 @@ +## History + +### 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. \ No newline at end of file diff --git a/node_modules/remove-trailing-separator/index.js b/node_modules/remove-trailing-separator/index.js new file mode 100644 index 000000000..1ed8e932d --- /dev/null +++ b/node_modules/remove-trailing-separator/index.js @@ -0,0 +1,13 @@ +const isWin = process.platform === 'win32'; + +module.exports = function (str) { + while (endsInSeparator(str)) { + str = str.slice(0, -1); + } + return str; +}; + +function endsInSeparator(str) { + var last = str[str.length - 1]; + return str.length > 1 && (last === '/' || (isWin && last === '\\')); +} diff --git a/node_modules/remove-trailing-separator/license b/node_modules/remove-trailing-separator/license new file mode 100644 index 000000000..a169aff77 --- /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 000000000..da662cddd --- /dev/null +++ b/node_modules/remove-trailing-separator/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "remove-trailing-separator@^1.0.1", + "scope": null, + "escapedName": "remove-trailing-separator", + "name": "remove-trailing-separator", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/vinyl" + ] + ], + "_from": "remove-trailing-separator@>=1.0.1 <2.0.0", + "_id": "remove-trailing-separator@1.0.1", + "_inCache": true, + "_location": "/remove-trailing-separator", + "_nodeVersion": "6.4.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/remove-trailing-separator-1.0.1.tgz_1474797962066_0.45308714639395475" + }, + "_npmUser": { + "name": "darsain", + "email": "darsain@gmail.com" + }, + "_npmVersion": "3.10.5", + "_phantomChildren": {}, + "_requested": { + "raw": "remove-trailing-separator@^1.0.1", + "scope": null, + "escapedName": "remove-trailing-separator", + "name": "remove-trailing-separator", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/vinyl" + ], + "_resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz", + "_shasum": "615ebb96af559552d4bf4057c8436d486ab63cc4", + "_shrinkwrap": null, + "_spec": "remove-trailing-separator@^1.0.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/vinyl", + "author": { + "name": "darsain" + }, + "bugs": { + "url": "https://github.com/darsain/remove-trailing-separator/issues" + }, + "dependencies": {}, + "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" + }, + "directories": {}, + "dist": { + "shasum": "615ebb96af559552d4bf4057c8436d486ab63cc4", + "tarball": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "8a5da3ac1efb1314d55e50a2a923b068d500d77a", + "homepage": "https://github.com/darsain/remove-trailing-separator#readme", + "keywords": [ + "remove", + "strip", + "trailing", + "separator" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "darsain", + "email": "darsain@gmail.com" + } + ], + "name": "remove-trailing-separator", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "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.0.1" +} diff --git a/node_modules/remove-trailing-separator/readme.md b/node_modules/remove-trailing-separator/readme.md new file mode 100644 index 000000000..8c643d49f --- /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('') // '' +``` + +## Backslash, or win32 separator + +`\` is considered a separator only on WIN32 systems. All UNIX compliant systems +see backslash as a valid file name character, so it would break UNIX compliance +to remove it there. + +In practice, this means that this code will return different things depending on +what system it runs on: + +``` +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 \ No newline at end of file -- cgit v1.2.3