import { BuilderFieldOperator } from '../components/Builder' ; export const isBoolean = ( value ) : value is boolean => { return typeof value === 'boolean' ; } ; export const isString = ( value ) : value is string => { return typeof value === 'string' ; } ; export const isNumber = ( value ) : value is number => { return typeof value === 'number' ; } ; export const isUndefined = ( value ) : value is undefined => { return typeof value === 'undefined' ; } ; export const isArray = ( value ) : value is any [ ] => { return Array . isArray ( value ) ; } ; export const isStringArray = ( value ) : value is string [ ] => { return isArray ( value ) && value . every ( ( item ) => isString ( item ) ) ; } ; export const isOptionList = ( value ) : value is Array < { value : string ; label : string ; } > => { return ( isArray ( value ) && value . every ( ( item ) => isString ( item . value ) && isString ( item . label ) ) ) ; } ; export const isOperator = ( value ) : value is BuilderFieldOperator => { return ! ! value ; } ;