diff --git a/plugins/cockpit/cli.js b/plugins/cockpit/cli.js index bb8428c7..df183782 100644 --- a/plugins/cockpit/cli.js +++ b/plugins/cockpit/cli.js @@ -39,7 +39,7 @@ define(function(require, exports, module) { var console = require('pilot/console'); -var util = require('pilot/util'); +var lang = require('pilot/lang'); var oop = require('pilot/oop'); var EventEmitter = require('pilot/event_emitter').EventEmitter; @@ -1048,7 +1048,7 @@ oop.inherits(CliRequisition, Requisition); } } - util.arrayRemove(names, assignment.name); + lang.arrayRemove(names, assignment.name); args.splice(i, 1); // We don't need to i++ if we splice } diff --git a/plugins/pilot/canon.js b/plugins/pilot/canon.js index e0037cf0..3a4165a0 100644 --- a/plugins/pilot/canon.js +++ b/plugins/pilot/canon.js @@ -44,7 +44,7 @@ var EventEmitter = require('pilot/event_emitter').EventEmitter; var catalog = require('pilot/catalog'); var Status = require('pilot/types').Status; var types = require('pilot/types'); -var util = require('pilot/util'); +var lang = require('pilot/lang'); /* // TODO: this doesn't belong here - or maybe anywhere? @@ -153,7 +153,7 @@ function upgradeType(param) { function removeCommand(command) { var name = (typeof command === 'string' ? command : command.name); delete commands[name]; - util.arrayRemove(commandNames, name); + lang.arrayRemove(commandNames, name); }; function getCommand(name) { diff --git a/plugins/pilot/lang.js b/plugins/pilot/lang.js index 5170a261..b8b946e1 100644 --- a/plugins/pilot/lang.js +++ b/plugins/pilot/lang.js @@ -62,6 +62,17 @@ exports.arrayToMap = function(arr) { }; +/** + * splice out of 'array' anything that === 'value' + */ +exports.arrayRemove = function(array, value) { + for (var i = 0; i <= array.length; i++) { + if (value === array[i]) { + array.splice(i, 1); + } + } +}; + exports.escapeRegExp = function(str) { return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); }; diff --git a/plugins/pilot/util.js b/plugins/pilot/util.js index d3d3c747..9ce05809 100644 --- a/plugins/pilot/util.js +++ b/plugins/pilot/util.js @@ -618,16 +618,4 @@ exports.rectsEqual = function(r1, r2, delta) { return true; }; -/** - * splice out of 'array' anything that === 'value' - */ -exports.arrayRemove = function(array, value) { - for (var i = 0; i <= array.length; i++) { - if (value === array[i]) { - array.splice(i, 1); - } - } -}; - - });