fix adding root namespace to lookups

master
David Kebler 2018-05-28 14:18:20 -07:00
parent 10077e207b
commit 20d2eb09cc
4 changed files with 8 additions and 5 deletions

View File

@ -2,3 +2,7 @@ tests/
test/
*.test.js
testing/
examples/
*.lock
.eslintrc.js
.travis.yml

View File

@ -1,6 +1,6 @@
{
"name": "@uci/base",
"version": "0.1.6",
"version": "0.1.7",
"description": "Multi type and transport JSON packet communication base class. Used in UCI extended classes",
"main": "src/base",
"scripts": {

View File

@ -27,8 +27,8 @@ export default class Base extends EventEmitter {
this._defaultCmds = commands
this._namespaces = namespaces
if (opts.useRootNS) { // add root of instance to checking for command functions - not recommended!
this._namespaces.s.push(null)
this._namespaces.c.push(null)
this._namespaces.s.splice(-1,0,null)
this._namespaces.c.splice(-1,0,null)
}
this.bindFuncs = bindFuncs
// predefined sockets:
@ -217,7 +217,7 @@ export default class Base extends EventEmitter {
consumersProcessor(func) {
for(let name of Object.keys(this.socket)){
if (this.socket[name].type ==='c') {
this.socketNamedProcessor(func,name)
this.socketNameProcessor(func,name)
}
}
}

1
test/.gitignore vendored
View File

@ -1 +0,0 @@
/node_modules/