Compare commits
No commits in common. "74773f12cd874775feaa9547036e65f409e85535" and "9bc97fa1956fd5c01924b9ad73095aaefae26e1d" have entirely different histories.
74773f12cd
...
9bc97fa195
|
@ -14,8 +14,8 @@ export default class DHTCache extends EventEmitter {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
});
|
});
|
||||||
private _cache;
|
private _cache;
|
||||||
get cache(): string[];
|
get cache(): {};
|
||||||
get allCache(): string[];
|
get all_cache(): string[];
|
||||||
addItem(item: string | Buffer): void;
|
addItem(item: string | Buffer): void;
|
||||||
private _compileMessage;
|
private _compileMessage;
|
||||||
private _broadcastMessage;
|
private _broadcastMessage;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAYlC,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAa1C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,YAAY;IAChD,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACrB,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,WAAW,CAAW;IAE9B,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC;gBAGxB,KAAK,EAAE,GAAG,EACV,EACE,EAA4B,EAC5B,GAAG,IAAI,EACR,GAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAO;IAkC7C,OAAO,CAAC,MAAM,CAAc;IAE5B,IAAW,KAAK,IAAI,MAAM,EAAE,CAE3B;IAED,IAAW,QAAQ,IAAI,MAAM,EAAE,CAU9B;IAEM,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAqBpC,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,iBAAiB;IAIlB,UA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+53,7 @@ class DHTCache extends events_1.default {
|
||||||
get cache() {
|
get cache() {
|
||||||
return [...this._cache].sort();
|
return [...this._cache].sort();
|
||||||
}
|
}
|
||||||
get allCache() {
|
get all_cache() {
|
||||||
const items = [];
|
const items = [];
|
||||||
for (const id of this.graph.nodesIter()) {
|
for (const id of this.graph.nodesIter()) {
|
||||||
const item = this.graph.node.get(id);
|
const item = this.graph.node.get(id);
|
||||||
|
|
|
@ -73,11 +73,11 @@ export default class DHTCache extends EventEmitter {
|
||||||
|
|
||||||
private _cache: Set<string>;
|
private _cache: Set<string>;
|
||||||
|
|
||||||
public get cache(): string[] {
|
public get cache(): {} {
|
||||||
return [...this._cache].sort();
|
return [...this._cache].sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
public get allCache(): string[] {
|
public get all_cache(): string[] {
|
||||||
const items = [];
|
const items = [];
|
||||||
for (const id of this.graph.nodesIter()) {
|
for (const id of this.graph.nodesIter()) {
|
||||||
const item = this.graph.node.get(id);
|
const item = this.graph.node.get(id);
|
||||||
|
|
4
test.js
4
test.js
|
@ -54,8 +54,8 @@ test("Basic presence test / data propagation", (t) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
t.pass("Seeing everyone online");
|
t.pass("Seeing everyone online");
|
||||||
|
|
||||||
t.equals(true, p2.allCache.includes(peerData1[0]));
|
t.equals(true, p2.all_cache.includes(peerData1[0]));
|
||||||
t.equals(true, p1.allCache.includes(peerData2[0]));
|
t.equals(true, p1.all_cache.includes(peerData2[0]));
|
||||||
|
|
||||||
hasFinished = true;
|
hasFinished = true;
|
||||||
peer2._allConnections.get(peer1.keyPair.publicKey).end();
|
peer2._allConnections.get(peer1.keyPair.publicKey).end();
|
||||||
|
|
Loading…
Reference in New Issue