projecte_ionic/node_modules/core-js/internals/date-to-primitive.js
2022-02-09 18:30:03 +01:00

12 lines
451 B
JavaScript
Executable file

'use strict';
var anObject = require('../internals/an-object');
var toPrimitive = require('../internals/to-primitive');
// `Date.prototype[@@toPrimitive](hint)` method implementation
// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
module.exports = function (hint) {
if (hint !== 'string' && hint !== 'number' && hint !== 'default') {
throw TypeError('Incorrect hint');
} return toPrimitive(anObject(this), hint !== 'number');
};