{"size": 3462, "ext": "js", "max_stars_repo_path": "dist/observer.min.js", "max_stars_repo_name": "disaverio/observer", "max_stars_repo_stars_event_min_datetime": "2017-07-19T23:07:53.000Z", "max_stars_repo_stars_event_max_datetime": "2017-07-19T23:07:53.000Z", "max_issues_repo_path": "dist/observer.min.js", "max_issues_repo_name": "disaverio/observer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/observer.min.js", "max_forks_repo_name": "disaverio/observer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 3462.0, "max_line_length": 3462, "alphanum_fraction": 0.7019064125}
"use strict";!function(a,b){function c(b,c){var d=[];return b=b||[],b.forEach(function(b){b.constructor===Function?d.push(b()):b==a.OBS_OBSERVED_RETURNED?d.push(c):d.push(b)}),d}function d(b,c){function e(b){function d(a,b){return b.length>1?d(a[b[0]],b.slice(1)):a[b[0]]}var e=null;if(e=b.firstParam==a.OBS_OBSERVED_RETURNED?c:b.firstParam.constructor===Function?b.firstParam():b.firstType==OBS_PRIMITIVE?b.firstParam:d(b.firstScope,b.firstParam.split(".")),!b.secondParam&&!b.secondType)return!!e;var f=null;switch(f=b.secondParam==a.OBS_OBSERVED_RETURNED?c:b.secondParam.constructor===Function?b.secondParam():b.secondType==OBS_PRIMITIVE?b.secondParam:d(b.secondScope,b.secondParam.split(".")),b.operator){case"===":return e===f;case"!==":return e!==f;case"==":return e==f;case"!=":return e!=f;case"<":return e<f;case"<=":return e<=f;case">":return e>f;case">=":return e>=f;default:return!1}}if(!b)return!0;if(1==b.type)return e(b);if("AND"==b.operator){for(var f=0;f<b.sons.length;f++){var g=d(b.sons[f],c);if(!g)return!1}return!0}if("OR"==b.operator){for(var f=0;f<b.sons.length;f++){var g=d(b.sons[f],c);if(g)return!0}return!1}return"NOT"==b.operator?!d(b.sons[0],c):void 0}function e(b){function c(a){if("OR"!=a[0]&&"AND"!=a[0]&&"NOT"!=a[0])throw new Error("Observer | Unknown operator: '"+a[0]+"'");if("NOT"==a[0]&&2!=a.length)throw new Error("Observer | 'NOT' operator must have only one argument.");if(("OR"==a[0]||"AND"==a[0])&&a.length<=2)throw new Error("Observer | '"+a[0]+"' operator must have at least two arguments.");var b={type:0,operator:a[0],sons:[]};return a.slice(1).forEach(function(a){Array.isArray(a)?b.sons.push(c(a)):b.sons.push(d(a))}),b}function d(b){if(b.constructor===Function&&(b={firstParam:b}),!b||!b.firstParam)throw new Error("Observer | Invalid condition: "+b.operator);if(b.operator&&"==="!=b.operator&&"!=="!=b.operator&&"=="!=b.operator&&"!="!=b.operator&&">"!=b.operator&&">="!=b.operator&&"<"!=b.operator&&"<="!=b.operator)throw new Error("Observer | Unknown operator: '"+b.operator+"'");return{type:1,firstParam:b.firstParam,firstType:b.firstType,firstScope:b.firstScope||a,operator:b.operator||"==",secondParam:b.secondParam,secondType:b.secondType,secondScope:b.secondScope||a}}if(b)return Array.isArray(b)?c(b):d(b)}function f(a){return this.subscribers.push({fn:a.constructor===Function?a:a.fn,conditions:a.constructor===Function?void 0:e(a.conditions),params:a.constructor===Function?void 0:a.params,context:a.constructor===Function?void 0:a.context}),this}function g(a){for(var b=this.subscribers.length-1;b>=0;b--)this.subscribers[b].fn==a&&this.subscribers.splice(b,1);return this}function h(){return this.subscribers=[],this}var i=Math.random().toString(36).slice(2);a.OBS_OBSERVED_RETURNED=Math.random(),a.OBS_PRIMITIVE=Math.random(),Function.prototype.observable=function(){var a=this,b=function(){var e="state_"+i,f=Array.prototype.slice.call(arguments),g=f.slice(-1)[0];if(g&&g.ID==i){if(b[e]==g.state)return;f.splice(-1,1)}else g={ID:i,state:Math.random().toString(36).slice(2)};b[e]=g.state;var h=a.apply(this,f);return b.subscribers.forEach(function(a){if(a.fn[e]!=b[e]&&d(a.conditions,h)){var f=c(a.params,h);a.fn.subscribers&&a.fn.addObserver&&a.fn.removeObserver&&a.fn.removeAllObservers?f.push(g):a.fn[e]=g.state,f.length>0?a.fn.apply(a.fn.context,f):a.fn.apply(a.fn.context)}}),h};return b.subscribers=[],b.addObserver=f.bind(b),b.removeObserver=g.bind(b),b.removeAllObservers=h.bind(b),b}}(this);