Sha256: 004a01205f913e62ac95d519dbfe714a051e8b8381b4363af04bea0df9a1fee3

Contents?: true

Size: 482 Bytes

Versions: 48

Compression:

Stored size: 482 Bytes

Contents

var _typeof = require("../helpers/typeof");

function _toPrimitive(input, hint) {
  if (_typeof(input) !== "object" || input === null) return input;
  var prim = input[Symbol.toPrimitive];

  if (prim !== undefined) {
    var res = prim.call(input, hint || "default");
    if (_typeof(res) !== "object") return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }

  return (hint === "string" ? String : Number)(input);
}

module.exports = _toPrimitive;

Version data entries

48 entries across 48 versions & 8 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/runtime/helpers/toPrimitive.js
disco_app-0.18.0 test/dummy/node_modules/@babel/runtime/helpers/toPrimitive.js
disco_app-0.18.2 test/dummy/node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.7 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.6 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.5 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.4 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.3 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.2 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.1 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.3.5 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-5.0.0 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.3.4 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.3.3 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.3.2 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.3.1 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.3 node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.2.3 node_modules/@babel/runtime/helpers/toPrimitive.js
tang-0.2.1 spec/tang_app/node_modules/@babel/runtime/helpers/toPrimitive.js
trusty-cms-4.2.2 node_modules/@babel/runtime/helpers/toPrimitive.js