to-string.js 259 B

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