decord/source/13679_BestFitMatcher.js

37 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 13679
// Function ID: 13680
2026-07-20 16:05:17 +00:00
// Name: BestFitMatcher
2026-08-24 06:08:38 +00:00
// Dependencies: [13675]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 13679 (BestFitMatcher)
2026-07-23 10:11:24 +00:00
const require = arg1;
const dependencyMap = arg6;
2026-07-20 16:05:17 +00:00
arg5.BestFitMatcher = function BestFitMatcher(arg0, arr) {
const items = [];
const reduced = arr.reduce((arg0, str) => {
2026-08-24 06:08:38 +00:00
const replaced = str.replace(items(closure_1_1[0]).UNICODE_EXTENSION_SEQUENCE_REGEX, "");
2026-07-20 16:05:17 +00:00
items.push(replaced);
arg0[replaced] = str;
return arg0;
}, {});
2026-08-24 06:08:38 +00:00
const findBestMatchResult = items(13675).findBestMatch(items, arg0);
2026-07-20 16:05:17 +00:00
let prop;
if (tmp3) {
const arr2 = reduced[findBestMatchResult.matchedDesiredLocale];
const tmp6 = reduced[findBestMatchResult.matchedDesiredLocale].slice(findBestMatchResult.matchedDesiredLocale.length) || undefined;
prop = findBestMatchResult.matchedSupportedLocale;
2026-07-29 08:29:29 +00:00
const tmp4 = reduced[findBestMatchResult.matchedDesiredLocale].slice(findBestMatchResult.matchedDesiredLocale.length) || undefined;
2026-07-20 16:05:17 +00:00
}
if (prop) {
2026-07-29 08:29:29 +00:00
let obj = { locale: null, extension: null };
obj[0] = prop;
obj[1] = tmp4;
2026-07-20 16:05:17 +00:00
return obj;
} else {
2026-07-29 08:29:29 +00:00
obj = { locale: null };
obj[0] = arg2();
2026-07-20 16:05:17 +00:00
return obj;
}
2026-07-23 10:11:24 +00:00
tmp3 = findBestMatchResult.matchedSupportedLocale && findBestMatchResult.matchedDesiredLocale;
2026-07-20 16:05:17 +00:00
};