/*! * aug - a library to augment objects and prototypes * v0.1.0 * https://github.com/jgallen23/aug * copyright JGA 2013 * MIT License */(function(e){var t=function(){var n=Array.prototype.slice.call(arguments),r=!1,i=n.shift(),s="";if(typeof i=="string"||typeof i=="boolean")s=i===!0?"deep":i,i=n.shift(),s=="defaults"&&(i=t({},i),s="strict");for(var o=0,u=n.length;o1&&(typeof e[1]=="function"?(t.write=e[1],e.length>2&&(t.watch=e[2])):t.watch=e[1])),t}function f(e){function t(e){if(!arguments.length){if(typeof t.read=="function")return t.read.call(t.context);throw new Error("This observable cannot be read from!")}if(typeof t.write!="function")throw new Error("This observable cannot be written to!");t.write.call(t.context,e)}return i(t,r.prototype,{context:e.context||t,read:e.read,write:e.write,onNotify:function(e){return function(){e.call(t)}}(e.onNotify||function(){}),_initialValue:e.value,_currentValue:e.value,_previousValue:undefined,_subscriptions:[]},f.fn),r.apply(t),e.watch&&t.watch.apply(t,o(e.watch)?e.watch:[e.watch]),t}var t=function(t){return e[t]},n={},r=t("sublish").PubSub,i=t("aug"),s=Array.prototype.slice,o=Array.isArray?Array.isArray:function(e){return Object.prototype.toString.call(e)==="[object Array]"},u=Array.prototype.indexOf?function(e,t){return!!~e.indexOf(t)}:function(e,t){for(var n=0;n