decord/source/3606_parseJSON.js

52 lines
1.4 KiB
JavaScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 3606
// Function ID: 27821
2026-07-20 16:05:17 +00:00
// Name: parseJSON
2026-07-23 10:11:24 +00:00
// Dependencies: [3209, 3210]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 3606 (parseJSON)
import _typeof from "_typeof";
import requiredArgs from "requiredArgs";
2026-07-20 16:05:17 +00:00
export default function parseJSON(defaultResult1) {
2026-07-23 10:11:24 +00:00
requiredArgs.default(1, arguments);
2026-07-20 16:05:17 +00:00
if ("string" === typeof defaultResult1) {
const match = defaultResult1.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);
let _Date = Date;
if (match) {
const _Date2 = Date;
let num5 = +match[9];
if (!num5) {
num5 = 0;
}
let num7 = 1;
if ("-" == match[8]) {
num7 = -1;
}
let num10 = +match[10];
if (!num10) {
num10 = 0;
}
let num11 = 1;
if ("-" == match[8]) {
num11 = -1;
}
const text = `${tmp14}00`;
const prototype2 = _Date.prototype;
_Date = new _Date(Date.UTC(tmp8, +match[2] - 1, tmp10, +match[4] - num5 * num7, +match[5] - num10 * num11, tmp13, +`${tmp14}00`.substring(0, 3)));
const tmp11 = +match[4];
const tmp12 = +match[5];
const tmp9 = +match[2];
} else {
const _NaN = NaN;
const prototype = _Date.prototype;
_Date = new _Date(NaN);
}
return _Date;
} else {
2026-07-23 10:11:24 +00:00
return _typeof.default(defaultResult1);
2026-07-20 16:05:17 +00:00
}
};
export default exports.default;