source: trip-planner-front/node_modules/memory-fs/lib/join.js@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 641 bytes
RevLine 
[6a3a178]1var normalize = require("./normalize");
2
3var absoluteWinRegExp = /^[A-Z]:([\\\/]|$)/i;
4var absoluteNixRegExp = /^\//i;
5
6module.exports = function join(path, request) {
7 if(!request) return normalize(path);
8 if(absoluteWinRegExp.test(request)) return normalize(request.replace(/\//g, "\\"));
9 if(absoluteNixRegExp.test(request)) return normalize(request);
10 if(path == "/") return normalize(path + request);
11 if(absoluteWinRegExp.test(path)) return normalize(path.replace(/\//g, "\\") + "\\" + request.replace(/\//g, "\\"));
12 if(absoluteNixRegExp.test(path)) return normalize(path + "/" + request);
13 return normalize(path + "/" + request);
14};
Note: See TracBrowser for help on using the repository browser.