diff options
Diffstat (limited to 'node_modules/utila/scripts/js/lib/object.js')
-rw-r--r-- | node_modules/utila/scripts/js/lib/object.js | 158 |
1 files changed, 0 insertions, 158 deletions
diff --git a/node_modules/utila/scripts/js/lib/object.js b/node_modules/utila/scripts/js/lib/object.js deleted file mode 100644 index c776361c0..000000000 --- a/node_modules/utila/scripts/js/lib/object.js +++ /dev/null @@ -1,158 +0,0 @@ -var object, _common, - __hasProp = {}.hasOwnProperty; - -_common = require('./_common'); - -module.exports = object = { - isBareObject: _common.isBareObject.bind(_common), - - /* - if object is an instance of a class - */ - isInstance: function(what) { - return !this.isBareObject(what); - }, - - /* - Alias to _common.typeOf - */ - typeOf: _common.typeOf.bind(_common), - - /* - Alias to _common.clone - */ - clone: _common.clone.bind(_common), - - /* - Empties an object of its properties. - */ - empty: function(o) { - var prop; - for (prop in o) { - if (o.hasOwnProperty(prop)) { - delete o[prop]; - } - } - return o; - }, - - /* - Empties an object. Doesn't check for hasOwnProperty, so it's a tiny - bit faster. Use it for plain objects. - */ - fastEmpty: function(o) { - var property; - for (property in o) { - delete o[property]; - } - return o; - }, - - /* - Overrides values fomr `newValues` on `base`, as long as they - already exist in base. - */ - overrideOnto: function(base, newValues) { - var key, newVal, oldVal; - if (!this.isBareObject(newValues) || !this.isBareObject(base)) { - return base; - } - for (key in base) { - oldVal = base[key]; - newVal = newValues[key]; - if (newVal === void 0) { - continue; - } - if (typeof newVal !== 'object' || this.isInstance(newVal)) { - base[key] = this.clone(newVal); - } else { - if (typeof oldVal !== 'object' || this.isInstance(oldVal)) { - base[key] = this.clone(newVal); - } else { - this.overrideOnto(oldVal, newVal); - } - } - } - return base; - }, - - /* - Takes a clone of 'base' and runs #overrideOnto on it - */ - override: function(base, newValues) { - return this.overrideOnto(this.clone(base), newValues); - }, - append: function(base, toAppend) { - return this.appendOnto(this.clone(base), toAppend); - }, - appendOnto: function(base, toAppend) { - var key, newVal, oldVal; - if (!this.isBareObject(toAppend) || !this.isBareObject(base)) { - return base; - } - for (key in toAppend) { - if (!__hasProp.call(toAppend, key)) continue; - newVal = toAppend[key]; - if (newVal === void 0) { - continue; - } - if (typeof newVal !== 'object' || this.isInstance(newVal)) { - base[key] = newVal; - } else { - oldVal = base[key]; - if (typeof oldVal !== 'object' || this.isInstance(oldVal)) { - base[key] = this.clone(newVal); - } else { - this.appendOnto(oldVal, newVal); - } - } - } - return base; - }, - groupProps: function(obj, groups) { - var def, defs, grouped, key, name, shouldAdd, val, _i, _len; - grouped = {}; - for (name in groups) { - defs = groups[name]; - grouped[name] = {}; - } - grouped['rest'] = {}; - top: //; - for (key in obj) { - val = obj[key]; - shouldAdd = false; - for (name in groups) { - defs = groups[name]; - if (!Array.isArray(defs)) { - defs = [defs]; - } - for (_i = 0, _len = defs.length; _i < _len; _i++) { - def = defs[_i]; - if (typeof def === 'string') { - if (key === def) { - shouldAdd = true; - } - } else if (def instanceof RegExp) { - if (def.test(key)) { - shouldAdd = true; - } - } else if (def instanceof Function) { - if (def(key)) { - shouldAdd = true; - } - } else { - throw Error('Group definitions must either be strings, regexes, or functions.'); - } - if (shouldAdd) { - grouped[name][key] = val; - continue top; - } - } - } - grouped['rest'][key] = val; - } - return grouped; - } -}; - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2JqZWN0LmpzIiwic291cmNlUm9vdCI6Ii4uXFwuLiIsInNvdXJjZXMiOlsiY29mZmVlXFxsaWJcXG9iamVjdC5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBQSxlQUFBO0VBQUEsNkJBQUE7O0FHQUEsT0dBQSxHR0FVLE9HQUEsQ0dBUSxXR0FSLENBQVYsQ0FBQTs7QUdFQSxNR0FNLENHQUMsT0dBUCxHR0FpQixNR0FBLEdHRWhCO0FHQUEsRUdBQSxZR0FBLEVHQWMsT0dBTyxDR0FDLFlHQVksQ0dBQyxJR0FyQixDR0EwQixPR0ExQixDR0FkO0FHRUE7QUdBQTs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