--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
13
node_modules/remove-trailing-separator/index.js
generated
vendored
Normal file
13
node_modules/remove-trailing-separator/index.js
generated
vendored
Normal file
|
|
@ -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 === '\\'));
|
||||
}
|
||||
Loading…
Reference in a new issue