Parser API for base64 data
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
08996aeafc
commit
f0ad61acd7
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
function Parser(decorator) {
|
||||||
|
this.decorator = decorator;
|
||||||
|
}
|
||||||
|
|
||||||
|
Parser.prototype.parse = function(payload) {
|
||||||
|
let toparse = payload;
|
||||||
|
if(this.decorator){
|
||||||
|
toparse = this.decorator.parse(payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Buffer.from(toparse, "base64").toString();
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = Parser;
|
||||||
Loading…
Reference in New Issue