node_modules/es-abstract/2021/DateString.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2021/DateString.js in immosquare-cleaner-0.1.38
- old
+ new
@@ -1,26 +1,23 @@
'use strict';
-var GetIntrinsic = require('get-intrinsic');
+var $TypeError = require('es-errors/type');
-var $TypeError = GetIntrinsic('%TypeError%');
-
var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var $isNaN = require('../helpers/isNaN');
var padTimeComponent = require('../helpers/padTimeComponent');
-var Type = require('./Type');
-var WeekDay = require('./WeekDay');
+var DateFromTime = require('./DateFromTime');
var MonthFromTime = require('./MonthFromTime');
+var WeekDay = require('./WeekDay');
var YearFromTime = require('./YearFromTime');
-var DateFromTime = require('./DateFromTime');
// https://262.ecma-international.org/9.0/#sec-datestring
module.exports = function DateString(tv) {
- if (Type(tv) !== 'Number' || $isNaN(tv)) {
+ if (typeof tv !== 'number' || $isNaN(tv)) {
throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number');
}
var weekday = weekdays[WeekDay(tv)];
var month = months[MonthFromTime(tv)];
var day = padTimeComponent(DateFromTime(tv));