Skip to content

Commit 503502d

Browse files
committed
adds hoek dependency and .gitignore
1 parent 4d6aa96 commit 503502d

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.idea
2+
*.iml
3+
npm-debug.log
4+
dump.rdb
5+
node_modules
6+
results.tap
7+
results.xml
8+
npm-shrinkwrap.json
9+
config.json
10+
.DS_Store
11+
*/.DS_Store
12+
*/*/.DS_Store
13+
._*
14+
*/._*
15+
*/*/._*
16+
coverage.*
17+
lib-cov
18+

lib/index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var util = require('util');
2+
var Hoek = require('hoek');
23
var url = require('url');
34
var querystring = require('querystring');
45
var events = require('events');
@@ -71,11 +72,7 @@ EtcdConfig.prototype.load = function (path, callback) {
7172
key.splice(0, 3);
7273
var keyPath = key.join('.')
7374

74-
var functionBody = 'return config.' + keyPath;
75-
76-
var getOldValue = new Function('config', 'keyPath', functionBody);
77-
78-
var oldValue = getOldValue(config, keyPath);
75+
var oldValue = Hoek.reach(config, keyPath);
7976

8077
var eventObj = {};
8178
switch (changed.method) {

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
"bugs": {
2323
"url": "https://github.com/deedubs/node-etcd-config/issues"
2424
},
25-
"homepage": "https://github.com/deedubs/node-etcd-config"
25+
"homepage": "https://github.com/deedubs/node-etcd-config",
26+
"dependencies": {
27+
"hoek": "^2.11.1"
28+
}
2629
}

0 commit comments

Comments
 (0)