Initial import with skill sheet working
This commit is contained in:
18
node_modules/liftoff/lib/array_find.js
generated
vendored
Normal file
18
node_modules/liftoff/lib/array_find.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
function arrayFind(arr, fn) {
|
||||
if (!Array.isArray(arr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var idx = 0;
|
||||
while (idx < arr.length) {
|
||||
var result = fn(arr[idx]);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = arrayFind;
|
17
node_modules/liftoff/lib/build_config_name.js
generated
vendored
Normal file
17
node_modules/liftoff/lib/build_config_name.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
module.exports = function (opts) {
|
||||
opts = opts || {};
|
||||
var configName = opts.configName;
|
||||
var extensions = opts.extensions;
|
||||
if (!configName) {
|
||||
throw new Error('Please specify a configName.');
|
||||
}
|
||||
if (configName instanceof RegExp) {
|
||||
return [configName];
|
||||
}
|
||||
if (!Array.isArray(extensions)) {
|
||||
throw new Error('Please provide an array of valid extensions.');
|
||||
}
|
||||
return extensions.map(function (ext) {
|
||||
return configName + ext;
|
||||
});
|
||||
};
|
14
node_modules/liftoff/lib/file_search.js
generated
vendored
Normal file
14
node_modules/liftoff/lib/file_search.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
var findup = require('findup-sync');
|
||||
|
||||
module.exports = function (search, paths) {
|
||||
var path;
|
||||
var len = paths.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (path) {
|
||||
break;
|
||||
} else {
|
||||
path = findup(search, { cwd: paths[i], nocase: true });
|
||||
}
|
||||
}
|
||||
return path;
|
||||
};
|
27
node_modules/liftoff/lib/find_config.js
generated
vendored
Normal file
27
node_modules/liftoff/lib/find_config.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var fileSearch = require('./file_search');
|
||||
|
||||
module.exports = function (opts) {
|
||||
opts = opts || {};
|
||||
var configNameSearch = opts.configNameSearch;
|
||||
var configPath = opts.configPath;
|
||||
var searchPaths = opts.searchPaths;
|
||||
// only search for a config if a path to one wasn't explicitly provided
|
||||
if (!configPath) {
|
||||
if (!Array.isArray(searchPaths)) {
|
||||
throw new Error(
|
||||
'Please provide an array of paths to search for config in.'
|
||||
);
|
||||
}
|
||||
if (!configNameSearch) {
|
||||
throw new Error('Please provide a configNameSearch.');
|
||||
}
|
||||
configPath = fileSearch(configNameSearch, searchPaths);
|
||||
}
|
||||
// confirm the configPath exists and return an absolute path to it
|
||||
if (fs.existsSync(configPath)) {
|
||||
return path.resolve(configPath);
|
||||
}
|
||||
return null;
|
||||
};
|
18
node_modules/liftoff/lib/find_cwd.js
generated
vendored
Normal file
18
node_modules/liftoff/lib/find_cwd.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
var path = require('path');
|
||||
|
||||
module.exports = function (opts) {
|
||||
if (!opts) {
|
||||
opts = {};
|
||||
}
|
||||
var cwd = opts.cwd;
|
||||
var configPath = opts.configPath;
|
||||
// if a path to the desired config was specified
|
||||
// but no cwd was provided, use configPath dir
|
||||
if (typeof configPath === 'string' && !cwd) {
|
||||
cwd = path.dirname(path.resolve(configPath));
|
||||
}
|
||||
if (typeof cwd === 'string') {
|
||||
return path.resolve(cwd);
|
||||
}
|
||||
return process.cwd();
|
||||
};
|
29
node_modules/liftoff/lib/get_node_flags.js
generated
vendored
Normal file
29
node_modules/liftoff/lib/get_node_flags.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
function arrayOrFunction(arrayOrFunc, env) {
|
||||
if (typeof arrayOrFunc === 'function') {
|
||||
return arrayOrFunc.call(this, env);
|
||||
}
|
||||
if (Array.isArray(arrayOrFunc)) {
|
||||
return arrayOrFunc;
|
||||
}
|
||||
if (typeof arrayOrFunc === 'string') {
|
||||
return [arrayOrFunc];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
function fromReorderedArgv(reorderedArgv) {
|
||||
var nodeFlags = [];
|
||||
for (var i = 1, n = reorderedArgv.length; i < n; i++) {
|
||||
var arg = reorderedArgv[i];
|
||||
if (!/^-/.test(arg) || arg === '--') {
|
||||
break;
|
||||
}
|
||||
nodeFlags.push(arg);
|
||||
}
|
||||
return nodeFlags;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
arrayOrFunction: arrayOrFunction,
|
||||
fromReorderedArgv: fromReorderedArgv,
|
||||
};
|
18
node_modules/liftoff/lib/needs_lookup.js
generated
vendored
Normal file
18
node_modules/liftoff/lib/needs_lookup.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var isPlainObject = require('is-plain-object').isPlainObject;
|
||||
|
||||
function needsLookup(xtends) {
|
||||
if (typeof xtends === 'string' && xtends[0] === '.') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isPlainObject(xtends)) {
|
||||
// Objects always need lookup because they can't be used with `require()`
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = needsLookup;
|
35
node_modules/liftoff/lib/parse_options.js
generated
vendored
Normal file
35
node_modules/liftoff/lib/parse_options.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
var extend = require('extend');
|
||||
|
||||
module.exports = function (opts) {
|
||||
var defaults = {
|
||||
extensions: {
|
||||
'.js': null,
|
||||
'.json': null,
|
||||
},
|
||||
searchPaths: [],
|
||||
};
|
||||
if (!opts) {
|
||||
opts = {};
|
||||
}
|
||||
if (opts.name) {
|
||||
if (!opts.processTitle) {
|
||||
opts.processTitle = opts.name;
|
||||
}
|
||||
if (!opts.configName) {
|
||||
opts.configName = opts.name + 'file';
|
||||
}
|
||||
if (!opts.moduleName) {
|
||||
opts.moduleName = opts.name;
|
||||
}
|
||||
}
|
||||
if (!opts.processTitle) {
|
||||
throw new Error('You must specify a processTitle.');
|
||||
}
|
||||
if (!opts.configName) {
|
||||
throw new Error('You must specify a configName.');
|
||||
}
|
||||
if (!opts.moduleName) {
|
||||
throw new Error('You must specify a moduleName.');
|
||||
}
|
||||
return extend(defaults, opts);
|
||||
};
|
26
node_modules/liftoff/lib/register_loader.js
generated
vendored
Normal file
26
node_modules/liftoff/lib/register_loader.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
var rechoir = require('rechoir');
|
||||
|
||||
module.exports = function (eventEmitter, extensions, configPath, cwd) {
|
||||
extensions = extensions || {};
|
||||
|
||||
if (typeof configPath !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
||||
var autoloads = rechoir.prepare(extensions, configPath, cwd, true);
|
||||
if (autoloads instanceof Error) {
|
||||
// Only errors
|
||||
autoloads.failures.forEach(function (failed) {
|
||||
eventEmitter.emit('loader:failure', failed.moduleName, failed.error);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Array.isArray(autoloads)) {
|
||||
// Already required or no config.
|
||||
return;
|
||||
}
|
||||
|
||||
var succeeded = autoloads[autoloads.length - 1];
|
||||
eventEmitter.emit('loader:success', succeeded.moduleName, succeeded.module);
|
||||
};
|
5
node_modules/liftoff/lib/silent_require.js
generated
vendored
Normal file
5
node_modules/liftoff/lib/silent_require.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = function (path) {
|
||||
try {
|
||||
return require(path);
|
||||
} catch (e) {}
|
||||
};
|
Reference in New Issue
Block a user