Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

date-to-primitive.js 523B

1234567891011121314
  1. 'use strict';
  2. var anObject = require('../internals/an-object');
  3. var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
  4. var $TypeError = TypeError;
  5. // `Date.prototype[@@toPrimitive](hint)` method implementation
  6. // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
  7. module.exports = function (hint) {
  8. anObject(this);
  9. if (hint === 'string' || hint === 'default') hint = 'string';
  10. else if (hint !== 'number') throw new $TypeError('Incorrect hint');
  11. return ordinaryToPrimitive(this, hint);
  12. };