import { MlLicense } from '../../../common/license' ; import { InsufficientFullLicenseError , InsufficientBasicLicenseError } from './errors' ; export type LicenseCheck = ( ) => void ; export function licenseChecks ( mlLicense ) { return { isFullLicense ( ) { if ( mlLicense . isFullLicense ( ) === false ) { throw new InsufficientFullLicenseError ( 'Platinum, Enterprise or trial license needed' ) ; } } , isMinimumLicense ( ) { if ( mlLicense . isMinimumLicense ( ) === false ) { throw new InsufficientBasicLicenseError ( 'Basic license needed' ) ; } } , } ; }