Skip to content

Commit 5cf07fc

Browse files
chore(all): prepare release 0.3.1
1 parent 7bf676b commit 5cf07fc

File tree

13 files changed

+1194
-721
lines changed

13 files changed

+1194
-721
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aurelia-dependency-injection",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "A lightweight, extensible dependency injection container for JavaScript.",
55
"keywords": [
66
"aurelia",

dist/amd/annotations.js

Lines changed: 166 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
"use strict";
2-
31
define(["exports"], function (exports) {
4-
var _slice = Array.prototype.slice;
2+
"use strict";
3+
54
var _inherits = function (child, parent) {
5+
if (typeof parent !== "function" && parent !== null) {
6+
throw new TypeError("Super expression must either be null or a function, not " + typeof parent);
7+
}
68
child.prototype = Object.create(parent && parent.prototype, {
79
constructor: {
810
value: child,
@@ -14,147 +16,234 @@ define(["exports"], function (exports) {
1416
if (parent) child.__proto__ = parent;
1517
};
1618

19+
var _prototypeProperties = function (child, staticProps, instanceProps) {
20+
if (staticProps) Object.defineProperties(child, staticProps);
21+
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
22+
};
23+
1724
var Inject = function Inject() {
18-
var keys = _slice.call(arguments);
25+
var keys = [];
26+
27+
for (var _key = 0; _key < arguments.length; _key++) {
28+
keys[_key] = arguments[_key];
29+
}
1930

2031
this.keys = keys;
2132
};
2233

2334
exports.Inject = Inject;
24-
var Registration = function Registration() {};
35+
var Registration = (function () {
36+
var Registration = function Registration() {};
37+
38+
_prototypeProperties(Registration, null, {
39+
register: {
40+
value: function (container, key, fn) {
41+
throw new Error("A custom Registration must implement register(container, key, fn).");
42+
},
43+
writable: true,
44+
enumerable: true,
45+
configurable: true
46+
}
47+
});
2548

26-
Registration.prototype.register = function (container, key, fn) {
27-
throw new Error("A custom Registration must implement register(container, key, fn).");
28-
};
49+
return Registration;
50+
})();
2951

3052
exports.Registration = Registration;
31-
var Transient = (function () {
32-
var _Registration = Registration;
53+
var Transient = (function (Registration) {
3354
var Transient = function Transient(key) {
3455
this.key = key;
3556
};
3657

37-
_inherits(Transient, _Registration);
58+
_inherits(Transient, Registration);
3859

39-
Transient.prototype.register = function (container, key, fn) {
40-
container.registerTransient(this.key || key, fn);
41-
};
60+
_prototypeProperties(Transient, null, {
61+
register: {
62+
value: function (container, key, fn) {
63+
container.registerTransient(this.key || key, fn);
64+
},
65+
writable: true,
66+
enumerable: true,
67+
configurable: true
68+
}
69+
});
4270

4371
return Transient;
44-
})();
72+
})(Registration);
4573

4674
exports.Transient = Transient;
47-
var Singleton = (function () {
48-
var _Registration2 = Registration;
75+
var Singleton = (function (Registration) {
4976
var Singleton = function Singleton(key) {
5077
this.key = key;
5178
};
5279

53-
_inherits(Singleton, _Registration2);
80+
_inherits(Singleton, Registration);
5481

55-
Singleton.prototype.register = function (container, key, fn) {
56-
container.registerSingleton(this.key || key, fn);
57-
};
82+
_prototypeProperties(Singleton, null, {
83+
register: {
84+
value: function (container, key, fn) {
85+
container.registerSingleton(this.key || key, fn);
86+
},
87+
writable: true,
88+
enumerable: true,
89+
configurable: true
90+
}
91+
});
5892

5993
return Singleton;
60-
})();
94+
})(Registration);
6195

6296
exports.Singleton = Singleton;
63-
var Resolver = function Resolver() {};
97+
var Resolver = (function () {
98+
var Resolver = function Resolver() {};
99+
100+
_prototypeProperties(Resolver, null, {
101+
get: {
102+
value: function (container) {
103+
throw new Error("A custom Resolver must implement get(container) and return the resolved instance(s).");
104+
},
105+
writable: true,
106+
enumerable: true,
107+
configurable: true
108+
}
109+
});
64110

65-
Resolver.prototype.get = function (container) {
66-
throw new Error("A custom Resolver must implement get(container) and return the resolved instance(s).");
67-
};
111+
return Resolver;
112+
})();
68113

69114
exports.Resolver = Resolver;
70-
var Lazy = (function () {
71-
var _Resolver = Resolver;
115+
var Lazy = (function (Resolver) {
72116
var Lazy = function Lazy(key) {
73117
this.key = key;
74118
};
75119

76-
_inherits(Lazy, _Resolver);
77-
78-
Lazy.prototype.get = function (container) {
79-
var _this = this;
80-
return function () {
81-
return container.get(_this.key);
82-
};
83-
};
120+
_inherits(Lazy, Resolver);
84121

85-
Lazy.of = function (key) {
86-
return new Lazy(key);
87-
};
122+
_prototypeProperties(Lazy, {
123+
of: {
124+
value: function (key) {
125+
return new Lazy(key);
126+
},
127+
writable: true,
128+
enumerable: true,
129+
configurable: true
130+
}
131+
}, {
132+
get: {
133+
value: function (container) {
134+
var _this = this;
135+
return function () {
136+
return container.get(_this.key);
137+
};
138+
},
139+
writable: true,
140+
enumerable: true,
141+
configurable: true
142+
}
143+
});
88144

89145
return Lazy;
90-
})();
146+
})(Resolver);
91147

92148
exports.Lazy = Lazy;
93-
var All = (function () {
94-
var _Resolver2 = Resolver;
149+
var All = (function (Resolver) {
95150
var All = function All(key) {
96151
this.key = key;
97152
};
98153

99-
_inherits(All, _Resolver2);
100-
101-
All.prototype.get = function (container) {
102-
return container.getAll(this.key);
103-
};
154+
_inherits(All, Resolver);
104155

105-
All.of = function (key) {
106-
return new All(key);
107-
};
156+
_prototypeProperties(All, {
157+
of: {
158+
value: function (key) {
159+
return new All(key);
160+
},
161+
writable: true,
162+
enumerable: true,
163+
configurable: true
164+
}
165+
}, {
166+
get: {
167+
value: function (container) {
168+
return container.getAll(this.key);
169+
},
170+
writable: true,
171+
enumerable: true,
172+
configurable: true
173+
}
174+
});
108175

109176
return All;
110-
})();
177+
})(Resolver);
111178

112179
exports.All = All;
113-
var Optional = (function () {
114-
var _Resolver3 = Resolver;
180+
var Optional = (function (Resolver) {
115181
var Optional = function Optional(key) {
116182
var checkParent = arguments[1] === undefined ? false : arguments[1];
117183
this.key = key;
118184
this.checkParent = checkParent;
119185
};
120186

121-
_inherits(Optional, _Resolver3);
187+
_inherits(Optional, Resolver);
122188

123-
Optional.prototype.get = function (container) {
124-
if (container.hasHandler(this.key, this.checkParent)) {
125-
return container.get(this.key);
189+
_prototypeProperties(Optional, {
190+
of: {
191+
value: function (key) {
192+
var checkParent = arguments[1] === undefined ? false : arguments[1];
193+
return new Optional(key, checkParent);
194+
},
195+
writable: true,
196+
enumerable: true,
197+
configurable: true
126198
}
127-
128-
return null;
129-
};
130-
131-
Optional.of = function (key) {
132-
var checkParent = arguments[1] === undefined ? false : arguments[1];
133-
return new Optional(key, checkParent);
134-
};
199+
}, {
200+
get: {
201+
value: function (container) {
202+
if (container.hasHandler(this.key, this.checkParent)) {
203+
return container.get(this.key);
204+
}
205+
206+
return null;
207+
},
208+
writable: true,
209+
enumerable: true,
210+
configurable: true
211+
}
212+
});
135213

136214
return Optional;
137-
})();
215+
})(Resolver);
138216

139217
exports.Optional = Optional;
140-
var Parent = (function () {
141-
var _Resolver4 = Resolver;
218+
var Parent = (function (Resolver) {
142219
var Parent = function Parent(key) {
143220
this.key = key;
144221
};
145222

146-
_inherits(Parent, _Resolver4);
147-
148-
Parent.prototype.get = function (container) {
149-
return container.parent ? container.parent.get(this.key) : null;
150-
};
223+
_inherits(Parent, Resolver);
151224

152-
Parent.of = function (key) {
153-
return new Parent(key);
154-
};
225+
_prototypeProperties(Parent, {
226+
of: {
227+
value: function (key) {
228+
return new Parent(key);
229+
},
230+
writable: true,
231+
enumerable: true,
232+
configurable: true
233+
}
234+
}, {
235+
get: {
236+
value: function (container) {
237+
return container.parent ? container.parent.get(this.key) : null;
238+
},
239+
writable: true,
240+
enumerable: true,
241+
configurable: true
242+
}
243+
});
155244

156245
return Parent;
157-
})();
246+
})(Resolver);
158247

159248
exports.Parent = Parent;
160249
});

0 commit comments

Comments
 (0)