import { EmpathyAdapterBuilder } from '@empathyco/x-adapter' ; import { Result } from '@empathyco/x-types' ; param adapterBuilder returns internal export function configureAdapterWithToysrus ( adapterBuilder ) { adapterBuilder . addMapper ( ( _ , result ) => { result . url = `./product_page.html?productId=${ result . id }` ; result . identifier . value = `${ result . id }` ; result . rating = { value : Number ( result . id . toString ( ) . slice ( 1 ) ) % 6 } ; return result ; } , 'results' ) . setFacetConfig ( { modelName : 'HierarchicalFacet' } , 'categories_facet' ) . setFacetConfig ( { modelName : 'NumberRangeFacet' , template : '<!tag=price>price:[<min> TO <max>]' } , 'price' ) ; return adapterBuilder ; }