decord/alpha/source/utils/native/StringUtils.tsx

42 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-10-10 08:08:14 +00:00
// Module ID: 10269
// Function ID: 10270
// Dependencies: [10268, 2]
2026-07-20 16:05:17 +00:00
// Exports: splitGraphemes
2026-10-10 08:08:14 +00:00
// Module 10269
import _modDef10268 from "module_10268" /* 10268 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const result = size.fileFinishedImporting("utils/native/StringUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
export const splitGraphemes = function splitGraphemes(name) {
2026-10-10 08:08:14 +00:00
const obj = _modDef10268();
2026-07-20 16:05:17 +00:00
const items = [];
2026-10-03 08:58:59 +00:00
let match = obj.exec(name);
2026-07-20 16:05:17 +00:00
let num = 0;
let num2 = 0;
if (null !== match) {
do {
if (match.index > num) {
let push = items.push;
let _Array = Array;
let items1 = [];
2026-10-03 08:58:59 +00:00
let arraySpreadResult = HermesBuiltin.arraySpread(items1, Array.from(name.slice(num, match.index)), 0);
let applyResult = HermesBuiltin.apply(push, items1, items);
2026-07-20 16:05:17 +00:00
}
let arr = items.push(match[0]);
num = obj.lastIndex;
2026-10-03 08:58:59 +00:00
match = obj.exec(name);
2026-07-20 16:05:17 +00:00
num2 = num;
} while (null !== match);
}
2026-10-03 08:58:59 +00:00
if (num2 < name.length) {
2026-07-20 16:05:17 +00:00
const push2 = items.push;
const _Array2 = Array;
const items2 = [];
2026-10-03 08:58:59 +00:00
HermesBuiltin.arraySpread(items2, Array.from(name.slice(num2)), 0);
HermesBuiltin.apply(push2, items2, items);
2026-07-20 16:05:17 +00:00
}
return items;
};