diff --git a/README.md b/README.md
index 348c57f..7991d7a 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-![msngr.js](https://github.com/KrisSiegel/msngr.js/raw/master/resources/logo.png "msngr.js logo")
+
Messaging is a powerful development pattern that makes decoupling components and providing internal APIs incredibly easy. The primary goal of msngr is to provide a high quality, asynchronous method of consuming and emitting messages that work in both node and the web browser.
@@ -140,7 +140,7 @@ var mache = msngr.mache({
```
### msngr.immediate()
-So if you want to create an asynchronous process many developers turn to ```setTimeout(fn, 0);``` but that's actually rather slow to execute in web browsers (typically values less than 10 or so are ignored). Using ```setImmediate(fn)``` is a far better choice but it's mostly in node and IE. This is where ```msngr.immediate(fn)``` comes in. There is a way to simulate ```setImmediate(fn)``` when it doesn't exist in a web browser so ```msngr.immediate(fn)``` will use whatever the fastest solution that exists on the platform it is running on to execute something asynchronously.
+So if you want to create an asynchronous process many developers turn to ```setTimeout(fn, 0);``` but that's actually rather slow to execute in web browsers (typically values less than 10 or so are ignored and even 0 isn't guaranteed to execute immediately). Using ```setImmediate(fn)``` is a far better choice but it's almost exclusively available in node and IE. This is where ```msngr.immediate(fn)``` comes in. There is a way to simulate ```setImmediate(fn)``` when it doesn't exist in a web browser so ```msngr.immediate(fn)``` will use whatever the fastest solution that exists on the platform it is running on to execute something asynchronously.
```javascript
msngr.immediate(function () {
@@ -149,7 +149,13 @@ msngr.immediate(function () {
```
-#### Getting in contact
+### Sponsor
+
+
+
+msngr.js development is sponsored by [Simex](https://www.simex.io/), an aspiring start-up looking to make a dent in artificial intelligence and data aggregation. Follow [@HeySimex](https://twitter.com/heysimex) on Twitter!
+
+#### Contact
For questions, news, and whatever else that doesn't fit in GitHub issues you can follow me [@KrisSiegel](https://twitter.com/KrisSiegel)
Copyright © 2014-2016 Kris Siegel
diff --git a/bower.json b/bower.json
index ebdbe51..adef9c6 100644
--- a/bower.json
+++ b/bower.json
@@ -2,7 +2,7 @@
"name": "msngr.js",
"main": "msngr.min.js",
"description": "msngr.js is an asynchronous messaging library, written in JavaScript, for node and browser use",
- "version": "5.0.0",
+ "version": "5.0.1",
"homepage": "https://github.com/KrisSiegel/msngr.js",
"authors": [
"Kris Siegel"
diff --git a/msngr.js b/msngr.js
index dc49de5..cca2e66 100644
--- a/msngr.js
+++ b/msngr.js
@@ -18,7 +18,7 @@ var msngr = msngr || (function () {
};
// Built version of msngr.js for programatic access; this is auto generated
- external.version = "5.0.0";
+ external.version = "5.0.1";
// Takes a function, executes it passing in the external and internal interfaces
external.extend = function (fn) {
diff --git a/msngr.min.js b/msngr.min.js
index 09c51ee..77a445e 100644
--- a/msngr.min.js
+++ b/msngr.min.js
@@ -1 +1 @@
-var msngr=msngr||function(){"use strict";var a={},b=function(){var a=Array.prototype.slice.call(arguments,0);return b.message.apply(this,a)};return b.version="5.0.0",b.extend=function(c){if(void 0!==c&&null!==c){var d=Object.prototype.toString.call(c);if("[object Function]"===d)return c.apply(this,[b,a])}},Object.defineProperty(b,"debug",{set:function(c){c===!0?b.internal=a:c===!1&&delete b.internal},get:function(){return void 0!==b.internal}}),b}();msngr.extend(function(a,b){"use strict";b.InvalidParametersException=function(b,c){var d={name:"InvalidParametersException",severity:"unrecoverable",message:"Invalid parameters supplied to the {method} method".replace("{method}",b)};return a.is(c).empty||(d.message=d.message+" "+c),d},b.DuplicateException=function(a){return{name:"DuplicateException",severity:"unrecoverable",message:"Duplicate input provided to {method} where duplicates are not allowed.".replace("{method}",a)}},b.ReservedKeywordsException=function(a){return{name:"ReservedKeywordsException",severity:"unrecoverable",message:"Reserved keyword {keyword} supplied as action.".replace("{keyword}",a)}},b.MangledException=function(a,b){return{name:"MangledException",severity:"unrecoverable",message:"The {variable} was unexpectedly mangled in {method}.".replace("{variable}",a).replace("{method}",b)}}}),msngr.extend(function(a,b){"use strict";var c={arguments:"[object Arguments]",boolean:"[object Boolean]",string:"[object String]",date:"[object Date]",array:"[object Array]",number:"[object Number]",object:"[object Object]",function:"[object Function]",undefined:"[object Undefined]",null:"[object Null]",symbol:"[object Symbol]",promise:"[object Promise]",nodeList:"[object NodeList]"},d={htmlElement:function(a){return 0===a.indexOf("[object HTML")||0===a.indexOf("[object global]")}},e=function(a){return Object.prototype.toString.call(a)},f=function(a,b,f){return f?d[a](e(b)):e(b)===c[a]},g=function(a,b){switch(a){case c.undefined:case c.null:return!0;case c.string:return 0===b.trim().length;case c.object:return 0===Object.keys(b).length;case c.array:return 0===b.length;default:return!1}},h=function(a){var b={},h=function(c,d){for(var e in c)c.hasOwnProperty(e)&&!function(c){Object.defineProperty(b,c,{get:function(){for(var b=0;b0&&e.shift()())},!0)}a.immediate=function(a){void 0===c&&(c="undefined"!=typeof setImmediate?setImmediate:"undefined"!=typeof window&&"undefined"!=typeof window.postMessage?function(a){e.push(a),window.postMessage(d,"*")}:function(a){setTimeout(a,0)}),c(a)}}),msngr.extend(function(a,b){"use strict";var c=void 0,d="",e=void 0,f=function(){return performance.now()},g=function(){return process.hrtime()[1]/1e6},h=function(){return Date.now()};a.now=function(b){void 0===c&&("undefined"!=typeof performance?(c=f,d="performance"):"undefined"!=typeof process?(c=g,d="node"):(c=h,d="legacy"));var i=c();return b===!0&&e===i?a.now(b):(e=i,i)}}),msngr.extend(function(a,b){"use strict";a.asyncify=function(b){return a.is(b).function&&(b.async=function(){var c=[].slice.call(arguments),d=c.pop();a.is(d).function&&!function(c,d){a.immediate(function(){try{d.apply(null,[null,b.apply(null,c)])}catch(a){d.apply(null,[a,null])}})}(c,d)}),b}}),msngr.extend(function(a,b){"use strict";var c={};c[b.types.string]=function(a){return a},c[b.types.number]=function(a){return a},c[b.types.boolean]=function(a){return a},c[b.types.date]=function(a){var b=new Date;return b.setTime(a.getTime()),b},c[b.types.object]=function(b){var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=a.copy(b[d]));return c},c[b.types.array]=function(b){for(var c=[],d=0;d0;)b=e(b,a.shift(),!0);return b},a.merge=function(){var a=Array.prototype.slice.call(arguments,0);if(a.length<=1)return a[0];for(var b=a.shift();a.length>0;)b=e(b,a.shift());return b}}),msngr.extend(function(a,b){"use strict";a.safe=function(c,d,e){if(!a.is(c).object||!a.is(d).string)throw b.InvalidParametersException("msngr.safe");for(var f=d.split("."),g=c,h=void 0;(h=f.shift())&&(g=g[h],void 0!==g););return a.is(g).there?g:e}}),msngr.extend(function(a,b){"use strict";b.executer=function(b){for(var c=0;c1)for(var f=1;f0){for(var i=[],j=[],k=0;k0)for(var d=0;d0)for(var b=0;bd.revisions.toKeep&&f[c].shift(),d.events.onChange.emit){var h=a.message(d.events.onChange.topic,d.events.onChange.category,c);h.emit({id:c,oldValue:f[c][f[c].length-2],newValue:f[c][f[c].length-1]})}return!0},m=function(c,d){return g[c]=b.merge(g[c]||j(c),a.copy(d)),!0},n=function(a){return void 0!==f[a]&&(delete f[a],delete e[a],!0)},o=function(a){return(void 0!==g[a]||void 0!==f[a])&&(void 0!==g[a]&&delete g[a],h[a]=!0,!0)},p=function(a){return void 0!==f[a]&&(1===f[a].length?(delete f[a],delete e[a],!0):(f[a].pop(),e[a]=q.get(a),!0))},q={get:function(a){return i?k(a):j(a)},getDeep:function(b,c,d){var e=q.get(b);if(void 0===e||a.is(c).empty)return d;for(var f=c.trim().split("."),g=e,h=0;h=400&&(h={status:f.statusCode,response:g||e},g=null),a.is(d).there&&d.apply(void 0,[h,g])})});if(a.is(c.payload).there){var g;if(a.is(c.payload).object)try{g=JSON.stringify(c.payload)}catch(a){}void 0===g&&(g=c.payload),f.write(g)}f.end()},f=function(b,c,f){if(a.is(c.query).there&&(a.is(c.query).string&&(c.queryString=c.query),a.is(c.query).object)){c.queryString="?";for(var g in c.query)c.query.hasOwnProperty(g)&&("?"!==c.queryString&&(c.queryString=c.queryString+"&"),c.queryString=c.queryString+encodeURIComponent(g)+"="+encodeURIComponent(c.query[g]))}c.path=c.path+(c.queryString||""),a.is.browser?d(b,c,f):e(b,c,f)},g=function(d,e,f){var g,h={protocol:void 0,host:void 0,port:void 0,canOmitPort:!1},i=!1,j=!1;if(a.is(d).empty&&(j=!0,g="Protocol or host not provided"),!j&&!a.is(d).empty&&a.is(e).empty&&a.is(f).empty){var k=d.split("://");2==k.length?(h.protocol=k[0],h.host=k[1]):(h.host=d,h.protocol=c.protocol);var l=h.host.lastIndexOf(":");l!==-1?(h.port=h.host.substring(l+1,h.host.length),h.host=h.host.substring(0,l)):h.port=c.port[h.protocol],i=!0}if(!j&&!i&&!a.is(d).empty&&!a.is(e).empty&&a.is(f).empty){h.protocol=d,h.host=e;var l=h.host.lastIndexOf(":");l!==-1?(h.port=h.host.substring(l+1,h.host.length),h.host=h.host.substring(0,l)):h.port=c.port[h.protocol],i=!0}if(j||i||a.is(d).empty||a.is(e).empty||a.is(f).empty||(h.protocol=d,h.host=e,h.port=f,i=!0),!j&&i&&c.port[h.protocol]===h.port&&(h.canOmitPort=!0),j||i||(j=!0,g="Unable to handle input into method. Please open a GitHub issue with your input :)"),j===!0)throw b.InvalidParametersException("net",g);var m=function(a){var b=a.indexOf("/");return a.substring(0,b===-1?a.length:b)};return h.host=m(h.host),h.port=m(h.port),h};a.net=function(d,e,h){var i=g(d,e,h),j={get:function(d,e){var g=b.merge(a.copy(c),d);g.method="get",f(i,g,e)},post:function(d,e){var g=b.merge(a.copy(c),d);g.method="post",f(i,g,e)},put:function(d,e){var g=b.merge(a.copy(c),d);g.method="put",f(i,g,e)},delete:function(d,e){var g=b.merge(a.copy(c),d);g.method="delete",f(i,g,e)},options:function(d,e){var g=b.merge(a.copy(c),d);g.method="options",f(i,g,e)}};return Object.defineProperty(j,"protocol",{get:function(){return i.protocol}}),Object.defineProperty(j,"host",{get:function(){return i.host}}),Object.defineProperty(j,"port",{get:function(){return i.port}}),j}}),"undefined"!=typeof module&&"undefined"!=typeof module.exports&&(module.exports=msngr);
\ No newline at end of file
+var msngr=msngr||function(){"use strict";var a={},b=function(){var a=Array.prototype.slice.call(arguments,0);return b.message.apply(this,a)};return b.version="5.0.1",b.extend=function(c){if(void 0!==c&&null!==c){var d=Object.prototype.toString.call(c);if("[object Function]"===d)return c.apply(this,[b,a])}},Object.defineProperty(b,"debug",{set:function(c){c===!0?b.internal=a:c===!1&&delete b.internal},get:function(){return void 0!==b.internal}}),b}();msngr.extend(function(a,b){"use strict";b.InvalidParametersException=function(b,c){var d={name:"InvalidParametersException",severity:"unrecoverable",message:"Invalid parameters supplied to the {method} method".replace("{method}",b)};return a.is(c).empty||(d.message=d.message+" "+c),d},b.DuplicateException=function(a){return{name:"DuplicateException",severity:"unrecoverable",message:"Duplicate input provided to {method} where duplicates are not allowed.".replace("{method}",a)}},b.ReservedKeywordsException=function(a){return{name:"ReservedKeywordsException",severity:"unrecoverable",message:"Reserved keyword {keyword} supplied as action.".replace("{keyword}",a)}},b.MangledException=function(a,b){return{name:"MangledException",severity:"unrecoverable",message:"The {variable} was unexpectedly mangled in {method}.".replace("{variable}",a).replace("{method}",b)}}}),msngr.extend(function(a,b){"use strict";var c={arguments:"[object Arguments]",boolean:"[object Boolean]",string:"[object String]",date:"[object Date]",array:"[object Array]",number:"[object Number]",object:"[object Object]",function:"[object Function]",undefined:"[object Undefined]",null:"[object Null]",symbol:"[object Symbol]",promise:"[object Promise]",nodeList:"[object NodeList]"},d={htmlElement:function(a){return 0===a.indexOf("[object HTML")||0===a.indexOf("[object global]")}},e=function(a){return Object.prototype.toString.call(a)},f=function(a,b,f){return f?d[a](e(b)):e(b)===c[a]},g=function(a,b){switch(a){case c.undefined:case c.null:return!0;case c.string:return 0===b.trim().length;case c.object:return 0===Object.keys(b).length;case c.array:return 0===b.length;default:return!1}},h=function(a){var b={},h=function(c,d){for(var e in c)c.hasOwnProperty(e)&&!function(c){Object.defineProperty(b,c,{get:function(){for(var b=0;b0&&e.shift()())},!0)}a.immediate=function(a){void 0===c&&(c="undefined"!=typeof setImmediate?setImmediate:"undefined"!=typeof window&&"undefined"!=typeof window.postMessage?function(a){e.push(a),window.postMessage(d,"*")}:function(a){setTimeout(a,0)}),c(a)}}),msngr.extend(function(a,b){"use strict";var c=void 0,d="",e=void 0,f=function(){return performance.now()},g=function(){return process.hrtime()[1]/1e6},h=function(){return Date.now()};a.now=function(b){void 0===c&&("undefined"!=typeof performance?(c=f,d="performance"):"undefined"!=typeof process?(c=g,d="node"):(c=h,d="legacy"));var i=c();return b===!0&&e===i?a.now(b):(e=i,i)}}),msngr.extend(function(a,b){"use strict";a.asyncify=function(b){return a.is(b).function&&(b.async=function(){var c=[].slice.call(arguments),d=c.pop();a.is(d).function&&!function(c,d){a.immediate(function(){try{d.apply(null,[null,b.apply(null,c)])}catch(a){d.apply(null,[a,null])}})}(c,d)}),b}}),msngr.extend(function(a,b){"use strict";var c={};c[b.types.string]=function(a){return a},c[b.types.number]=function(a){return a},c[b.types.boolean]=function(a){return a},c[b.types.date]=function(a){var b=new Date;return b.setTime(a.getTime()),b},c[b.types.object]=function(b){var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=a.copy(b[d]));return c},c[b.types.array]=function(b){for(var c=[],d=0;d0;)b=e(b,a.shift(),!0);return b},a.merge=function(){var a=Array.prototype.slice.call(arguments,0);if(a.length<=1)return a[0];for(var b=a.shift();a.length>0;)b=e(b,a.shift());return b}}),msngr.extend(function(a,b){"use strict";a.safe=function(c,d,e){if(!a.is(c).object||!a.is(d).string)throw b.InvalidParametersException("msngr.safe");for(var f=d.split("."),g=c,h=void 0;(h=f.shift())&&(g=g[h],void 0!==g););return a.is(g).there?g:e}}),msngr.extend(function(a,b){"use strict";b.executer=function(b){for(var c=0;c1)for(var f=1;f0){for(var i=[],j=[],k=0;k0)for(var d=0;d0)for(var b=0;bd.revisions.toKeep&&f[c].shift(),d.events.onChange.emit){var h=a.message(d.events.onChange.topic,d.events.onChange.category,c);h.emit({id:c,oldValue:f[c][f[c].length-2],newValue:f[c][f[c].length-1]})}return!0},m=function(c,d){return g[c]=b.merge(g[c]||j(c),a.copy(d)),!0},n=function(a){return void 0!==f[a]&&(delete f[a],delete e[a],!0)},o=function(a){return(void 0!==g[a]||void 0!==f[a])&&(void 0!==g[a]&&delete g[a],h[a]=!0,!0)},p=function(a){return void 0!==f[a]&&(1===f[a].length?(delete f[a],delete e[a],!0):(f[a].pop(),e[a]=q.get(a),!0))},q={get:function(a){return i?k(a):j(a)},getDeep:function(b,c,d){var e=q.get(b);if(void 0===e||a.is(c).empty)return d;for(var f=c.trim().split("."),g=e,h=0;h=400&&(h={status:f.statusCode,response:g||e},g=null),a.is(d).there&&d.apply(void 0,[h,g])})});if(a.is(c.payload).there){var g;if(a.is(c.payload).object)try{g=JSON.stringify(c.payload)}catch(a){}void 0===g&&(g=c.payload),f.write(g)}f.end()},f=function(b,c,f){if(a.is(c.query).there&&(a.is(c.query).string&&(c.queryString=c.query),a.is(c.query).object)){c.queryString="?";for(var g in c.query)c.query.hasOwnProperty(g)&&("?"!==c.queryString&&(c.queryString=c.queryString+"&"),c.queryString=c.queryString+encodeURIComponent(g)+"="+encodeURIComponent(c.query[g]))}c.path=c.path+(c.queryString||""),a.is.browser?d(b,c,f):e(b,c,f)},g=function(d,e,f){var g,h={protocol:void 0,host:void 0,port:void 0,canOmitPort:!1},i=!1,j=!1;if(a.is(d).empty&&(j=!0,g="Protocol or host not provided"),!j&&!a.is(d).empty&&a.is(e).empty&&a.is(f).empty){var k=d.split("://");2==k.length?(h.protocol=k[0],h.host=k[1]):(h.host=d,h.protocol=c.protocol);var l=h.host.lastIndexOf(":");l!==-1?(h.port=h.host.substring(l+1,h.host.length),h.host=h.host.substring(0,l)):h.port=c.port[h.protocol],i=!0}if(!j&&!i&&!a.is(d).empty&&!a.is(e).empty&&a.is(f).empty){h.protocol=d,h.host=e;var l=h.host.lastIndexOf(":");l!==-1?(h.port=h.host.substring(l+1,h.host.length),h.host=h.host.substring(0,l)):h.port=c.port[h.protocol],i=!0}if(j||i||a.is(d).empty||a.is(e).empty||a.is(f).empty||(h.protocol=d,h.host=e,h.port=f,i=!0),!j&&i&&c.port[h.protocol]===h.port&&(h.canOmitPort=!0),j||i||(j=!0,g="Unable to handle input into method. Please open a GitHub issue with your input :)"),j===!0)throw b.InvalidParametersException("net",g);var m=function(a){var b=a.indexOf("/");return a.substring(0,b===-1?a.length:b)};return h.host=m(h.host),h.port=m(h.port),h};a.net=function(d,e,h){var i=g(d,e,h),j={get:function(d,e){var g=b.merge(a.copy(c),d);g.method="get",f(i,g,e)},post:function(d,e){var g=b.merge(a.copy(c),d);g.method="post",f(i,g,e)},put:function(d,e){var g=b.merge(a.copy(c),d);g.method="put",f(i,g,e)},delete:function(d,e){var g=b.merge(a.copy(c),d);g.method="delete",f(i,g,e)},options:function(d,e){var g=b.merge(a.copy(c),d);g.method="options",f(i,g,e)}};return Object.defineProperty(j,"protocol",{get:function(){return i.protocol}}),Object.defineProperty(j,"host",{get:function(){return i.host}}),Object.defineProperty(j,"port",{get:function(){return i.port}}),j}}),"undefined"!=typeof module&&"undefined"!=typeof module.exports&&(module.exports=msngr);
\ No newline at end of file
diff --git a/package.json b/package.json
index e2dd75c..f6b5255 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "msngr",
"main": "msngr.js",
"description": "An asynchronous messaging library, written in JavaScript, for node and browser use",
- "version": "5.0.0",
+ "version": "5.0.1",
"keywords": [
"message",
"messaging",
diff --git a/resources/simex-logo.png b/resources/simex-logo.png
new file mode 100644
index 0000000..c917e2d
Binary files /dev/null and b/resources/simex-logo.png differ
diff --git a/src/main.js b/src/main.js
index 79213ed..74558bd 100644
--- a/src/main.js
+++ b/src/main.js
@@ -18,7 +18,7 @@ var msngr = msngr || (function () {
};
// Built version of msngr.js for programatic access; this is auto generated
- external.version = "5.0.0";
+ external.version = "5.0.1";
// Takes a function, executes it passing in the external and internal interfaces
external.extend = function (fn) {