'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _typeof = require('./typeof.cjs');

function toPrimitive(t, r) {
  if ("object" != _typeof.default(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof.default(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}

exports.default = toPrimitive;
//# sourceMappingURL=toPrimitive.cjs.map
