converter/src/app/converter/base64decoder.ts
Manuel Friedli be51aab2ee Intermediate commit:
- webpack build does not run successfully, typescript errors out, saying
  "TS2304: Cannot find name 'module'." or 'require' or 'process' in
  certain .ts files.
2017-03-14 15:42:11 +01:00

19 lines
433 B
TypeScript

import {Converter} from "./converter";
export class Base64Decoder implements Converter {
getDisplayname():string {
return "Decode Base 64";
}
getId():string {
return "base64decode";
}
convert(input:string):string {
try {
return atob(input);
} catch (exception) {
throw new Error("Could not decode base64 string. Maybe corrupt input?");
}
}
}