isBase64 ใช้สำหรับตรวจสอบว่าอักขระรูปภาพอยู่ในรูปแบบ base64 หรือไม่
export const isBase64 = (str) => {
if (typeof str === "string" && str?.indexOf("data:") > -1) {
return true;
} else {
return false;
}
};
const isBase64 = isBase64(image);
Property | Description | Type | Default |
---|---|---|---|
str | อักขระรูปภาพ | string |