21 lines
515 B
TypeScript
21 lines
515 B
TypeScript
import {Converter} from "./converter";
|
|
import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service";
|
|
|
|
export class PunycodeEncoder implements Converter {
|
|
|
|
constructor(private nativeLibraryWrapperService: NativeLibraryWrapperService) {
|
|
}
|
|
|
|
getDisplayname(): string {
|
|
return "Encode as punycode";
|
|
}
|
|
|
|
getId(): string {
|
|
return "encodepunycode";
|
|
}
|
|
|
|
convert(input: string): string {
|
|
return this.nativeLibraryWrapperService.punycode.encode(input);
|
|
}
|
|
}
|