function uriDigitalOcean(src) {
    try {
        const url = new URL(src)
        const match = url.hostname.match(DIGITAL_OCEAN_REGEX)

        if (!match) {
            return {
                uri: url,
                region: null,
                bucket: null,
                key: null,
                isPathStyle: false
            }
        }

        const [, subdomain, region] = match
        const pathParts = url.pathname.slice(1).split('/') // Remove leading slash

        // Handle path-style vs virtual hosted-style URLs
        const isPathStyle = !subdomain
        const bucket = isPathStyle ? pathParts[0] : subdomain
        const key = isPathStyle ? pathParts.slice(1).join('/') : pathParts.join('/')

        return {
            uri: url,
            region,
            bucket,
            key: key || null, // Ensure key is null if empty
            isPathStyle
        }
    } catch (err) {
        // Return empty result on invalid URLs
        return {
            uri: null,
            region: null,
            bucket: null,
            key: null,
            isPathStyle: false
        }
    }
}
Parse Digital Ocean Spaces URI
@param {string} src URI string
@returns {Object} Parsed URI object