backbone.radio
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "backbone.radio", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"homepage": "https://github.com/marionettejs/backbone.radio", | ||
@@ -30,5 +30,5 @@ "authors": [ | ||
"dependencies": { | ||
"backbone": "1.0.0 - 1.2.3", | ||
"backbone": "1.0.0 - 1.3.2", | ||
"underscore": "1.4.4 - 1.8.3" | ||
} | ||
} |
@@ -1,11 +0,8 @@ | ||
'use strict'; | ||
// Backbone.Radio v1.0.4 | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
// Backbone.Radio v1.0.3 | ||
(function (global, factory) { | ||
(typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('underscore'), require('backbone')) : typeof define === 'function' && define.amd ? define(['underscore', 'backbone'], factory) : (global.Backbone = global.Backbone || {}, global.Backbone.Radio = factory(global._, global.Backbone)); | ||
})(undefined, function (_, Backbone) { | ||
'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('underscore'), require('backbone')) : | ||
typeof define === 'function' && define.amd ? define(['underscore', 'backbone'], factory) : | ||
(global.Backbone = global.Backbone || {}, global.Backbone.Radio = factory(global._,global.Backbone)); | ||
}(this, function (_,Backbone) { 'use strict'; | ||
@@ -15,2 +12,10 @@ _ = 'default' in _ ? _['default'] : _; | ||
var babelHelpers = {}; | ||
babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { | ||
return typeof obj; | ||
} : function (obj) { | ||
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; | ||
}; | ||
babelHelpers; | ||
var previousRadio = Backbone.Radio; | ||
@@ -20,3 +25,3 @@ | ||
Radio.VERSION = '1.0.3'; | ||
Radio.VERSION = '1.0.4'; | ||
@@ -65,3 +70,3 @@ // This allows you to run multiple instances of Radio on the same | ||
// Handle event maps. | ||
if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { | ||
if ((typeof name === 'undefined' ? 'undefined' : babelHelpers.typeof(name)) === 'object') { | ||
for (var key in name) { | ||
@@ -346,3 +351,4 @@ var result = obj[action].apply(obj, [key, name[key]].concat(rest)); | ||
return Radio; | ||
}); | ||
})); | ||
//# sourceMappingURL=./backbone.radio.js.map |
@@ -1,3 +0,3 @@ | ||
// Backbone.Radio v1.0.3 | ||
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(e,n){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=n(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],n):(e.Backbone=e.Backbone||{},e.Backbone.Radio=n(e._,e.Backbone))}(void 0,function(e,n){function t(e,n,t,r){var o=e[n];return t&&t!==o.callback&&t!==o.callback._callback||r&&r!==o.context?void 0:(delete e[n],!0)}function r(n,r,o,i){n||(n={});for(var u=r?[r]:e.keys(n),s=!1,a=0,c=u.length;c>a;a++)r=u[a],n[r]&&t(n,r,o,i)&&(s=!0);return s}function o(n){return c[n]||(c[n]=e.partial(s.log,n))}function i(n){return e.isFunction(n)?n:function(){return n}}e="default"in e?e["default"]:e,n="default"in n?n["default"]:n;var u=n.Radio,s=n.Radio={};s.VERSION="1.0.3",s.noConflict=function(){return n.Radio=u,this},s.DEBUG=!1,s._debugText=function(e,n,t){return e+(t?" on the "+t+" channel":"")+': "'+n+'"'},s.debugLog=function(e,n,t){s.DEBUG&&console&&console.warn&&console.warn(s._debugText(e,n,t))};var a=/\s+/;s._eventsApi=function(n,t,r,o){if(!r)return!1;var i={};if("object"===("undefined"==typeof r?"undefined":_typeof(r))){for(var u in r){var s=n[t].apply(n,[u,r[u]].concat(o));a.test(u)?e.extend(i,s):i[u]=s}return i}if(a.test(r)){for(var c=r.split(a),l=0,f=c.length;f>l;l++)i[c[l]]=n[t].apply(n,[c[l]].concat(o));return i}return!1},s._callHandler=function(e,n,t){var r=t[0],o=t[1],i=t[2];switch(t.length){case 0:return e.call(n);case 1:return e.call(n,r);case 2:return e.call(n,r,o);case 3:return e.call(n,r,o,i);default:return e.apply(n,t)}};var c={};e.extend(s,{log:function(n,t){if("undefined"!=typeof console){var r=e.drop(arguments,2);console.log("["+n+'] "'+t+'"',r)}},tuneIn:function(e){var n=s.channel(e);return n._tunedIn=!0,n.on("all",o(e)),this},tuneOut:function(e){var n=s.channel(e);return n._tunedIn=!1,n.off("all",o(e)),delete c[e],this}}),s.Requests={request:function(n){var t=e.rest(arguments),r=s._eventsApi(this,"request",n,t);if(r)return r;var o=this.channelName,i=this._requests;if(o&&this._tunedIn&&s.log.apply(this,[o,n].concat(t)),i&&(i[n]||i["default"])){var u=i[n]||i["default"];return t=i[n]?t:arguments,s._callHandler(u.callback,u.context,t)}s.debugLog("An unhandled request was fired",n,o)},reply:function(e,n,t){return s._eventsApi(this,"reply",e,[n,t])?this:(this._requests||(this._requests={}),this._requests[e]&&s.debugLog("A request was overwritten",e,this.channelName),this._requests[e]={callback:i(n),context:t||this},this)},replyOnce:function(n,t,r){if(s._eventsApi(this,"replyOnce",n,[t,r]))return this;var o=this,u=e.once(function(){return o.stopReplying(n),i(t).apply(this,arguments)});return this.reply(n,u,r)},stopReplying:function(e,n,t){return s._eventsApi(this,"stopReplying",e)?this:(e||n||t?r(this._requests,e,n,t)||s.debugLog("Attempted to remove the unregistered request",e,this.channelName):delete this._requests,this)}},s._channels={},s.channel=function(e){if(!e)throw new Error("You must provide a name for the channel.");return s._channels[e]?s._channels[e]:s._channels[e]=new s.Channel(e)},s.Channel=function(e){this.channelName=e},e.extend(s.Channel.prototype,n.Events,s.Requests,{reset:function(){return this.off(),this.stopListening(),this.stopReplying(),this}});var l,f,h=[n.Events,s.Requests];return e.each(h,function(n){e.each(n,function(n,t){s[t]=function(n){return f=e.rest(arguments),l=this.channel(n),l[t].apply(l,f)}})}),s.reset=function(n){var t=n?[this._channels[n]]:this._channels;e.invoke(t,"reset")},s}); | ||
// Backbone.Radio v1.0.4 | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("underscore"),require("backbone")):"function"==typeof define&&define.amd?define(["underscore","backbone"],n):(e.Backbone=e.Backbone||{},e.Backbone.Radio=n(e._,e.Backbone))}(this,function(e,n){"use strict";function t(e,n,t,r){var o=e[n];return t&&t!==o.callback&&t!==o.callback._callback||r&&r!==o.context?void 0:(delete e[n],!0)}function r(n,r,o,i){n||(n={});for(var s=r?[r]:e.keys(n),u=!1,a=0,c=s.length;c>a;a++)r=s[a],n[r]&&t(n,r,o,i)&&(u=!0);return u}function o(n){return l[n]||(l[n]=e.partial(a.log,n))}function i(n){return e.isFunction(n)?n:function(){return n}}e="default"in e?e["default"]:e,n="default"in n?n["default"]:n;var s={};s["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var u=n.Radio,a=n.Radio={};a.VERSION="1.0.4",a.noConflict=function(){return n.Radio=u,this},a.DEBUG=!1,a._debugText=function(e,n,t){return e+(t?" on the "+t+" channel":"")+': "'+n+'"'},a.debugLog=function(e,n,t){a.DEBUG&&console&&console.warn&&console.warn(a._debugText(e,n,t))};var c=/\s+/;a._eventsApi=function(n,t,r,o){if(!r)return!1;var i={};if("object"===("undefined"==typeof r?"undefined":s["typeof"](r))){for(var u in r){var a=n[t].apply(n,[u,r[u]].concat(o));c.test(u)?e.extend(i,a):i[u]=a}return i}if(c.test(r)){for(var l=r.split(c),f=0,h=l.length;h>f;f++)i[l[f]]=n[t].apply(n,[l[f]].concat(o));return i}return!1},a._callHandler=function(e,n,t){var r=t[0],o=t[1],i=t[2];switch(t.length){case 0:return e.call(n);case 1:return e.call(n,r);case 2:return e.call(n,r,o);case 3:return e.call(n,r,o,i);default:return e.apply(n,t)}};var l={};e.extend(a,{log:function(n,t){if("undefined"!=typeof console){var r=e.drop(arguments,2);console.log("["+n+'] "'+t+'"',r)}},tuneIn:function(e){var n=a.channel(e);return n._tunedIn=!0,n.on("all",o(e)),this},tuneOut:function(e){var n=a.channel(e);return n._tunedIn=!1,n.off("all",o(e)),delete l[e],this}}),a.Requests={request:function(n){var t=e.rest(arguments),r=a._eventsApi(this,"request",n,t);if(r)return r;var o=this.channelName,i=this._requests;if(o&&this._tunedIn&&a.log.apply(this,[o,n].concat(t)),i&&(i[n]||i["default"])){var s=i[n]||i["default"];return t=i[n]?t:arguments,a._callHandler(s.callback,s.context,t)}a.debugLog("An unhandled request was fired",n,o)},reply:function(e,n,t){return a._eventsApi(this,"reply",e,[n,t])?this:(this._requests||(this._requests={}),this._requests[e]&&a.debugLog("A request was overwritten",e,this.channelName),this._requests[e]={callback:i(n),context:t||this},this)},replyOnce:function(n,t,r){if(a._eventsApi(this,"replyOnce",n,[t,r]))return this;var o=this,s=e.once(function(){return o.stopReplying(n),i(t).apply(this,arguments)});return this.reply(n,s,r)},stopReplying:function(e,n,t){return a._eventsApi(this,"stopReplying",e)?this:(e||n||t?r(this._requests,e,n,t)||a.debugLog("Attempted to remove the unregistered request",e,this.channelName):delete this._requests,this)}},a._channels={},a.channel=function(e){if(!e)throw new Error("You must provide a name for the channel.");return a._channels[e]?a._channels[e]:a._channels[e]=new a.Channel(e)},a.Channel=function(e){this.channelName=e},e.extend(a.Channel.prototype,n.Events,a.Requests,{reset:function(){return this.off(),this.stopListening(),this.stopReplying(),this}});var f,h,d=[n.Events,a.Requests];return e.each(d,function(n){e.each(n,function(n,t){a[t]=function(n){return h=e.rest(arguments),f=this.channel(n),f[t].apply(f,h)}})}),a.reset=function(n){var t=n?[this._channels[n]]:this._channels;e.invoke(t,"reset")},a}); | ||
//# sourceMappingURL=backbone.radio.min.js.map |
@@ -0,1 +1,5 @@ | ||
### [1.0.4](https://github.com/marionettejs/backbone.radio/releases/tag/1.0.4) | ||
- **Bug fix**: The UMD generated from rollup was setting `global` to `undefined`. | ||
### [1.0.3](https://github.com/marionettejs/backbone.radio/releases/tag/1.0.3) | ||
@@ -2,0 +6,0 @@ |
@@ -12,2 +12,4 @@ import gulp from 'gulp'; | ||
import rollup from 'rollup'; | ||
import babel from 'rollup-plugin-babel'; | ||
import preset from 'babel-preset-es2015-rollup'; | ||
import fs from 'fs'; | ||
@@ -72,3 +74,10 @@ import mkdirp from 'mkdirp'; | ||
rollup.rollup({ | ||
entry: path.join('src', config.entryFileName) | ||
entry: path.join('src', config.entryFileName), | ||
plugins: [ | ||
babel({ | ||
sourceMaps: true, | ||
presets: [preset], | ||
babelrc: false | ||
}) | ||
] | ||
}).then(function(bundle) { | ||
@@ -96,3 +105,2 @@ var banner = getBanner(); | ||
.pipe($.sourcemaps.init({ loadMaps: true })) | ||
.pipe($.babel()) | ||
.pipe($.sourcemaps.write('./', {addComment: false})) | ||
@@ -99,0 +107,0 @@ .pipe(gulp.dest(destinationFolder)) |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/marionettejs/backbone.radio", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"main": "build/backbone.radio.js", | ||
@@ -54,2 +54,3 @@ "keywords": [ | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-es2015-rollup": "^1.1.1", | ||
"babel-register": "^6.3.13", | ||
@@ -60,3 +61,2 @@ "chai": "^3.4.1", | ||
"gulp": "^3.9.0", | ||
"gulp-babel": "^6.1.1", | ||
"gulp-eslint": "^1.1.1", | ||
@@ -81,2 +81,3 @@ "gulp-file": "^0.2.0", | ||
"rollup": "^0.25.4", | ||
"rollup-plugin-babel": "^2.4.0", | ||
"sinon": "^1.17.2", | ||
@@ -83,0 +84,0 @@ "sinon-chai": "^2.8.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1734
120656
35
1