@@ -10,6 +10,7 @@ import type {
1010 ResourceProvider ,
1111 Selector ,
1212 Service ,
13+ Services ,
1314 SpecificResource ,
1415} from "./types" ;
1516import type {
@@ -85,13 +86,13 @@ function mapToEntities(entities: Record<string, Record<string, NormalizedEntity>
8586 if ( resource && resource . id && type ) {
8687 storeType [ resource . id ] = storeType [ resource . id ]
8788 ? ( mergeEntities ( storeType [ resource . id ] ! , resource , {
88- parent : context . parent ,
89- isTopLevel : topLevel . id === resource . id ,
90- } ) as any )
89+ parent : context . parent ,
90+ isTopLevel : topLevel . id === resource . id ,
91+ } ) as any )
9192 : mergeEntities ( { id : resource . id , type : resource . type } as any , resource , {
92- parent : context . parent ,
93- isTopLevel : topLevel . id === resource . id ,
94- } ) ;
93+ parent : context . parent ,
94+ isTopLevel : topLevel . id === resource . id ,
95+ } ) ;
9596 return {
9697 id : resource . id ,
9798 type : type === "ContentResource" ? type : resource . type ,
@@ -257,8 +258,7 @@ export function mergeEntities(
257258 }
258259
259260 throw new Error (
260- `Can only merge entities with identical identifiers and type! ${ incoming . type } (${ incoming . id } ) => ${
261- ( existing as any ) . type
261+ `Can only merge entities with identical identifiers and type! ${ incoming . type } (${ incoming . id } ) => ${ ( existing as any ) . type
262262 } (${ ( existing as any ) . id } )`
263263 ) ;
264264 }
@@ -308,7 +308,7 @@ function normalizeService(_service: any): any {
308308}
309309
310310function recordServiceForLoading ( store : CompatibleStore [ "entities" ] ) {
311- return ( resource : Service ) => {
311+ return ( resource : Service | Services ) => {
312312 store . Service = store . Service ? store . Service : { } ;
313313 const id : string = ( resource as any ) . id || ( resource as any ) [ "@id" ] ;
314314 const normalizedResource = normalizeService ( resource ) ;
0 commit comments