Changeset View
Changeset View
Standalone View
Standalone View
lib/utils/validation-utils.js
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | for (const num of nums) { | ||||
} | } | ||||
} | } | ||||
return false; | return false; | ||||
}); | }); | ||||
} | } | ||||
const tDate: TRegex = tRegex(/^[0-9]{4}-[0-1][0-9]-[0-3][0-9]$/); | const tDate: TRegex = tRegex(/^[0-9]{4}-[0-1][0-9]-[0-3][0-9]$/); | ||||
const tColor: TRegex = tRegex(validHexColorRegex); // we don't include # char | const tColor: TRegex = tRegex(validHexColorRegex); // we don't include # char | ||||
const tPlatform: TEnums = t.enums.of(['ios', 'android', 'web']); | const tPlatform: TEnums = t.enums.of([ | ||||
'ios', | |||||
'android', | |||||
'web', | |||||
'windows', | |||||
'macos', | |||||
]); | |||||
const tDeviceType: TEnums = t.enums.of(['ios', 'android']); | const tDeviceType: TEnums = t.enums.of(['ios', 'android']); | ||||
const tPlatformDetails: TInterface = tShape({ | const tPlatformDetails: TInterface = tShape({ | ||||
platform: tPlatform, | platform: tPlatform, | ||||
codeVersion: t.maybe(t.Number), | codeVersion: t.maybe(t.Number), | ||||
stateVersion: t.maybe(t.Number), | stateVersion: t.maybe(t.Number), | ||||
}); | }); | ||||
const tPassword: TRefinement<string> = t.refinement( | const tPassword: TRefinement<string> = t.refinement( | ||||
t.String, | t.String, | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |