inital work

This commit is contained in:
thecodrr
2021-09-15 02:16:55 +05:00
parent ed2624a918
commit 6033cf8740
11 changed files with 18947 additions and 3828 deletions

View File

@@ -0,0 +1,14 @@
const REGEX = /^data:(?<mime>image\/.+);base64,(?<data>.+)/;
function toObject(dataurl) {
const { groups } = REGEX.exec(dataurl);
return groups || {};
}
function fromObject({ type, data }) {
//const { groups } = REGEX.exec(dataurl);
return `data:${type};base64,${data}`;
}
const dataurl = { toObject, fromObject };
export default dataurl;