blister
Advanced tools
Comparing version 0.9.0 to 0.9.1
@@ -69,3 +69,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Blister = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
var wrapper = this._deps[id]; | ||
return wrapper && wrapper(this); | ||
return wrapper && wrapper(); | ||
}, | ||
@@ -135,2 +135,3 @@ | ||
var originalWrapper = isExtension ? this._deps[id] : undefined; | ||
var originalType = originalWrapper && originalWrapper.type; | ||
@@ -141,4 +142,4 @@ var typeOfValue = typeof value; | ||
type = VALUE; | ||
} else if (isExtension) { | ||
type = originalWrapper.type; | ||
} else if (isExtension && originalType !== VALUE) { | ||
type = originalType; | ||
} else { | ||
@@ -145,0 +146,0 @@ type = SINGLETON; |
@@ -1,2 +0,2 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Blister=e()}}(function(){return function e(t,n,r){function i(u,f){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!f&&s)return s(u,!0);if(o)return o(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var p=n[u]={exports:{}};t[u][0].call(p.exports,function(e){var n=t[u][1][e];return i(n?n:e)},p,p.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,t){"use strict";function n(){this._deps={}}var r=e("./wrappers"),i="VALUE",o="SINGLETON",u="FACTORY";n.prototype={constructor:n,VALUE:i,SINGLETON:o,FACTORY:u,get:function(e){var t=this._deps[e];return t&&t(this)},set:function(e,t,n){return this._set(e,t,n)},extend:function(e,t,n){if(!this._deps[e])throw new Error("Cannot extend a dependency not previously set: "+e);return this._set(e,t,n,!0)},_set:function(e,t,n,u){if("string"!=typeof e)throw new TypeError("The dependency id must be a string: "+e);var f=u?this._deps[e]:void 0,s=typeof t;if(n||(n="function"!==s?i:u?f.type:o),"function"!==s&&n!==i)throw new TypeError("The value must be a function for types SINGLETON and FACTORY: "+t);return this._deps[e]=r.create(n,t,this,f),this},register:function(e){return e.register(this),this}},t.exports=n},{"./wrappers":2}],2:[function(e,t){"use strict";var n={VALUE:function(e){return function(){return e}},FACTORY:function(e,t,n){return function(){var r=n&&n();return e.call(t,t,r)}},SINGLETON:function(e,t,n){var r,i=!1;return function(){var o;return i||(i=!0,o=n&&n(),r=e.call(t,t,o),e=null),r}},create:function(e,t,n,r){var i=this[e](t,n,r);return i.type=e,i}};t.exports=n},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Blister=e()}}(function(){return function e(t,n,r){function i(u,f){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!f&&s)return s(u,!0);if(o)return o(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var p=n[u]={exports:{}};t[u][0].call(p.exports,function(e){var n=t[u][1][e];return i(n?n:e)},p,p.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,t){"use strict";function n(){this._deps={}}var r=e("./wrappers"),i="VALUE",o="SINGLETON",u="FACTORY";n.prototype={constructor:n,VALUE:i,SINGLETON:o,FACTORY:u,get:function(e){var t=this._deps[e];return t&&t()},set:function(e,t,n){return this._set(e,t,n)},extend:function(e,t,n){if(!this._deps[e])throw new Error("Cannot extend a dependency not previously set: "+e);return this._set(e,t,n,!0)},_set:function(e,t,n,u){if("string"!=typeof e)throw new TypeError("The dependency id must be a string: "+e);var f=u?this._deps[e]:void 0,s=f&&f.type,c=typeof t;if(n||(n="function"!==c?i:u&&s!==i?s:o),"function"!==c&&n!==i)throw new TypeError("The value must be a function for types SINGLETON and FACTORY: "+t);return this._deps[e]=r.create(n,t,this,f),this},register:function(e){return e.register(this),this}},t.exports=n},{"./wrappers":2}],2:[function(e,t){"use strict";var n={VALUE:function(e){return function(){return e}},FACTORY:function(e,t,n){return function(){var r=n&&n();return e.call(t,t,r)}},SINGLETON:function(e,t,n){var r,i=!1;return function(){var o;return i||(i=!0,o=n&&n(),r=e.call(t,t,o),e=null),r}},create:function(e,t,n,r){var i=this[e](t,n,r);return i.type=e,i}};t.exports=n},{}]},{},[1])(1)}); | ||
//# sourceMappingURL=blister.min.js.map |
{ | ||
"name": "blister", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"author": "Rubén Norte <rubennorte@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Minimalist dependency injection container for JavaScript", |
@@ -68,3 +68,3 @@ 'use strict'; | ||
var wrapper = this._deps[id]; | ||
return wrapper && wrapper(this); | ||
return wrapper && wrapper(); | ||
}, | ||
@@ -134,2 +134,3 @@ | ||
var originalWrapper = isExtension ? this._deps[id] : undefined; | ||
var originalType = originalWrapper && originalWrapper.type; | ||
@@ -140,4 +141,4 @@ var typeOfValue = typeof value; | ||
type = VALUE; | ||
} else if (isExtension) { | ||
type = originalWrapper.type; | ||
} else if (isExtension && originalType !== VALUE) { | ||
type = originalType; | ||
} else { | ||
@@ -144,0 +145,0 @@ type = SINGLETON; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
49152
494
0