Creates a validated Path from a string.
The raw path or filename string
If true, sanitizes the filename and prepends a UUIDv7
A branded Path value
When the path is empty
// Create unique path from user-uploaded filenameconst path = makePath("my image.jpg", true);// Result: "01912c9a-5e8a-7b5c-8a1b-2c3d4e5f6a7b-myimage.jpg"// Use existing path as-isconst existingPath = makePath("existing-path.jpg", false); Copy
// Create unique path from user-uploaded filenameconst path = makePath("my image.jpg", true);// Result: "01912c9a-5e8a-7b5c-8a1b-2c3d4e5f6a7b-myimage.jpg"// Use existing path as-isconst existingPath = makePath("existing-path.jpg", false);
Creates a validated Path from a string.