Repository URL to install this package:
|
Version:
2.0.8 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const composition_1 = require("@skava/modules/___dist/composition");
const remapStores = store => {
const { string, array } = composition_1.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 } = composition_1.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;
};
exports.transformStoreLocator = transformStoreLocator;
exports.default = transformStoreLocator;
//# sourceMappingURL=transform.js.map