Skip to content
This repository was archived by the owner on Dec 18, 2020. It is now read-only.
This repository was archived by the owner on Dec 18, 2020. It is now read-only.

encodeURIComponent can explode. #16

@damncabbage

Description

@damncabbage

encodeURIComponent is encoded as String -> String.

This is a counter-example to that type:

> encodeURIComponent( [737,58851,43953,5591,56687,47584,10580,64494].map(function(x) { return String.fromCharCode(x); }).join("") );
URIError: malformed URI sequence

I'd argue it should be String -> Maybe String, to account for the possibility of the exception, with an Unsafe twin that pretends String -> String is accurate (like with Regex vs Regex.Unsafe).

(I came across this while generating strings with String.fromCharArray <<< Jack.boundedChar; boundedChar is defined here, but is basically any character.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions