Files
discord-decomp/sources/utils/PathUtils.tsx
T
2026-07-28 01:06:53 +03:00

55 lines
2.6 KiB
TypeScript

/* Metro module 4283; source: utils/PathUtils.tsx; dependencies: [477, 2] */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun36330(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4455:6, offset: 0x01089372, size: 124 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = function(a0, a1) {
var r4;
var value = a0;
var value2 = value.split(RegExp('[/\\\\]', ''));
r4 = value2[value2.length - 1] === '' ? value : value2[value2.length - 1];
return a1 != null && r4.endsWith(a1) ? r4.slice(0, -a1.length) : r4;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('utils/PathUtils.tsx');
exports.pathJoin = function(a0) {
var r3;
var r2;
var value = copyRestArgs(0, r3);
r2 = require(dependencyMap[0]).isWindows() ? '\\' : '/';
value = value.filter(_fun36333);
return value.join(r2);
};
exports.pathBasename = closure;
exports.pathFilenameWithoutExt = pathFilenameWithoutExt;
function pathJoin(a0) { // fn#36332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4455:301, offset: 0x01089462, size: 80 bytes, params: 2, frame: 12
let value = copyRestArgs(0, undefined);
const r2 = (require(477) /* metro dependency 477: PlatformUtils */).isWindows() ? '\\' : '/';
value = value.filter(function(a0) {
return a0.length > 0;
});
return value.join(r2);
}
function pathFilenameWithoutExt(a0) { // fn#36334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4455:455, offset: 0x010894b2, size: 54 bytes, params: 2, frame: 14
var r0;
var value;
const value2 = pathBasename(a0).lastIndexOf('.');
if (value2 <= 0) {
r0 = value;
} else {
value = value.slice(0, value2);
r0 = value;
}
return r0;
}
}
function _fun36333({length}) { // fn#36333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4455:377, offset: 0x00d88c66, size: 16 bytes, params: 2, frame: 2
return length > 0;
}
global.__d(_fun36330, 4283, [477, 2]) /* metro module 4283, dependencies: [477, 2] */;