Safe encodeURIComponent and decodeURIComponent.
import {
encodeComponent,
decodeComponent
} from 'deuri';
// Encode a string, converts to well
// formed string if necessary
encodeComponent(uri);
// Decode the full string
// Returns undefined if uri is malformed
decodeComponent(uri);