function normalizeCompoundObjectKey(keyPaths, key) {
  let normalizedKey = []

  keyPaths.forEach((keyPath) => {
    let keyValue = key

    keyPath.split(".").forEach((fieldName) => {
      if (!keyValue.hasOwnProperty(fieldName)) {
        throw new Error(`The ${keyPath} key path is not defined in the ` +
            "provided compound key")
      }

      keyValue = keyValue[fieldName]
    })

    normalizedKey.push(keyValue)
  })

  return normalizedKey
}
function normalizeCompoundObjectKey(keyPaths, key) {
  let normalizedKey = []

  keyPaths.forEach((keyPath) => {
    let keyValue = key

    keyPath.split(".").forEach((fieldName) => {
      if (!keyValue.hasOwnProperty(fieldName)) {
        throw new Error(`The ${keyPath} key path is not defined in the ` +
            "provided compound key")
      }

      keyValue = keyValue[fieldName]
    })

    normalizedKey.push(keyValue)
  })

  return normalizedKey
}
function normalizeCompoundObjectKey ( keyPaths , key ) { let normalizedKey = [ ] keyPaths . forEach ( ( keyPath ) => { let keyValue = key keyPath . split ( "." ) . forEach ( ( fieldName ) => { if ( ! keyValue . hasOwnProperty ( fieldName ) ) { throw new Error ( ` ${ keyPath } ` + "provided compound key" ) } keyValue = keyValue [ fieldName ] } ) normalizedKey . push ( keyValue ) } ) return normalizedKey }
Normalizes the provided compound key represented as an object into a
compound key representation compatible with the Indexed DB.

@param {string[]} keyPaths The key paths of this storage.
@param {Object} key The compound key to normalize for use with the Indexed
DB.
@return {Array<(number|string|Date|Array)>} Normalized compound key.
Normalizes the provided compound key represented as an object into a compound key representation compatible with the Indexed DB .