lib/parsers/orderItems.js
/**
 * Transform known integer and bool fields from strings to real integer and boolean
 *
 * @private
 * @param {OrderItem} item - OrderItem
 * @returns {OrderItem} - OrderItem with the quantities parseInt()ed, and bools converted from strings
 */
Transform known integer and bool fields from strings to real integer and boolean
@private
@param {OrderItem} item - OrderItem
@returns {OrderItem} - OrderItem with the quantities parseInt()ed, and bools converted from strings
Transform known integer and bool fields from strings to real integer and boolean @private @param { OrderItem } item - OrderItem @returns { OrderItem } - OrderItem with the quantities parseInt () ed and bools converted from strings
function transformIntsAndBools(item) {
    const {
        quantityOrdered,
        quantityShipped,
        isGift,
        productInfo = {},
        isTransparency,
        serialNumberRequired,
        ...restItem
    } = item;
    const {
        numberOfItems,
        ...restProductInfo
    } = productInfo;
    return {
        ...restItem,
        isGift: stringToBool(isGift),
        isTransparency: stringToBool(isTransparency),
        serialNumberRequired: stringToBool(serialNumberRequired),
        quantityOrdered: stringToInt(quantityOrdered),
        quantityShipped: stringToInt(quantityShipped),
        productInfo: {
            ...restProductInfo,
            numberOfItems: stringToInt(numberOfItems),
        },
    };
}
function transformIntsAndBools ( item ) { const { quantityOrdered , quantityShipped , isGift , productInfo = { } , isTransparency , serialNumberRequired , ... restItem } = item ; const { numberOfItems , ... restProductInfo } = productInfo ; return { ... restItem , isGift : stringToBool ( isGift ) , isTransparency : stringToBool ( isTransparency ) , serialNumberRequired : stringToBool ( serialNumberRequired ) , quantityOrdered : stringToInt ( quantityOrdered ) , quantityShipped : stringToInt ( quantityShipped ) , productInfo : { ... restProductInfo , numberOfItems : stringToInt ( numberOfItems ) , } , } ; }
Transform known integer and bool fields from strings to real integer and boolean
 @private
 @param {OrderItem} item - OrderItem
 @returns {OrderItem} - OrderItem with the quantities parseInt()ed, and bools converted from strings
Transform known integer and bool fields from strings to real integer and boolean @private @param { OrderItem } item - OrderItem @returns { OrderItem } - OrderItem with the quantities parseInt () ed and bools converted from strings