packages/theme-product/theme-product.js
function _validateProductStructure(product) {
  if (typeof product !== 'object') {
    throw new TypeError(product + ' is not an object.');
  }

  if (Object.keys(product).length === 0 && product.constructor === Object) {
    throw new Error(product + ' is empty.');
  }
}
function _validateProductStructure(product) {
  if (typeof product !== 'object') {
    throw new TypeError(product + ' is not an object.');
  }

  if (Object.keys(product).length === 0 && product.constructor === Object) {
    throw new Error(product + ' is empty.');
  }
}
function _validateProductStructure ( product ) { if ( typeof product !== 'object' ) { throw new TypeError ( product + ' is not an object.' ) ; } if ( Object . keys ( product ) . length === 0 && product . constructor === Object ) { throw new Error ( product + ' is empty.' ) ; } }
Check if the product data is a valid JS object
Error will be thrown if type is invalid
@param {object} product Product JSON object
Check if the product data is a valid JS object Error will be thrown if type is invalid