文件操作 - date-to-primitive.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/nodejs/core-js/internals/date-to-primitive.js
编辑文件内容
'use strict'; var anObject = require('../internals/an-object'); var ordinaryToPrimitive = require('../internals/ordinary-to-primitive'); var $TypeError = TypeError; // `Date.prototype[@@toPrimitive](hint)` method implementation // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive module.exports = function (hint) { anObject(this); if (hint === 'string' || hint === 'default') hint = 'string'; else if (hint !== 'number') throw $TypeError('Incorrect hint'); return ordinaryToPrimitive(this, hint); };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件