Skip to content
Permalink
Newer
Older
100644 18 lines (12 sloc) 427 Bytes
Ignoring revisions in .git-blame-ignore-revs.
1
'use strict';
2
3
var GetIntrinsic = require('get-intrinsic');
4
5
var $String = GetIntrinsic('%String%');
6
var $TypeError = GetIntrinsic('%TypeError%');
7
8
var Type = require('../Type');
9
10
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-tostring
11
12
module.exports = function NumberToString(x) {
13
if (Type(x) !== 'Number') {
14
throw new $TypeError('Assertion failed: `x` must be a Number');
15
}
16
17
return $String(x);
18
};