import * as NullOrUndefinedCheck from "../../../../sync/check/generic/null-or-undefined"; import * as check from "../../../../sync/check/string"; export type MaybeStringErrorCodeType = check.StringErrorCode; export function checkMaybeString (mixed : any) : undefined|MaybeStringErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkString ); } export type MaybeMinLengthErrorCodeType = check.MinLengthErrorCodeType; export function checkMaybeMinLength (mixed : any, min : number) : undefined|MaybeMinLengthErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, () => { return check.checkMinLength(mixed, min) } ); } export type MaybeMaxLengthErrorCodeType = check.MaxLengthErrorCodeType; export function checkMaybeMaxLength (mixed : any, max : number) : undefined|MaybeMaxLengthErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, () => { return check.checkMaxLength(mixed, max) } ); } export type MaybeLengthErrorCodeType = check.LengthErrorCodeType; export function checkMaybeLength (mixed : any, args : { min? : number, max? : number }) : undefined|MaybeLengthErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, () => { return check.checkLength(mixed, args) } ); } export type MaybeNonEmptyErrorCodeType = check.NonEmptyErrorCodeType; export function checkMaybeNonEmpty (mixed : any) : undefined|MaybeNonEmptyErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkNonEmpty ); } export type MaybeContainsErrorCodeType = check.ContainsErrorCodeType; export function checkMaybeContains (mixed : any, x : string) : undefined|MaybeContainsErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, () => { return check.checkContains(mixed, x) } ); } export type MaybeNoDuplicateErrorCodeType = check.NoDuplicateErrorCodeType; export function checkMaybeNoDuplicate (mixed : any) : undefined|MaybeNoDuplicateErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkNoDuplicate ); } export type MaybeNotAllWhitespaceErrorCodeType = check.StringErrorCode|check.NotAllWhitespaceErrorCode; export function checkMaybeNotAllWhitespace (mixed : any) : undefined|MaybeNotAllWhitespaceErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkNotAllWhitespace ); } export type MaybeNonEmptyAndNotAllWhitespaceErrorCodeType = check.StringErrorCode|check.NonEmptyErrorCodeType|check.NotAllWhitespaceErrorCode; export function checkMaybeNonEmptyAndNotAllWhitespace (mixed : any) : undefined|MaybeNonEmptyAndNotAllWhitespaceErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkNonEmptyAndNotAllWhitespace ); } export type MaybeMatchErrorCodeType = check.StringErrorCode|check.MatchErrorCode; export function checkMaybeMatch (mixed : any, regex : RegExp) : undefined|MaybeMatchErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, () => { return check.checkMatch(mixed, regex) } ); } export type MaybeEmailErrorCodeType = check.StringErrorCode|check.EmailErrorCode; export function checkMaybeEmail (mixed : any) : undefined|MaybeEmailErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkEmail ); } export type MaybeNotOneOfErrorCodeType = check.NotOneOfErrorTypeCode; export function checkMaybeNotOneOf (mixed : any, arr : T[]) : undefined|MaybeNotOneOfErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, () => { return check.checkNotOneOf(mixed, arr) } ); } export type MaybeBase64ErrorCodeType = check.StringErrorCode|check.Base64ErrorCode; export function checkMaybeBase64 (mixed : any) : undefined|MaybeBase64ErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkBase64 ); } export type MaybeJsonErrorCodeType = check.StringErrorCode|check.JsonErrorCode; export function checkMaybeJson (mixed : any) : undefined|MaybeJsonErrorCodeType { return NullOrUndefinedCheck.checkNullOrUndefinedOr( mixed, check.checkJson ); }