converter/src/app/converter/punycodedecoder.ts

21 lines
489 B
TypeScript
Raw Normal View History

2017-04-15 19:04:49 +02:00
import {Converter} from './converter';
import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service';
2016-09-27 23:50:52 +02:00
export class PunycodeDecoder implements Converter {
constructor(private nativeLibraryWrapperService: NativeLibraryWrapperService) {
}
2016-09-27 23:50:52 +02:00
getDisplayname(): string {
2017-04-15 19:04:49 +02:00
return 'Decode from punycode';
}
2016-09-27 23:50:52 +02:00
getId(): string {
2017-04-15 19:04:49 +02:00
return 'decodepunycode';
}
2016-09-27 23:50:52 +02:00
convert(input: string): string {
return this.nativeLibraryWrapperService.punycode.decode(input);
}
2016-09-27 23:50:52 +02:00
}