16 lines
307 B
TypeScript
16 lines
307 B
TypeScript
import {Converter} from './converter';
|
|
|
|
export class URIEncoder implements Converter {
|
|
getDisplayname(): string {
|
|
return 'Encode URI';
|
|
}
|
|
|
|
getId(): string {
|
|
return 'uriencode';
|
|
}
|
|
|
|
convert(input: string): string {
|
|
return encodeURI(input).replace(/%5B/g, '[').replace(/%5D/g, ']');
|
|
}
|
|
}
|