debian-mirror-gitlab/core-js/internals/date-to-primitive.js

10 lines
327 B
JavaScript
Raw Normal View History

2019-09-25 13:30:05 +05:30
'use strict';
var anObject = require('../internals/an-object');
var toPrimitive = require('../internals/to-primitive');
module.exports = function (hint) {
if (hint !== 'string' && hint !== 'number' && hint !== 'default') {
throw TypeError('Incorrect hint');
} return toPrimitive(anObject(this), hint !== 'number');
};