diff --git a/lib/utils/prototypes.js b/lib/utils/prototypes.js index cbff179..795044b 100644 --- a/lib/utils/prototypes.js +++ b/lib/utils/prototypes.js @@ -53,6 +53,20 @@ Object.defineProperty(Array.prototype, 'map', function (fn, array) { return result }) +Object.defineProperty(Array.prototype, 'extend', { + value: function (obj) { + if (Array.isArray(obj)) { + obj.forEach(function (v) { + if (typeof v !== 'undefined') { + this.push(v) + } + }, this) + } else { + this.push(obj) + } + } +}) + Object.defineProperty(Object, 'isObject', { configurable: true, enumerable: false,