Pibd-21_Ievlewa_M.D._Intern.../node_modules/es-abstract/2018/ToString.js
2023-12-03 18:52:09 +03:00

16 lines
391 B
JavaScript

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $String = GetIntrinsic('%String%');
var $TypeError = GetIntrinsic('%TypeError%');
// https://262.ecma-international.org/6.0/#sec-tostring
module.exports = function ToString(argument) {
if (typeof argument === 'symbol') {
throw new $TypeError('Cannot convert a Symbol value to a string');
}
return $String(argument);
};