NumberToString.js 400 B

1234567891011121314151617
  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var $String = GetIntrinsic('%String%');
  4. var $TypeError = require('es-errors/type');
  5. // https://262.ecma-international.org/9.0/#sec-tostring-applied-to-the-number-type
  6. module.exports = function NumberToString(m) {
  7. if (typeof m !== 'number') {
  8. throw new $TypeError('Assertion failed: "m" must be a String');
  9. }
  10. return $String(m);
  11. };