File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff 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' ) {
Original file line number Diff line number Diff line change 11import { RSA , RSAImpl } from 'crypto/ciphers' ;
2- import { HashedObject } from 'data /model/HashedObject' ;
2+ import { HashedObject } from '.. /model/HashedObject' ;
33import { RSAPublicKey } from './RSAPublicKey' ;
44import { Hashing } from 'data/model/Hashing' ;
55
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments