Repository URL to install this package:
|
Version:
2.0.11 ▾
|
import { getTyped } from '@skava/modules/___dist/composition'
const remapStores = store => {
const { string, array } = getTyped(store)
return {
identifier: string('identifier'),
country: string('country'),
distance: string('distance'),
city: string('city'),
address1: string('address1'),
latitude: string('latitude'),
additionalinfo: array('additionalinfo'),
zipcode: string('zipcode'),
altidentifier: string('altidentifier'),
phone: string('phone'),
name: string('name'),
state: string('state'),
distanceunit: string('distanceunit'),
email: string('email'),
longitude: string('longitude'),
}
}
const transformStoreLocator = response => {
const { string, number, array } = getTyped(response)
const storeLocatorResponse = {
type: string('type'),
// @todo
offset: string('properties.state.offset'),
limit: string('properties.state.limit'),
//
storeinfo: array('properties.storeinfo').map(remapStores),
}
return storeLocatorResponse
}
export { transformStoreLocator }
export default transformStoreLocator