diff options
Diffstat (limited to 'node_modules/fined/index.js')
-rw-r--r-- | node_modules/fined/index.js | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/node_modules/fined/index.js b/node_modules/fined/index.js index fed7aae0b..db46a9b42 100644 --- a/node_modules/fined/index.js +++ b/node_modules/fined/index.js @@ -3,22 +3,12 @@ var fs = require('fs'); var path = require('path'); -var isString = require('lodash.isstring'); -var isPlainObject = require('lodash.isplainobject'); -var isEmpty = require('lodash.isempty'); -var pick = require('lodash.pick'); -var assignWith = require('lodash.assignwith'); - +var isPlainObject = require('is-plain-object'); +var pick = require('object.pick'); +var defaults = require('object.defaults/immutable'); var expandTilde = require('expand-tilde'); var parsePath = require('parse-filepath'); -function assignNullish(objValue, srcValue) { - return (srcValue == null ? objValue : srcValue); -} - -function defaults(mainObj, defaultObj) { - return assignWith({}, defaultObj, mainObj, assignNullish); -} function fined(pathObj, defaultObj) { var expandedPath = expandPath(pathObj, defaultObj); @@ -69,6 +59,7 @@ function expandPath(pathObj, defaultObj) { filePath = filePath.slice(parsed.root.length); findUp = false; basedir = parsed.root; + /* istanbul ignore if */ } else if (parsed.root) { // Expanded path has a drive letter on Windows. filePath = filePath.slice(parsed.root.length); basedir = path.resolve(parsed.root); @@ -156,4 +147,20 @@ function createExtensionMap(exts) { return exts; } +function isEmpty(object) { + return !Object.keys(object).length; +} + +function isString(value) { + if (typeof value === 'string') { + return true; + } + + if (Object.prototype.toString.call(value) === '[object String]') { + return true; + } + + return false; +} + module.exports = fined; |