Skip to content

Commit

Permalink
Reduce lodash usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jul 21, 2016
1 parent a50a622 commit a4ef5e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks/less.js
Expand Up @@ -106,7 +106,7 @@ module.exports = function(grunt) {
options = _.assign({filename: srcFile}, options);
options.paths = options.paths || [path.dirname(srcFile)];

if (_.isFunction(options.paths)) {
if (typeof options.paths === 'function') {
try {
options.paths = options.paths(srcFile);
} catch (e) {
Expand All @@ -118,15 +118,15 @@ module.exports = function(grunt) {
options.sourceMapFilename = destFile + '.map';
}

if (_.isFunction(options.sourceMapBasepath)) {
if (typeof options.sourceMapBasepath === 'function') {
try {
options.sourceMapBasepath = options.sourceMapBasepath(srcFile);
} catch (e) {
grunt.fail.warn(wrapError(e, 'Generating sourceMapBasepath failed.'));
}
}

if (_.isBoolean(options.sourceMap) && options.sourceMap) {
if (typeof options.sourceMap === 'boolean' && options.sourceMap) {
options.sourceMap = {
sourceMapBasepath: options.sourceMapBasepath,
sourceMapFilename: options.sourceMapFilename,
Expand Down Expand Up @@ -156,7 +156,7 @@ module.exports = function(grunt) {
var args = [].slice.call(arguments);
args.unshift(less);
var res = options.customFunctions[name].apply(this, args);
return _.isObject(res) ? res : new less.tree.Anonymous(res);
return typeof res === 'object' ? res : new less.tree.Anonymous(res);
});
});
}
Expand Down

0 comments on commit a4ef5e1

Please sign in to comment.