- webpack build does not run successfully, typescript errors out, saying "TS2304: Cannot find name 'module'." or 'require' or 'process' in certain .ts files.
19 lines
433 B
TypeScript
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?");
|
|
}
|
|
}
|
|
}
|