File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ // A single level of a domain name
3+
4+ const debug = require ( 'debug' ) ( 'd::domain-tree::DomainNameSystem' )
5+
6+ // const TreeData = require('./TreeData')
7+
8+ // module.exports = class DomainNameSystem extends TreeData {
9+
10+ // constructor(parent) {
11+ // super('dns', parent)
12+ // }
13+
14+ // }
15+
16+ module . exports = class DomainNameSystem {
17+
18+ constructor ( host ) {
19+ debug ( 'new dns' , host )
20+ this . _host = host
21+ }
22+
23+ }
Original file line number Diff line number Diff line change 1+
2+ // A single tree nodes data
3+
4+ const debug = require ( 'debug' ) ( 'd::domain-tree::TreeData' )
5+ const _ = require ( 'lodash' )
6+
7+
8+ module . exports = class TreeData {
9+
10+ constructor ( key , parent ) {
11+ debug ( 'creating tree data with key' , key )
12+ this . key = key
13+ this . data = { }
14+ this . data [ key ] = { }
15+ this . parent = parent
16+ this . pdk = this . parent . data [ key ]
17+ }
18+
19+ getKey ( key , item ) {
20+ return this . pdk [ item ]
21+ }
22+
23+ setKey ( key , item , value ) {
24+ return this . pdk [ item ] = value
25+ }
26+
27+ get ( key , item ) {
28+ return this . parent . data [ key ] [ item ]
29+ }
30+
31+ set ( key , item , value ) {
32+ return this . parent . data [ key ] [ item ] = value
33+ }
34+
35+ }
You can’t perform that action at this time.
0 commit comments