openapi-eller icon indicating copy to clipboard operation
openapi-eller copied to clipboard

In the TypeScript target universal-url doesn't work in React Native

Open zbrox opened this issue 6 years ago • 0 comments

Previous versions just had a simple shim for the URL object, something like:

function URL(relative: string, base:string) {
    const baseUrl = base.replace(/\/+$/, "")
    const relativeUrl = relative.replace(/^\/+/, "")

    this.toString = function toString() {
        return `${baseUrl}/${relativeUrl}`
    }
}

zbrox avatar Aug 30 '18 13:08 zbrox