File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @orbitdb/nested-db" ,
3- "version" : " 1.3.5 " ,
3+ "version" : " 1.3.6 " ,
44 "description" : " Nested key-value database type for orbit-db." ,
55 "author" : " Julien Jean Malard-Adam" ,
66 "keywords" : [
Original file line number Diff line number Diff line change @@ -151,17 +151,18 @@ export const toMap = <T extends NestedValueObject>(
151151 return map as unknown as NestedObjectToMap < T > ;
152152} ;
153153
154- export const toObject = < T extends NestedValueMap > (
154+ export const toObject = < T extends Map < string , DagCborEncodable | NestedValueMap | undefined > > (
155155 x : T ,
156156) : NestedMapToObject < T > => {
157157 const dict = { } as NestedMapToObject < T > ;
158158 for ( const [ key , value ] of x . entries ( ) ) {
159+ if ( value === undefined ) continue ;
159160 if ( value instanceof Map ) {
160161 // @ts -expect-error TODO
161162 dict [ key ] = toObject ( value ) ;
162163 } else {
163164 // @ts -expect-error TODO
164- dict [ key as keyof T ] = value ;
165+ dict [ key as keyof typeof dict ] = value ;
165166 }
166167 }
167168 return dict ;
You can’t perform that action at this time.
0 commit comments