clear utils

This commit is contained in:
oleg 2015-05-07 22:08:46 +03:00
parent a6ff3b4f62
commit 1d44b9e2b2
2 changed files with 2 additions and 25 deletions

View File

@ -3,7 +3,7 @@
var spawn = require('child_process').spawn,
ParentCommand = require('./base').Command,
inherits = require('util').inherits,
utils = require('../utils');
_ = require('underscore');
function Command(params) {
params = params || {};
@ -24,7 +24,7 @@ Command.prototype.run = function(params, callback) {
if (!params.cmd) return callback(new Error('`cmd` is not set'));
if (!params.args) return callback(new Error('`args` is not set'));
callback = utils.once(callback);
callback = _(callback).once();
params.options = params.options || {};
params.options.cwd = params.options.cwd || this.cwd;

View File

@ -1,28 +1,5 @@
'use strict';
['Function', 'String', 'Number', 'Date', 'RegExp'].forEach(function(name) {
exports['is' + name] = function(obj) {
return toString.call(obj) == '[object ' + name + ']';
};
});
exports.isObject = function(obj) {
return obj === Object(obj);
};
exports.noop = function() {};
exports.slice = Array.prototype.slice;
exports.once = function(func) {
var isCalled = false;
return function() {
if (isCalled) return;
func.apply(this, arguments);
isCalled = true;
};
};
exports.prune = function(str, length) {
var result = '',
words = str.split(' ');