import { Deployment , DeploymentBuild } from '../types' ; export const isReady = ( { readyState , state , } ) : boolean => readyState === 'READY' || state === 'READY' ; export const isFailed = ( { readyState , state , } ) : boolean => readyState ? readyState . endsWith ( '_ERROR' ) || readyState === 'ERROR' : ( state && state . endsWith ( '_ERROR' ) ) || state === 'ERROR' ; export const isDone = ( buildOrDeployment ) : boolean => isReady ( buildOrDeployment ) || isFailed ( buildOrDeployment ) ; export const isAliasAssigned = ( deployment ) : boolean => Boolean ( deployment . aliasAssigned ) ; export const isAliasError = ( deployment ) : boolean => Boolean ( deployment . aliasError ) ;