"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = objectToTupleArray;

function _foreach() {
  const data = _interopRequireDefault(require("../object/foreach"));

  _foreach = function () {
    return data;
  };

  return data;
}

/**
 * cast an object to tupple array.
 * @name objectToTupleArray
 * @param {*} obj
 * @returns [[string, *]] tuple array representing given object
 * @example
 * ```js
 *  objectToTupleArray({foo: 'bar', bar: 'foo'}) // => [['foo', 'bar'], ['bar', 'foo']]
 * ```
 */
function objectToTupleArray(obj) {
  const arr = [];
  (0, _foreach().default)(obj, (val, key) => {
    arr.push([key, val]);
  });
  return arr;
}