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

42 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-10-02 13:37:24 +00:00
// Module ID: 10407
// Function ID: 10408
// Dependencies: [10406, 2]
// Exports: splitGraphemes
2026-10-02 13:37:24 +00:00
// Module 10407
import _modDef10406 from "module_10406" /* 10406 */;
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("utils/native/StringUtils.tsx");
2026-10-02 13:37:24 +00:00
export const splitGraphemes = function splitGraphemes(name) {
const obj = _modDef10406();
const items = [];
2026-10-02 13:37:24 +00:00
let match = obj.exec(name);
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-02 13:37:24 +00:00
let arraySpreadResult = HermesBuiltin.arraySpread(items1, Array.from(name.slice(num, match.index)), 0);
2026-10-01 14:13:23 +00:00
let applyResult = HermesBuiltin.apply(push, items1, items);
}
let arr = items.push(match[0]);
num = obj.lastIndex;
2026-10-02 13:37:24 +00:00
match = obj.exec(name);
num2 = num;
} while (null !== match);
}
2026-10-02 13:37:24 +00:00
if (num2 < name.length) {
const push2 = items.push;
const _Array2 = Array;
const items2 = [];
2026-10-02 13:37:24 +00:00
HermesBuiltin.arraySpread(items2, Array.from(name.slice(num2)), 0);
2026-10-01 14:13:23 +00:00
HermesBuiltin.apply(push2, items2, items);
}
return items;
};