Skip to content

Commit ffe7512

Browse files
committed
import change to please typecript, typing of the typing function.
1 parent 7c3e5d8 commit ffe7512

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

src/data/containers/Types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class Types {
3939
return satisfies;
4040
}
4141

42-
static hasType(value: any, typ: string) {
42+
static hasType(value: any, typ: string): boolean {
4343
if (typ === 'string') {
4444
return (typeof value) === 'string';
4545
} else if (typ === 'number') {

src/data/identity/RSAKeyPair.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RSA, RSAImpl } from 'crypto/ciphers';
2-
import { HashedObject } from 'data/model/HashedObject';
2+
import { HashedObject } from '../model/HashedObject';
33
import { RSAPublicKey } from './RSAPublicKey';
44
import { Hashing } from 'data/model/Hashing';
55

src/spaces/Resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Resources {
6464
localId = init.config.id;
6565
} else {
6666
let key = RSAKeyPair.generate(1024);
67-
localId = Identity.fromKeyPair({name: 'auto-generated id ' + + new RNGImpl().randomHexString(64)}, key);
67+
localId = Identity.fromKeyPair({name: 'auto-generated id ' + new RNGImpl().randomHexString(64)}, key);
6868
this.config.id = localId;
6969
}
7070

src/storage/store/Store.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,13 @@ class Store {
121121
// having to call this.load(hash).
122122

123123
let loaded = await this.load(hash);
124-
125-
let object = context.objects.get(hash) as HashedObject;
126124

127-
object.setStore(this);
128-
object.setLastHash(hash);
129-
130125
if (loaded === undefined) {
131126

127+
let object = context.objects.get(hash) as HashedObject;
128+
129+
object.setStore(this);
130+
object.setLastHash(hash);
132131
let literal = context.literals.get(hash);
133132

134133
if (literal === undefined) {
@@ -145,6 +144,12 @@ class Store {
145144

146145
// after the backend has stored the object, fire callbacks:
147146
await this.fireCallbacks(literal);
147+
148+
} else {
149+
for (const [hash, obj] of context.objects.entries()) {
150+
obj.setStore(this);
151+
obj.setLastHash(hash);
152+
}
148153
}
149154

150155
}

0 commit comments

Comments
 (0)