8000 Parser API for base64 data · lance/sdk-javascript@f0ad61a · GitHub
[go: up one dir, main page]

Skip to content

Commit f0ad61a

Browse files
committed
Parser API for base64 data
Signed-off-by: Fabio José <fabiojose@gmail.com>
1 parent 08996ae commit f0ad61a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/formats/base64.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
function Parser(decorator) {
3+
this.decorator = decorator;
4+
}
5+
6+
Parser.prototype.parse = function(payload) {
7+
let toparse = payload;
8+
if(this.decorator){
9+
toparse = this.decorator.parse(payload);
10+
}
11+
12+
return Buffer.from(toparse, "base64").toString();
13+
};
14+
15+
module.exports = Parser;

0 commit comments

Comments
 (0)
0