Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@glimmer/di

Package Overview
Dependencies
Maintainers
10
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glimmer/di - npm Package Compare versions

Comparing version 0.1.11 to 0.2.0

dist/amd/es5/glimmer-di.js

5

Brocfile.js
"use strict";
const build = require('@glimmer/build');
const buildVendorPackage = require('@glimmer/build/lib/build-vendor-package');
let buildOptions = {};
module.exports = build(buildOptions);
module.exports = build();

33

dist/commonjs/es2017/container.js

@@ -33,4 +33,7 @@ 'use strict';

let singleton = this._registry.registeredOption(specifier, 'singleton') !== false;
if (singleton && this._lookups[specifier]) {
return this._lookups[specifier];
if (singleton) {
let lookup = this._lookups[specifier];
if (lookup) {
return lookup.instance;
}
}

@@ -44,7 +47,7 @@ let factory = this.factoryFor(specifier);

}
let object = factory.create();
if (singleton && object) {
this._lookups[specifier] = object;
let instance = factory.create();
if (singleton && instance) {
this._lookups[specifier] = { factory, instance };
}
return object;
return instance;
}

@@ -54,2 +57,11 @@ defaultInjections(specifier) {

}
teardown() {
let specifiers = Object.keys(this._lookups);
for (let i = 0; i < specifiers.length; i++) {
let specifier = specifiers[i];
let { factory, instance } = this._lookups[specifier];
factory.teardown(instance);
}
}
defaultTeardown(instance) {}
buildInjections(specifier) {

@@ -69,2 +81,9 @@ let hash = this.defaultInjections(specifier);

class: factoryDefinition,
teardown: instance => {
if (factoryDefinition.teardown) {
factoryDefinition.teardown(instance);
} else {
this.defaultTeardown(instance);
}
},
create(options) {

@@ -78,2 +97,2 @@ let mergedOptions = Object.assign({}, injections, options);

exports.default = Container;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFpbmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic3JjL2NvbnRhaW5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzI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GRJbmplY3Rpb25zKHNwZWNpZmllcik7XG5cbiAgICByZXR1cm4ge1xuICAgICAgY2xhc3M6IGZhY3RvcnlEZWZpbml0aW9uLFxuICAgICAgdGVhcmRvd246IChpbnN0YW5jZSkgPT4ge1xuICAgICAgICBpZiAoZmFjdG9yeURlZmluaXRpb24udGVhcmRvd24pIHtcbiAgICAgICAgICBmYWN0b3J5RGVmaW5pdGlvbi50ZWFyZG93bihpbnN0YW5jZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5kZWZhdWx0VGVhcmRvd24oaW5zdGFuY2UpO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgY3JlYXRlKG9wdGlvbnMpIHtcbiAgICAgICAgbGV0IG1lcmdlZE9wdGlvbnMgPSBPYmplY3QuYXNzaWduKHt9LCBpbmplY3Rpb25zLCBvcHRpb25zKTtcblxuICAgICAgICByZXR1cm4gZmFjdG9yeURlZmluaXRpb24uY3JlYXRlKG1lcmdlZE9wdGlvbnMpO1xuICAgICAgfVxuICAgIH1cbiAgfVxufVxuIl19
"use strict";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNyYy9mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZhY3RvcnlEZWZpbml0aW9uPFQ+IHtcbiAgY3JlYXRlKGluamVjdGlvbnM/OiBPYmplY3QpOiBUO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEZhY3Rvcnk8VD4ge1xuICBjbGFzczogRmFjdG9yeURlZmluaXRpb248VD47XG4gIGNyZWF0ZShpbmplY3Rpb25zPzogT2JqZWN0KTogVDtcbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJza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yxTQUFHLEFBQUssQUFBQyxBQUN4QjtBQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUmVnaXN0cmF0aW9uT3B0aW9ucyB9IGZyb20gJy4vcmVnaXN0cnknO1xuaW1wb3J0IHsgRmFjdG9yeSB9IGZyb20gJy4vZmFjdG9yeSc7XG5cbi8vIFRPRE8gLSB1c2Ugc3ltYm9sXG5leHBvcnQgY29uc3QgT1dORVIgPSAnX19vd25lcl9fJztcblxuZXhwb3J0IGZ1bmN0aW9uIGdldE93bmVyKG9iamVjdDogb2JqZWN0KTogT3duZXIge1xuICByZXR1cm4gb2JqZWN0W09XTkVSXTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHNldE93bmVyKG9iamVjdDogb2JqZWN0LCBvd25lcjogT3duZXIpOiB2b2lkIHtcbiAgb2JqZWN0W09XTkVSXSA9IG93bmVyO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIE93bmVyIHtcbiAgaWRlbnRpZnkoc3BlY2lmaWVyOiBzdHJpbmcsIHJlZmVycmVyPzogc3RyaW5nKTogc3RyaW5nO1xuXG4gIGZhY3RvcnlGb3Ioc3BlY2lmaWVyOiBzdHJpbmcsIHJlZmVycmVyPzogc3RyaW5nKTogRmFjdG9yeTxhbnk+O1xuICBcbiAgbG9va3VwKHNwZWNpZmllcjogc3RyaW5nLCByZWZlcnJlcj86IHN0cmluZyk6IGFueTtcbn1cbiJdfQ==

@@ -45,4 +45,7 @@ 'use strict';

var singleton = this._registry.registeredOption(specifier, 'singleton') !== false;
if (singleton && this._lookups[specifier]) {
return this._lookups[specifier];
if (singleton) {
var lookup = this._lookups[specifier];
if (lookup) {
return lookup.instance;
}
}

@@ -56,7 +59,7 @@ var factory = this.factoryFor(specifier);

}
var object = factory.create();
if (singleton && object) {
this._lookups[specifier] = object;
var instance = factory.create();
if (singleton && instance) {
this._lookups[specifier] = { factory: factory, instance: instance };
}
return object;
return instance;
};

@@ -68,2 +71,16 @@

Container.prototype.teardown = function teardown() {
var specifiers = Object.keys(this._lookups);
for (var i = 0; i < specifiers.length; i++) {
var specifier = specifiers[i];
var _lookups$specifier = this._lookups[specifier],
factory = _lookups$specifier.factory,
instance = _lookups$specifier.instance;
factory.teardown(instance);
}
};
Container.prototype.defaultTeardown = function defaultTeardown(instance) {};
Container.prototype.buildInjections = function buildInjections(specifier) {

@@ -81,5 +98,14 @@ var hash = this.defaultInjections(specifier);

Container.prototype.buildFactory = function buildFactory(specifier, factoryDefinition) {
var _this = this;
var injections = this.buildInjections(specifier);
return {
class: factoryDefinition,
teardown: function (instance) {
if (factoryDefinition.teardown) {
factoryDefinition.teardown(instance);
} else {
_this.defaultTeardown(instance);
}
},
create: function (options) {

@@ -96,2 +122,2 @@ var mergedOptions = Object.assign({}, injections, options);

exports.default = Container;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFpbmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic3JjL2NvbnRhaW5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs0QkFXRTt1QkFBWSxBQUF3QjtZQUFFLCtFQUFxQixBQUFJOzs4QkFDN0QsQUFBSTs7YUFBQyxBQUFTLFlBQUcsQUFBUSxBQUFDLEFBQzFCLEFBQUk7YUFBQyxBQUFTLFlBQUcsQUFBUSxBQUFDLEFBQzFCLEFBQUk7YUFBQyxBQUFRLFdBQUcsQUFBRSxBQUFDLEFBQ25CLEFBQUk7YUFBQyxBQUF5Qiw0QkFBRyxBQUFFLEFBQUMsQUFDdEMsQUFBQzs7O3dCQUVELEFBQVUsaUNBQUMsQUFBaUIsV0FDMUI7WUFBSSxBQUFpQixvQkFBMkIsQUFBSSxLQUFDLEFBQXlCLDBCQUFDLEFBQVMsQUFBQyxBQUFDLEFBRTFGLEFBQUUsQUFBQztZQUFDLENBQUMsQUFBaUIsQUFBQyxtQkFBQyxBQ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gICAgICB9LFxuICAgICAgY3JlYXRlKG9wdGlvbnMpIHtcbiAgICAgICAgbGV0IG1lcmdlZE9wdGlvbnMgPSBPYmplY3QuYXNzaWduKHt9LCBpbmplY3Rpb25zLCBvcHRpb25zKTtcblxuICAgICAgICByZXR1cm4gZmFjdG9yeURlZmluaXRpb24uY3JlYXRlKG1lcmdlZE9wdGlvbnMpO1xuICAgICAgfVxuICAgIH1cbiAgfVxufVxuIl19
"use strict";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNyYy9mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZhY3RvcnlEZWZpbml0aW9uPFQ+IHtcbiAgY3JlYXRlKGluamVjdGlvbnM/OiBPYmplY3QpOiBUO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEZhY3Rvcnk8VD4ge1xuICBjbGFzczogRmFjdG9yeURlZmluaXRpb248VD47XG4gIGNyZWF0ZShpbmplY3Rpb25zPzogT2JqZWN0KTogVDtcbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNyYy9mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZhY3RvcnlEZWZpbml0aW9uPFQ+IHtcbiAgY3JlYXRlKGluamVjdGlvbnM/OiBvYmplY3QpOiBUO1xuICB0ZWFyZG93bj8oaW5zdGFuY2U6IG9iamVjdCk6IHZvaWQ7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRmFj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TkVSXTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHNldE93bmVyKG9iamVjdDogb2JqZWN0LCBvd25lcjogT3duZXIpOiB2b2lkIHtcbiAgb2JqZWN0W09XTkVSXSA9IG93bmVyO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIE93bmVyIHtcbiAgaWRlbnRpZnkoc3BlY2lmaWVyOiBzdHJpbmcsIHJlZmVycmVyPzogc3RyaW5nKTogc3RyaW5nO1xuXG4gIGZhY3RvcnlGb3Ioc3BlY2lmaWVyOiBzdHJpbmcsIHJlZmVycmVyPzogc3RyaW5nKTogRmFjdG9yeTxhbnk+O1xuICBcbiAgbG9va3VwKHNwZWNpZmllcjogc3RyaW5nLCByZWZlcnJlcj86IHN0cmluZyk6IGFueTtcbn1cbiJdfQ==

@@ -28,4 +28,7 @@ export default class Container {

let singleton = (this._registry.registeredOption(specifier, 'singleton') !== false);
if (singleton && this._lookups[specifier]) {
return this._lookups[specifier];
if (singleton) {
let lookup = this._lookups[specifier];
if (lookup) {
return lookup.instance;
}
}

@@ -39,7 +42,7 @@ let factory = this.factoryFor(specifier);

}
let object = factory.create();
if (singleton && object) {
this._lookups[specifier] = object;
let instance = factory.create();
if (singleton && instance) {
this._lookups[specifier] = { factory, instance };
}
return object;
return instance;
}

@@ -49,2 +52,12 @@ defaultInjections(specifier) {

}
teardown() {
let specifiers = Object.keys(this._lookups);
for (let i = 0; i < specifiers.length; i++) {
let specifier = specifiers[i];
let { factory, instance } = this._lookups[specifier];
factory.teardown(instance);
}
}
defaultTeardown(instance) {
}
buildInjections(specifier) {

@@ -64,2 +77,10 @@ let hash = this.defaultInjections(specifier);

class: factoryDefinition,
teardown: (instance) => {
if (factoryDefinition.teardown) {
factoryDefinition.teardown(instance);
}
else {
this.defaultTeardown(instance);
}
},
create(options) {

@@ -72,2 +93,2 @@ let mergedOptions = Object.assign({}, injections, options);

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY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ogT2JqZWN0KTogVDtcbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNyYy9mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZhY3RvcnlEZWZpbml0aW9uPFQ+IHtcbiAgY3JlYXRlKGluamVjdGlvbnM/OiBvYmplY3QpOiBUO1xuICB0ZWFyZG93bj8oaW5zdGFuY2U6IG9iamVjdCk6IHZvaWQ7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgRmFjdG9yeTxUPiB7XG4gIGNsYXNzOiBGYWN0b3J5RGVmaW5pdGlvbjxUPjtcbiAgY3JlYXRlKGluamVjdGlvbnM/OiBvYmplY3QpOiBUO1xuICB0ZWFyZG93bihpbnN0YW5jZTogYW55KTogdm9pZDtcbn1cbiJdfQ==

@@ -9,2 +9,2 @@ // TODO - use symbol

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3duZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvb3duZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0Esb0JBQW9CO0FBQ3BCLE1BQU0sQ0FBQyxNQUFNLEtBQUssR0FBRyxXQUFXLENBQUM7QUFFakMsTUFBTSxtQkFBbUIsTUFBYztJQUNyQyxNQUFNLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3ZCLENBQUM7QUFFRCxNQUFNLG1CQUFtQixNQUFjLEVBQUUsS0FBWTtJQUNuRCxNQUFNLENBQUMsS0FBSyxDQUFDLEdBQUcsS0FBSyxDQUFDO0FBQ3hCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBSZ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QUMsS0FBSyxDQUFDLEdBQUcsS0FBSyxDQUFDO0FBQ3hCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBSZWdpc3RyYXRpb25PcHRpb25zIH0gZnJvbSAnLi9yZWdpc3RyeSc7XG5pbXBvcnQgeyBGYWN0b3J5IH0gZnJvbSAnLi9mYWN0b3J5JztcblxuLy8gVE9ETyAtIHVzZSBzeW1ib2xcbmV4cG9ydCBjb25zdCBPV05FUiA9ICdfX293bmVyX18nO1xuXG5leHBvcnQgZnVuY3Rpb24gZ2V0T3duZXIob2JqZWN0OiBvYmplY3QpOiBPd25lciB7XG4gIHJldHVybiBvYmplY3RbT1dORVJdO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gc2V0T3duZXIob2JqZWN0OiBvYmplY3QsIG93bmVyOiBPd25lcik6IHZvaWQge1xuICBvYmplY3RbT1dORVJdID0gb3duZXI7XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgT3duZXIge1xuICBpZGVudGlmeShzcGVjaWZpZXI6IHN0cmluZywgcmVmZXJyZXI/OiBzdHJpbmcpOiBzdHJpbmc7XG5cbiAgZmFjdG9yeUZvcihzcGVjaWZpZXI6IHN0cmluZywgcmVmZXJyZXI/OiBzdHJpbmcpOiBGYWN0b3J5PGFueT47XG4gIFxuICBsb29rdXAoc3BlY2lmaWVyOiBzdHJpbmcsIHJlZmVycmVyPzogc3RyaW5nKTogYW55O1xufVxuIl19

@@ -36,4 +36,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var singleton = this._registry.registeredOption(specifier, 'singleton') !== false;
if (singleton && this._lookups[specifier]) {
return this._lookups[specifier];
if (singleton) {
var lookup = this._lookups[specifier];
if (lookup) {
return lookup.instance;
}
}

@@ -47,7 +50,7 @@ var factory = this.factoryFor(specifier);

}
var object = factory.create();
if (singleton && object) {
this._lookups[specifier] = object;
var instance = factory.create();
if (singleton && instance) {
this._lookups[specifier] = { factory: factory, instance: instance };
}
return object;
return instance;
};

@@ -59,2 +62,16 @@

Container.prototype.teardown = function teardown() {
var specifiers = Object.keys(this._lookups);
for (var i = 0; i < specifiers.length; i++) {
var specifier = specifiers[i];
var _lookups$specifier = this._lookups[specifier],
factory = _lookups$specifier.factory,
instance = _lookups$specifier.instance;
factory.teardown(instance);
}
};
Container.prototype.defaultTeardown = function defaultTeardown(instance) {};
Container.prototype.buildInjections = function buildInjections(specifier) {

@@ -72,5 +89,14 @@ var hash = this.defaultInjections(specifier);

Container.prototype.buildFactory = function buildFactory(specifier, factoryDefinition) {
var _this = this;
var injections = this.buildInjections(specifier);
return {
class: factoryDefinition,
teardown: function (instance) {
if (factoryDefinition.teardown) {
factoryDefinition.teardown(instance);
} else {
_this.defaultTeardown(instance);
}
},
create: function (options) {

@@ -87,2 +113,2 @@ var mergedOptions = Object.assign({}, injections, options);

export default Container;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFpbmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic3JjL2NvbnRhaW5lci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFXRSx1QkFBWSxBQUF3QjtZQUFFLCtFQUFxQixBQUFJOzs7O0FBQzdELEFBQUksYUFBQyxBQUFTLFlBQUcsQUFBUSxBQUFDO0FBQzFCLEFBQUksYUFBQyxBQUFTLFlBQUcsQUFBUSxBQUFDO0FBQzFCLEFBQUksYUFBQyxBQUFRLFdBQUcsQUFBRSxBQUFDO0FBQ25CLEFBQUksYUFBQyxBQUF5Qiw0QkFBRyxBQUFFLEFBQUMsQUFDdEM7QUFBQzs7d0JBRUQsQUFBVSxpQ0FBQyxBQUFpQjtBQUMxQixZQUFJLEFBQWlCLG9CQUEyQixBQUFJLEtBQUMsQUFBeUIsMEJBQUMsQUFBUyxBQUFDLEFBQUM7QUFFMUYsQUFBRSxBQUFDLFlBQ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jZSk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBjcmVhdGUob3B0aW9ucykge1xuICAgICAgICBsZXQgbWVyZ2VkT3B0aW9ucyA9IE9iamVjdC5hc3NpZ24oe30sIGluamVjdGlvbnMsIG9wdGlvbnMpO1xuXG4gICAgICAgIHJldHVybiBmYWN0b3J5RGVmaW5pdGlvbi5jcmVhdGUobWVyZ2VkT3B0aW9ucyk7XG4gICAgICB9XG4gICAgfVxuICB9XG59XG4iXX0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNyYy9mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZhY3RvcnlEZWZpbml0aW9uPFQ+IHtcbiAgY3JlYXRlKGluamVjdGlvbnM/OiBPYmplY3QpOiBUO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEZhY3Rvcnk8VD4ge1xuICBjbGFzczogRmFjdG9yeURlZmluaXRpb248VD47XG4gIGNyZWF0ZShpbmplY3Rpb25zPzogT2JqZWN0KTogVDtcbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInNyYy9mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIEZhY3RvcnlEZWZpbml0aW9uPFQ+IHtcbiAgY3JlYXRlKGluamVjdGlvbnM/OiBvYmplY3QpOiBUO1xuICB0ZWFyZG93bj8oaW5zdGFuY2U6IG9iamVjdCk6IHZvaWQ7XG59XG5cbmV4cG9ydC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iamVjdFtPV05FUl07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzZXRPd25lcihvYmplY3Q6IG9iamVjdCwgb3duZXI6IE93bmVyKTogdm9pZCB7XG4gIG9iamVjdFtPV05FUl0gPSBvd25lcjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBPd25lciB7XG4gIGlkZW50aWZ5KHNwZWNpZmllcjogc3RyaW5nLCByZWZlcnJlcj86IHN0cmluZyk6IHN0cmluZztcblxuICBmYWN0b3J5Rm9yKHNwZWNpZmllcjogc3RyaW5nLCByZWZlcnJlcj86IHN0cmluZyk6IEZhY3Rvcnk8YW55PjtcbiAgXG4gIGxvb2t1cChzcGVjaWZpZXI6IHN0cmluZywgcmVmZXJyZXI/OiBzdHJpbmcpOiBhbnk7XG59XG4iXX0=

@@ -12,5 +12,7 @@ import { Factory } from './factory';

lookup(specifier: string): any;
defaultInjections(specifier: string): Object;
defaultInjections(specifier: string): object;
teardown(): void;
defaultTeardown(instance: any): void;
private buildInjections(specifier);
private buildFactory(specifier, factoryDefinition);
}
export interface FactoryDefinition<T> {
create(injections?: Object): T;
create(injections?: object): T;
teardown?(instance: object): void;
}
export interface Factory<T> {
class: FactoryDefinition<T>;
create(injections?: Object): T;
create(injections?: object): T;
teardown(instance: any): void;
}
import { Factory } from './factory';
export declare const OWNER = "__owner__";
export declare function getOwner(object: Object): Owner;
export declare function setOwner(object: Object, owner: Owner): void;
export declare function getOwner(object: object): Owner;
export declare function setOwner(object: object, owner: Owner): void;
export interface Owner {

@@ -6,0 +6,0 @@ identify(specifier: string, referrer?: string): string;

{
"name": "@glimmer/di",
"version": "0.1.11",
"version": "0.2.0",
"description": "Dependency injection support for Glimmer applications.",

@@ -21,3 +21,3 @@ "contributors": [

"devDependencies": {
"@glimmer/build": "^0.4.0",
"@glimmer/build": "^0.6.0",
"broccoli": "^1.1.0",

@@ -24,0 +24,0 @@ "broccoli-cli": "^1.0.0",

@@ -6,6 +6,11 @@ import { Factory, FactoryDefinition } from './factory';

interface Lookup {
factory: Factory<any>;
instance: any;
}
export default class Container {
private _registry: RegistryReader;
private _resolver: Resolver;
private _lookups: Dict<any>;
private _lookups: Dict<Lookup>;
private _factoryDefinitionLookups: Dict<FactoryDefinition<any>>;

@@ -47,4 +52,7 @@

if (singleton && this._lookups[specifier]) {
return this._lookups[specifier];
if (singleton) {
let lookup = this._lookups[specifier];
if (lookup) {
return lookup.instance;
}
}

@@ -59,16 +67,29 @@

let object = factory.create();
let instance = factory.create();
if (singleton && object) {
this._lookups[specifier] = object;
if (singleton && instance) {
this._lookups[specifier] = { factory, instance };
}
return object;
return instance;
}
defaultInjections(specifier: string): Object {
defaultInjections(specifier: string): object {
return {};
}
private buildInjections(specifier: string): Object {
teardown(): void {
let specifiers = Object.keys(this._lookups);
for (let i=0;i<specifiers.length;i++) {
let specifier = specifiers[i];
let { factory, instance } = this._lookups[specifier];
factory.teardown(instance);
}
}
defaultTeardown(instance): void {
}
private buildInjections(specifier: string): object {
let hash = this.defaultInjections(specifier);

@@ -91,2 +112,9 @@ let injections: Injection[] = this._registry.registeredInjections(specifier);

class: factoryDefinition,
teardown: (instance) => {
if (factoryDefinition.teardown) {
factoryDefinition.teardown(instance);
} else {
this.defaultTeardown(instance);
}
},
create(options) {

@@ -93,0 +121,0 @@ let mergedOptions = Object.assign({}, injections, options);

export interface FactoryDefinition<T> {
create(injections?: Object): T;
create(injections?: object): T;
teardown?(instance: object): void;
}

@@ -7,3 +8,4 @@

class: FactoryDefinition<T>;
create(injections?: Object): T;
create(injections?: object): T;
teardown(instance: any): void;
}

@@ -7,7 +7,7 @@ import { RegistrationOptions } from './registry';

export function getOwner(object: Object): Owner {
export function getOwner(object: object): Owner {
return object[OWNER];
}
export function setOwner(object: Object, owner: Owner): void {
export function setOwner(object: object, owner: Owner): void {
object[OWNER] = owner;

@@ -14,0 +14,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc