to-string.js 291 B

123456789
  1. var global = require('../internals/global');
  2. var classof = require('../internals/classof');
  3. var String = global.String;
  4. module.exports = function (argument) {
  5. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  6. return String(argument);
  7. };