rune-sdk
Version:
Build a multiplayer game played by millions! Your game runs inside the Rune app with 10 million installs across [iOS](https://apps.apple.com/app/rune-games-and-voice-chat/id1450358364) and [Android](https://play.google.com/store/apps/details?id=ai.rune.ti
10 lines (9 loc) • 508 B
JavaScript
import path from "node:path";
export function normalizeId(id) {
//For some reason on windows some paths are returned with \x00 at the beginning. Remove it.
const idWithoutNull = id.startsWith("\x00") ? id.slice(1) : id;
//Try to unify paths so that no matter what platform they run on they would use /.
//This is necessary due to vite not providing platform specific paths in some cases
const platformAgnosticId = idWithoutNull.split(path.sep).join("/");
return platformAgnosticId;
}