Finished script

This commit is contained in:
plane000
2018-05-27 16:11:50 +01:00
parent c346a752f8
commit b5641501fd
51 changed files with 8787 additions and 0 deletions

61
node_modules/ping/test/load-fixture-path.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
'use strict';
var path = require('path');
var glob = require('glob');
/**
* Check out linux platform
*/
function isLinux(p) {
var platforms = [
'aix',
'linux',
];
return platforms.indexOf(p) >= 0;
}
/**
* Check out macos platform
*/
function isMacOS(p) {
var platforms = [
'darwin',
'freebsd',
];
return platforms.indexOf(p) >= 0;
}
/**
* Check out window platform
*/
function isWindow(p) {
return p && p.match(/^win/) !== null;
}
module.exports = function (platform) {
var dirname = null;
if (isLinux(platform)) {
dirname = 'linux';
} else if (isMacOS(platform)) {
dirname = 'macos';
} else if (isWindow(platform)) {
dirname = 'window';
}
var currentDirectory = path.dirname(__filename);
var targetDirectory = [currentDirectory, 'fixture'];
if (dirname) {
targetDirectory.push(dirname);
}
targetDirectory = targetDirectory.concat([
'**',
'*.txt',
]);
targetDirectory = path.posix.join.apply(path.posix, targetDirectory);
return glob.sync(targetDirectory);
};