feat:node-modules
This commit is contained in:
4
node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts
generated
vendored
Normal file
4
node_modules/dayjs/esm/plugin/advancedFormat/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { PluginFunc } from 'dayjs/esm'
|
||||
|
||||
declare const plugin: PluginFunc
|
||||
export = plugin
|
||||
66
node_modules/dayjs/esm/plugin/advancedFormat/index.js
generated
vendored
Normal file
66
node_modules/dayjs/esm/plugin/advancedFormat/index.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
import { FORMAT_DEFAULT } from '../../constant';
|
||||
export default (function (o, c) {
|
||||
// locale needed later
|
||||
var proto = c.prototype;
|
||||
var oldFormat = proto.format;
|
||||
|
||||
proto.format = function (formatStr) {
|
||||
var _this = this;
|
||||
|
||||
var locale = this.$locale();
|
||||
|
||||
if (!this.isValid()) {
|
||||
return oldFormat.bind(this)(formatStr);
|
||||
}
|
||||
|
||||
var utils = this.$utils();
|
||||
var str = formatStr || FORMAT_DEFAULT;
|
||||
var result = str.replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function (match) {
|
||||
switch (match) {
|
||||
case 'Q':
|
||||
return Math.ceil((_this.$M + 1) / 3);
|
||||
|
||||
case 'Do':
|
||||
return locale.ordinal(_this.$D);
|
||||
|
||||
case 'gggg':
|
||||
return _this.weekYear();
|
||||
|
||||
case 'GGGG':
|
||||
return _this.isoWeekYear();
|
||||
|
||||
case 'wo':
|
||||
return locale.ordinal(_this.week(), 'W');
|
||||
// W for week
|
||||
|
||||
case 'w':
|
||||
case 'ww':
|
||||
return utils.s(_this.week(), match === 'w' ? 1 : 2, '0');
|
||||
|
||||
case 'W':
|
||||
case 'WW':
|
||||
return utils.s(_this.isoWeek(), match === 'W' ? 1 : 2, '0');
|
||||
|
||||
case 'k':
|
||||
case 'kk':
|
||||
return utils.s(String(_this.$H === 0 ? 24 : _this.$H), match === 'k' ? 1 : 2, '0');
|
||||
|
||||
case 'X':
|
||||
return Math.floor(_this.$d.getTime() / 1000);
|
||||
|
||||
case 'x':
|
||||
return _this.$d.getTime();
|
||||
|
||||
case 'z':
|
||||
return "[" + _this.offsetName() + "]";
|
||||
|
||||
case 'zzz':
|
||||
return "[" + _this.offsetName('long') + "]";
|
||||
|
||||
default:
|
||||
return match;
|
||||
}
|
||||
});
|
||||
return oldFormat.bind(this)(result);
|
||||
};
|
||||
});
|
||||
10
node_modules/dayjs/esm/plugin/arraySupport/index.d.ts
generated
vendored
Normal file
10
node_modules/dayjs/esm/plugin/arraySupport/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { PluginFunc } from 'dayjs/esm'
|
||||
|
||||
declare module 'dayjs/esm' {
|
||||
interface ConfigTypeMap {
|
||||
arraySupport: [number?, number?, number?, number?, number?, number?, number?]
|
||||
}
|
||||
}
|
||||
|
||||
declare const plugin: PluginFunc
|
||||
export = plugin
|
||||
33
node_modules/dayjs/esm/plugin/arraySupport/index.js
generated
vendored
Normal file
33
node_modules/dayjs/esm/plugin/arraySupport/index.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
export default (function (o, c, dayjs) {
|
||||
var proto = c.prototype;
|
||||
|
||||
var parseDate = function parseDate(cfg) {
|
||||
var date = cfg.date,
|
||||
utc = cfg.utc;
|
||||
|
||||
if (Array.isArray(date)) {
|
||||
if (utc) {
|
||||
if (!date.length) {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
return new Date(Date.UTC.apply(null, date));
|
||||
}
|
||||
|
||||
if (date.length === 1) {
|
||||
return dayjs(String(date[0])).toDate();
|
||||
}
|
||||
|
||||
return new (Function.prototype.bind.apply(Date, [null].concat(date)))();
|
||||
}
|
||||
|
||||
return date;
|
||||
};
|
||||
|
||||
var oldParse = proto.parse;
|
||||
|
||||
proto.parse = function (cfg) {
|
||||
cfg.date = parseDate.bind(this)(cfg);
|
||||
oldParse.bind(this)(cfg);
|
||||
};
|
||||
});
|
||||
4
node_modules/dayjs/esm/plugin/badMutable/index.d.ts
generated
vendored
Normal file
4
node_modules/dayjs/esm/plugin/badMutable/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { PluginFunc } from 'dayjs/esm'
|
||||
|
||||
declare const plugin: PluginFunc
|
||||
export = plugin
|
||||
61
node_modules/dayjs/esm/plugin/badMutable/index.js
generated
vendored
Normal file
61
node_modules/dayjs/esm/plugin/badMutable/index.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
export default (function (o, c) {
|
||||
// locale needed later
|
||||
var proto = c.prototype;
|
||||
|
||||
proto.$g = function (input, get, set) {
|
||||
if (this.$utils().u(input)) return this[get];
|
||||
return this.$set(set, input);
|
||||
};
|
||||
|
||||
proto.set = function (string, _int) {
|
||||
return this.$set(string, _int);
|
||||
};
|
||||
|
||||
var oldStartOf = proto.startOf;
|
||||
|
||||
proto.startOf = function (units, startOf) {
|
||||
this.$d = oldStartOf.bind(this)(units, startOf).toDate();
|
||||
this.init();
|
||||
return this;
|
||||
};
|
||||
|
||||
var oldAdd = proto.add;
|
||||
|
||||
proto.add = function (number, units) {
|
||||
this.$d = oldAdd.bind(this)(number, units).toDate();
|
||||
this.init();
|
||||
return this;
|
||||
};
|
||||
|
||||
var oldLocale = proto.locale;
|
||||
|
||||
proto.locale = function (preset, object) {
|
||||
if (!preset) return this.$L;
|
||||
this.$L = oldLocale.bind(this)(preset, object).$L;
|
||||
return this;
|
||||
};
|
||||
|
||||
var oldDaysInMonth = proto.daysInMonth;
|
||||
|
||||
proto.daysInMonth = function () {
|
||||
return oldDaysInMonth.bind(this.clone())();
|
||||
};
|
||||
|
||||
var oldIsSame = proto.isSame;
|
||||
|
||||
proto.isSame = function (that, units) {
|
||||
return oldIsSame.bind(this.clone())(that, units);
|
||||
};
|
||||
|
||||
var oldIsBefore = proto.isBefore;
|
||||
|
||||
proto.isBefore = function (that, units) {
|
||||
return oldIsBefore.bind(this.clone())(that, units);
|
||||
};
|
||||
|
||||
var oldIsAfter = proto.isAfter;
|
||||
|
||||
proto.isAfter = function (that, units) {
|
||||
return oldIsAfter.bind(this.clone())(that, units);
|
||||
};
|
||||
});
|
||||
11
node_modules/dayjs/esm/plugin/bigIntSupport/index.d.ts
generated
vendored
Normal file
11
node_modules/dayjs/esm/plugin/bigIntSupport/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { PluginFunc } from 'dayjs/esm'
|
||||
|
||||
declare module 'dayjs/esm' {
|
||||
interface ConfigTypeMap {
|
||||
bigIntSupport: BigInt
|
||||
}
|
||||
export function unix(t: BigInt): Dayjs
|
||||
}
|
||||
|
||||
declare const plugin: PluginFunc
|
||||
export = plugin
|
||||
32
node_modules/dayjs/esm/plugin/bigIntSupport/index.js
generated
vendored
Normal file
32
node_modules/dayjs/esm/plugin/bigIntSupport/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// eslint-disable-next-line valid-typeof
|
||||
var isBigInt = function isBigInt(num) {
|
||||
return typeof num === 'bigint';
|
||||
};
|
||||
|
||||
export default (function (o, c, dayjs) {
|
||||
var proto = c.prototype;
|
||||
|
||||
var parseDate = function parseDate(cfg) {
|
||||
var date = cfg.date;
|
||||
|
||||
if (isBigInt(date)) {
|
||||
return Number(date);
|
||||
}
|
||||
|
||||
return date;
|
||||
};
|
||||
|
||||
var oldParse = proto.parse;
|
||||
|
||||
proto.parse = function (cfg) {
|
||||
cfg.date = parseDate.bind(this)(cfg);
|
||||
oldParse.bind(this)(cfg);
|
||||
};
|
||||
|
||||
var oldUnix = dayjs.unix;
|
||||
|
||||
dayjs.unix = function (timestamp) {
|
||||
var ts = isBigInt(timestamp) ? Number(timestamp) : timestamp;
|
||||
return oldUnix(ts);
|
||||
};
|
||||
});
|
||||
4
node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts
generated
vendored
Normal file
4
node_modules/dayjs/esm/plugin/buddhistEra/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { PluginFunc } from 'dayjs/esm'
|
||||
|
||||
declare const plugin: PluginFunc
|
||||
export = plugin
|
||||
21
node_modules/dayjs/esm/plugin/buddhistEra/index.js
generated
vendored
Normal file
21
node_modules/dayjs/esm/plugin/buddhistEra/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { FORMAT_DEFAULT } from '../../constant';
|
||||
export default (function (o, c) {
|
||||
// locale needed later
|
||||
var proto = c.prototype;
|
||||
var oldFormat = proto.format; // extend en locale here
|
||||
|
||||
proto.format = function (formatStr) {
|
||||
var _this = this;
|
||||
|
||||
var yearBias = 543;
|
||||
var str = formatStr || FORMAT_DEFAULT;
|
||||
var result = str.replace(/(\[[^\]]+])|BBBB|BB/g, function (match, a) {
|
||||
var _this$$utils;
|
||||
|
||||
var year = String(_this.$y + yearBias);
|
||||
var args = match === 'BB' ? [year.slice(-2), 2] : [year, 4];
|
||||
return a || (_this$$utils = _this.$utils()).s.apply(_this$$utils, args.concat(['0']));
|
||||
});
|
||||
return oldFormat.bind(this)(result);
|
||||
};
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user