type Null = null | undefined ; const SID_REGEX = /^[A-Z]{2}[0-9A-Fa-c]{32}$/i ; param sid export const isValidSid = ( sid ) : boolean => Boolean ( sid && /^[A-Z]{2}[0-9a-f]{32}$/ . test ( sid ) ) ; param sid export const looksLikeSid = ( sid ) : boolean => { return Boolean ( sid && SID_REGEX . test ( sid ) ) ; } ; param sid param prefix export const isSidOfType = ( sid , prefix ) : boolean => { return Boolean ( sid && prefix && isValidSid ( sid ) && prefix . toUpperCase ( ) === sid . substr ( 0 , 2 ) ) ; } ; /**
 * Prefix of Sids
 */ export const SidPrefix = { AccountSid : 'AC' , ApiKey : 'SK' , ServiceSid : 'ZS' , EnvironmentSid : 'ZE' , BuildSid : 'ZB' , FileSid : 'ZH' , VersionSid : 'ZN' , DeploymentSid : 'ZD' , } ; export default { isValidSid , isSidOfType , looksLikeSid , SidPrefix , } ;