1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 09:17:59 +01:00

Move Command's property definitions outside init.

--HG--
extra : rebase_source : 2237c2350957975938140d4f4c556898763ef7d3
This commit is contained in:
Doug Kearns
2009-11-16 02:32:28 +11:00
parent fd37a5deb0
commit 01a04a9d9f
2 changed files with 119 additions and 112 deletions

View File

@@ -805,6 +805,15 @@ const Util = Module("util", {
return obj;
},
/**
* Compacts an array, removing all elements that are null or undefined:
* ["foo", null, "bar", undefined] -> ["foo", "bar"]
*
* @param {Array} ary
* @returns {Array}
*/
compact: function compact(ary) ary.filter(function (item) item != null),
/**
* Flattens an array, such that all elements of the array are
* joined into a single array: