@php-wasm/utilFunctionsensureAbsolutePathensureAbsolutePath CallableensureAbsolutePath(path: string): stringGuarantees a path is absolute by prepending / if needed. Useful when working with user-provided paths that might be relative, or when you need to normalize edge cases like empty strings. For example: ensureAbsolutePath('wp-content/uploads') '/wp-content/uploads'ensureAbsolutePath('/already/absolute') '/already/absolute'ensureAbsolutePath('') '/'Parameterspath: stringThe path to make absolute.Returns stringAn absolute, normalized path starting with /.
Guarantees a path is absolute by prepending
/if needed.Useful when working with user-provided paths that might be relative, or when you need to normalize edge cases like empty strings.
For example: