function uri(src) {
    if (!src || typeof src !== 'string') {
        throw new Error('Invalid URI: source must be a non-empty string')
    }

    // Normalize URI before parsing
    const normalizedSrc = src.trim()

    if (normalizedSrc.includes('digitaloceanspaces.com')) {
        return uriDigitalOcean(normalizedSrc)
    }

    try {
        return uriS3(normalizedSrc)
    } catch (err) {
        // Return consistent error format
        return {
            uri: null,
            bucket: null,
            key: null,
            isPathStyle: false
        }
    }
}
Parse S3 or Digital Ocean Spaces URI
@param {string} src URI string
@returns {Object} Parsed URI object