UNPKG

327 BJavaScriptView Raw
1'use strict';
2var anObject = require('../internals/an-object');
3var toPrimitive = require('../internals/to-primitive');
4
5module.exports = function (hint) {
6 if (hint !== 'string' && hint !== 'number' && hint !== 'default') {
7 throw TypeError('Incorrect hint');
8 } return toPrimitive(anObject(this), hint !== 'number');
9};