Rework of constants and some additional tests

This commit is contained in:
Jonathan Putney
2020-01-15 12:21:57 -05:00
parent eaa80394a7
commit 7882608fb6
23 changed files with 766 additions and 578 deletions

View File

@@ -1,6 +1,6 @@
// @flow
export const scorm12_regex = {
const scorm12 = {
CMIString256: '^.{0,255}$',
CMIString4096: '^.{0,4096}$',
CMITime: '^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$', // eslint-disable-line
@@ -28,13 +28,13 @@ export const scorm12_regex = {
text_range: '-1#1',
};
export const aicc_regex = {
...scorm12_regex, ...{
const aicc = {
...scorm12, ...{
CMIIdentifier: '^\\w{1,255}$',
},
};
export const scorm2004_regex = {
const scorm2004 = {
CMIString200: '^[\\u0000-\\uFFFF]{0,200}$',
CMIString250: '^[\\u0000-\\uFFFF]{0,250}$',
CMIString1000: '^[\\u0000-\\uFFFF]{0,1000}$',
@@ -74,3 +74,11 @@ export const scorm2004_regex = {
text_range: '-1#1',
progress_range: '0#1',
};
const Regex = {
aicc: aicc,
scorm12: scorm12,
scorm2004: scorm2004,
};
export default Regex;