H3lp Yours3lfDocs
api

normalizePath

Normalize path spelling without resolving files or validating containment.

normalizePath(path: string) → string
local normalizePath = require 'scripts.s3.normalizePath'
assert(normalizePath('Config\\MyMod//Icon') == 'config/mymod/icon')

The function lowercases the string, converts backslashes to forward slashes, and collapses repeated forward slashes. It returns the transformed string without mutating anything outside the call. It has no OpenMW imports or filesystem access.

Input must be a string. There is no result cache; normalization performs string operations each time. Normalize stable identifiers once rather than repeatedly inside a hot callback.

See Your First H3 Integration for a runnable script.