decord/source/7606_isMatchingPattern.js

148 lines
3.3 KiB
JavaScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 7606
// Function ID: 7607
2026-07-29 08:29:29 +00:00
// Name: isMatchingPattern
2026-08-25 06:04:03 +00:00
// Dependencies: [7604]
2026-07-29 08:29:29 +00:00
2026-08-25 06:04:03 +00:00
// Module 7606 (isMatchingPattern)
import isInstanceOf from "isInstanceOf" /* 7604 */;
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
const dependencyMap = arg6;
arg5.isMatchingPattern = function isMatchingPattern(arr, test) {
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
const isStringResult = isInstanceOf.isString(arr);
2026-07-29 08:29:29 +00:00
if (!isStringResult) {
return isStringResult;
} else {
2026-08-25 06:04:03 +00:00
let tmpResult = tmp(7604);
2026-07-29 08:29:29 +00:00
if (tmpResult.isRegExp(test)) {
let isMatch = test.test(arr);
} else {
2026-08-25 06:04:03 +00:00
tmpResult = tmp(7604);
2026-07-29 08:29:29 +00:00
isMatch = tmpResult.isString(test);
if (isMatch) {
if (flag) {
let hasItem = arr === test;
} else {
hasItem = arr.includes(test);
}
}
}
}
};
arg5.safeJoin = function safeJoin(arg0, arg1) {
if (Array.isArray(arg0)) {
const items = [];
let num = 0;
if (0 < arg0.length) {
try {
const push = items.push;
if (obj.isVueViewModel(tmp2)) {
let arr = push("[VueViewModel]");
} else {
const _String = String;
arr = push(String(tmp2));
}
num = num + 1;
2026-08-24 06:08:38 +00:00
obj = isInstanceOf;
2026-07-29 08:29:29 +00:00
} catch (err) {
arr.push(tmp);
}
}
return items.join(arg1);
} else {
return "";
}
};
arg5.snipLine = function snipLine(arr) {
if (arr.length <= 150) {
return arr;
} else {
let tmp = arg1;
if (arg1 > length) {
tmp = length;
}
const _Math = Math;
let num3 = Math.max(tmp - 60, 0);
if (num3 < 5) {
num3 = 0;
}
const _Math2 = Math;
let bound = Math.min(num3 + 140, length);
if (bound > length - 5) {
bound = length;
}
if (bound === length) {
const _Math3 = Math;
num3 = Math.max(bound - 140, 0);
}
const substr = arr.slice(num3, bound);
let combined = substr;
if (num3 > 0) {
const _HermesInternal = HermesInternal;
combined = "'{snip} " + substr;
}
let text = combined;
if (bound < length) {
text = `${tmp6} {snip}`;
}
return text;
}
};
arg5.stringMatchesSomePattern = function stringMatchesSomePattern(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
let items = arg1;
if (arg1 === undefined) {
items = [];
}
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
return items.some((test) => {
if (flag === undefined) {
flag = false;
}
const isStringResult = callback(flag[0]).isString(callback);
if (!isStringResult) {
return isStringResult;
} else {
let tmpResult = tmp(tmp2[0]);
if (tmpResult.isRegExp(test)) {
let isMatch = test.test(obj);
} else {
tmpResult = tmp(tmp2[0]);
isMatch = tmpResult.isString(test);
if (isMatch) {
if (flag) {
let hasItem = obj === test;
} else {
hasItem = obj.includes(test);
}
}
}
}
});
};
2026-08-04 21:03:28 +00:00
arg5.truncate = function truncate(str) {
2026-07-29 08:29:29 +00:00
let num = arg1;
if (arg1 === undefined) {
num = 0;
}
2026-08-04 21:03:28 +00:00
let combined = str;
if (typeof str === "string") {
combined = str;
2026-07-29 08:29:29 +00:00
if (0 !== num) {
2026-08-04 21:03:28 +00:00
combined = str;
if (str.length > num) {
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal;
2026-08-04 21:03:28 +00:00
combined = "" + str.slice(0, num) + "...";
2026-07-29 08:29:29 +00:00
}
}
}
return combined;
};