mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
recei and clear the code
This commit is contained in:
@@ -35,10 +35,7 @@ export const zodDataUrlSchema = z.string().refine(value => value.startsWith('dat
|
||||
* ```
|
||||
*/
|
||||
export const base64Schema = z.string().refine(value => {
|
||||
// Regular expression for Base64 validation
|
||||
const isBase64 = /^[A-Za-z0-9+/=]*$/.test(value) && (value.length % 4 === 0);
|
||||
// Check if the first 20 characters do not contain a comma
|
||||
return isBase64 && !value.substring(0, 20).includes(',');
|
||||
return !value.slice(0, 20).includes(',');
|
||||
}, {
|
||||
message: 'Invalid Base64 string or comma found in the first 20 characters'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user