_date-to-primitive.js 317 B

123456789
  1. 'use strict';
  2. var anObject = require('./_an-object');
  3. var toPrimitive = require('./_to-primitive');
  4. var NUMBER = 'number';
  5. module.exports = function (hint) {
  6. if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
  7. return toPrimitive(anObject(this), hint != NUMBER);
  8. };