// import invariant from "@octetstream/invariant"

/**
 * Create an object from given entries
 *
 * @param {array} entries
 */
function objectFromEntries(entries) {
  const res = {}

  for (const [paths, value] of entries) {
    const root = paths.shift()

    if (paths.length < 1) {
      res[root] = value
    } else {
      // noop
    }
  }

  return res
}

export default objectFromEntries

@@ -116,16 +116,283 @@
 entries%0A
+ *%0A * @return %7Bobject%7D%0A *%0A * @example%0A *%0A * const entries = %5B%0A *   %5B%0A *     %5B%22name%22%5D, %22John Doe%22%0A *   %5D,%0A *   %5B%0A *     %5B%22age%22%5D, 25%0A *   %5D,%0A *   %5B%0A *     %5B%22gender%22%5D, %22Male%22%0A *   %5D%0A * %5D%0A *%0A * objectFromEntries(entries) // -%3E %7Bname: %22John Doe%22, age: 25, gender: %22Male%22%7D%0A
  */%0Afunc

Add an example to objectFromEntries comments.