decord/source/__polyfill/12xxx/module_12935.js
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

148 lines
3.4 KiB
JavaScript

// Module ID: 12935
// Function ID: 12936
// Dependencies: [12933]
// Exports: isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate
// Module 12935
import _mod12933 from "module_12933" /* 12933 */;
require = arg1;
const dependencyMap = arg6;
export const isMatchingPattern = function isMatchingPattern(arr, test) {
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
const isStringResult = _mod12933.isString(arr);
if (!isStringResult) {
return isStringResult;
} else {
if (tmpResult.isRegExp(test)) {
let isMatch = test.test(arr);
} else {
isMatch = tmp(12933).isString(test);
if (isMatch) {
if (flag) {
let hasItem = arr === test;
} else {
hasItem = arr.includes(test);
}
}
const tmpResult2 = tmp(12933);
}
tmpResult = tmp(12933);
}
};
export const 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)) {
push("[VueViewModel]");
} else {
const _String = String;
push(String(tmp2));
}
num = num + 1;
obj = _mod12933;
} catch (err) {
arr.push(tmp);
}
}
return items.join(arg1);
} else {
return "";
}
};
export const snipLine = function snipLine(arr, arg1) {
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;
}
};
export const stringMatchesSomePattern = function stringMatchesSomePattern(arg0) {
closure_0 = arg0;
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 = _mod12933.isString(closure_0);
if (!isStringResult) {
return isStringResult;
} else {
if (tmpResult.isRegExp(test)) {
let isMatch = test.test(obj);
} else {
isMatch = tmp(12933).isString(test);
if (isMatch) {
if (flag) {
let hasItem = obj === test;
} else {
hasItem = obj.includes(test);
}
}
const tmpResult2 = tmp(12933);
}
tmpResult = tmp(12933);
}
});
};
export const truncate = function truncate(str) {
let num = arg1;
if (arg1 === undefined) {
num = 0;
}
let combined = str;
if (typeof str === "string") {
combined = str;
if (0 !== num) {
combined = str;
if (str.length > num) {
const _HermesInternal = HermesInternal;
combined = "" + str.slice(0, num) + "...";
}
}
}
return combined;
};