Skip to content
This repository was archived by the owner on Jun 18, 2019. It is now read-only.

Commit ef454a1

Browse files
authored
feat(ConfigContainer): now uses Proxy to create proxy class
1 parent 90e9a59 commit ef454a1

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.babelrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
}
88
},
99
"presets": [
10-
"env"
10+
["env", {
11+
"targets": {
12+
"node": 6
13+
}
14+
}]
1115
],
1216
"plugins": [
1317
["babel-plugin-transform-builtin-extend", {

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,8 @@
6666
"lodash": "^4.17.4",
6767
"recursive-iterator": "^2.0.3",
6868
"yargs-parser": "^7.0.0"
69+
},
70+
"engines": {
71+
"node": ">=6.0.0"
6972
}
7073
}

src/ConfigContainer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,14 @@ class ConfigContainer {
103103

104104
/**
105105
* @param {*} T
106-
* @returns {Function}
106+
* @returns {Proxy<T>}
107107
*/
108108
proxy(T) {
109-
return () => this.resolve(T);
109+
return new Proxy(function() {}, {
110+
construct: () => {
111+
return this.resolve(T);
112+
}
113+
});
110114
}
111115
}
112116

0 commit comments

Comments
 (0)