export const KEYWORD_POSTFIX = '.keyword' ; export const hasKeywordDuplicate = ( fieldName , fieldNamesSet ) : boolean => fieldNamesSet . has ( `${ fieldName }${ KEYWORD_POSTFIX }` ) ; export const isKeywordDuplicate = ( fieldName , fieldNamesSet ) : boolean => fieldName . endsWith ( KEYWORD_POSTFIX ) && fieldNamesSet . has ( removeKeywordPostfix ( fieldName ) ) ; export const removeKeywordPostfix = ( fieldName ) : string => fieldName . replace ( new RegExp ( `${ KEYWORD_POSTFIX }$` ) , '' ) ;