node: reserve 'ns' and 'rs' from plugin ids and add to get()
This commit is contained in:
parent
b66085ac0c
commit
27fe87e509
1 changed files with 8 additions and 0 deletions
|
|
@ -342,6 +342,8 @@ class Node extends EventEmitter {
|
|||
case 'pool':
|
||||
case 'rpc':
|
||||
case 'http':
|
||||
case 'ns':
|
||||
case 'rs':
|
||||
assert(false, `${plugin.id} is already added.`);
|
||||
break;
|
||||
}
|
||||
|
|
@ -401,6 +403,12 @@ class Node extends EventEmitter {
|
|||
case 'http':
|
||||
assert(this.http, 'http is not loaded.');
|
||||
return this.http;
|
||||
case 'rs':
|
||||
assert(this.rs, 'rs is not loaded.');
|
||||
return this.rs;
|
||||
case 'ns':
|
||||
assert(this.ns, 'ns is not loaded.');
|
||||
return this.ns;
|
||||
}
|
||||
|
||||
return this.plugins[name] || null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue