Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Commit ecd2852

Browse files
author
Bryan Lee
committed
comment for base64 regex
1 parent 3688187 commit ecd2852

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/examples/image_carousel/imageViewer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React from 'react';
22
import { Carousel } from 'react-responsive-carousel';
33

44
const URLREGEX = new RegExp("((http|https)(:\/\/))?([a-zA-Z0-9]+[.]{1}){2}[a-zA-Z0-9]+(\/{1}[a-zA-Z0-9]+)*\/?", "igm");
5+
// Regular expression to check formal correctness of base64 encoded strings
6+
// https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob
57
const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
68

79
const DOTS_THRESHOLD = 15;

0 commit comments

Comments
 (0)