decord/source/utils/PathUtils.tsx

46 lines
1.2 KiB
TypeScript
Raw Normal View History

// Module ID: 13990
// Function ID: 13991
2026-07-29 08:29:29 +00:00
// Name: pathJoin
// Dependencies: [1115, 2]
2026-07-29 08:29:29 +00:00
// Exports: pathBasename, pathFilenameWithoutExt, pathJoin
2026-07-20 16:05:17 +00:00
// Module 13990 (pathJoin)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
const result = set.fileFinishedImporting("utils/PathUtils.tsx");
2026-07-29 08:29:29 +00:00
2026-09-01 10:26:29 +00:00
export const pathJoin = function pathJoin(closure_1, closure_17) {
2026-07-29 08:29:29 +00:00
const items = [...arguments];
let str = "/";
if (obj.isWindows()) {
str = "\\";
}
const found = items.filter((arg0) => arg0.length > 0);
return found.join(str);
};
export const pathBasename = function pathBasename(str) {
2026-07-20 16:05:17 +00:00
let arr = str;
const parts = str.split(/[/\\]/);
if ("" !== parts[parts.length - 1]) {
arr = parts[parts.length - 1];
}
let substr = arr;
if (tmp) {
substr = arr.slice(0, -arg1.length);
}
return substr;
};
2026-07-29 08:29:29 +00:00
export const pathFilenameWithoutExt = function pathFilenameWithoutExt(str) {
let arr = str;
const parts = str.split(/[/\\]/);
if ("" !== parts[parts.length - 1]) {
arr = parts[parts.length - 1];
}
2026-07-20 16:05:17 +00:00
const lastIndexOfResult = arr.lastIndexOf(".");
let substr = arr;
if (lastIndexOfResult > 0) {
substr = arr.slice(0, lastIndexOfResult);
}
return substr;
};