refactor(Cypress): add nodemodules

This commit is contained in:
2021-09-02 17:18:41 +02:00
parent 1aa57bbd0a
commit bc6e1bc12e
4238 changed files with 340975 additions and 8 deletions

48
node_modules/parents/index.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
var pathPlatform = require('path-platform');
module.exports = function (cwd, opts) {
if (cwd === undefined) cwd = process.cwd();
if (!opts) opts = {};
var platform = opts.platform || process.platform;
var isWindows = /^win/.test(platform);
var path = isWindows ? pathPlatform.win32 : pathPlatform;
var normalize = !isWindows ? path.normalize :
path.normalize('c:') === 'c:.' ? fixNormalize(path.normalize) :
path.normalize;
var sep = isWindows ? /[\\\/]/ : '/';
var init = isWindows ? '' : '/';
var join = function (x, y) {
var ps = [ x, y ].filter(function (p) {
return p && typeof p === 'string'
});
return normalize(ps.join(isWindows ? '\\' : '/'));
};
var res = normalize(cwd)
.split(sep)
.reduce(function (acc,dir,ix) {
return acc.concat(join(acc[ix], dir))
}, [init])
.slice(1)
.reverse()
;
if (res[0] === res[1]) return [ res[0] ];
if (isWindows && /^\\/.test(cwd)) {
return res.slice(0,-1).map(function (d) {
var ch = d.charAt(0)
return ch === '\\' ? d :
ch === '.' ? '\\' + d.slice(1) :
'\\' + d
});
}
return res;
function fixNormalize(fn) {
return function(p) {
return fn(p).replace(/:\.$/, ':')
}
}
}