From 1d44b9e2b2c090ec86f5d4e59a6f312b0a13c867 Mon Sep 17 00:00:00 2001 From: oleg Date: Thu, 7 May 2015 22:08:46 +0300 Subject: [PATCH] clear utils --- lib/command/spawn.js | 4 ++-- lib/utils.js | 23 ----------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/lib/command/spawn.js b/lib/command/spawn.js index 3225e61..24174f1 100644 --- a/lib/command/spawn.js +++ b/lib/command/spawn.js @@ -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; diff --git a/lib/utils.js b/lib/utils.js index 48c5638..90cf13c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -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(' ');