mirror of
https://github.com/Raghu-Ch/nodeRestAPI.git
synced 2026-02-10 20:53:02 -05:00
initial commit
This commit is contained in:
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 === '\\'));
|
||||
}
|
||||
Reference in New Issue
Block a user