diff options
Diffstat (limited to 'node_modules/liftoff/lib')
-rw-r--r-- | node_modules/liftoff/lib/build_config_name.js | 17 | ||||
-rw-r--r-- | node_modules/liftoff/lib/file_search.js | 14 | ||||
-rw-r--r-- | node_modules/liftoff/lib/find_config.js | 25 | ||||
-rw-r--r-- | node_modules/liftoff/lib/find_cwd.js | 18 | ||||
-rw-r--r-- | node_modules/liftoff/lib/parse_options.js | 35 | ||||
-rw-r--r-- | node_modules/liftoff/lib/register_loader.js | 24 | ||||
-rw-r--r-- | node_modules/liftoff/lib/silent_require.js | 5 |
7 files changed, 0 insertions, 138 deletions
diff --git a/node_modules/liftoff/lib/build_config_name.js b/node_modules/liftoff/lib/build_config_name.js deleted file mode 100644 index b83e18508..000000000 --- a/node_modules/liftoff/lib/build_config_name.js +++ /dev/null @@ -1,17 +0,0 @@ -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; - }); -}; diff --git a/node_modules/liftoff/lib/file_search.js b/node_modules/liftoff/lib/file_search.js deleted file mode 100644 index 76dadd674..000000000 --- a/node_modules/liftoff/lib/file_search.js +++ /dev/null @@ -1,14 +0,0 @@ -const 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; -}; diff --git a/node_modules/liftoff/lib/find_config.js b/node_modules/liftoff/lib/find_config.js deleted file mode 100644 index 71c3f077d..000000000 --- a/node_modules/liftoff/lib/find_config.js +++ /dev/null @@ -1,25 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const 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; -}; diff --git a/node_modules/liftoff/lib/find_cwd.js b/node_modules/liftoff/lib/find_cwd.js deleted file mode 100644 index 2a029b972..000000000 --- a/node_modules/liftoff/lib/find_cwd.js +++ /dev/null @@ -1,18 +0,0 @@ -const 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(); -}; diff --git a/node_modules/liftoff/lib/parse_options.js b/node_modules/liftoff/lib/parse_options.js deleted file mode 100644 index ab416b520..000000000 --- a/node_modules/liftoff/lib/parse_options.js +++ /dev/null @@ -1,35 +0,0 @@ -const 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); -}; diff --git a/node_modules/liftoff/lib/register_loader.js b/node_modules/liftoff/lib/register_loader.js deleted file mode 100644 index e29b08ad5..000000000 --- a/node_modules/liftoff/lib/register_loader.js +++ /dev/null @@ -1,24 +0,0 @@ -const 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) { - autoloads = autoloads.failures; - } - - if (Array.isArray(autoloads)) { - autoloads.forEach(function (attempt) { - if (attempt.error) { - eventEmitter.emit('requireFail', attempt.moduleName, attempt.error); - } else { - eventEmitter.emit('require', attempt.moduleName, attempt.module); - } - }); - } -}; diff --git a/node_modules/liftoff/lib/silent_require.js b/node_modules/liftoff/lib/silent_require.js deleted file mode 100644 index 7b4dfe4e5..000000000 --- a/node_modules/liftoff/lib/silent_require.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function (path) { - try { - return require(path); - } catch (e) {} -}; |