module import { attributeNameReplacer } from './attribute-name-replacer.function' ; hidden export const BRACED_INDEX_REGEX = /\[(\d+)]/g ; returns { string } hidden export function uniqueAttributeValueName ( key , existingValueNames ? ) { key = key . replace ( /\./g , '__' ) . replace ( BRACED_INDEX_REGEX , attributeNameReplacer ) ; let potentialName = `:${ key }` ; let idx = 1 ; if ( existingValueNames && existingValueNames . length ) { while ( existingValueNames . includes ( potentialName ) ) { idx ++ ; potentialName = `:${ key }_${ idx }` ; } } return potentialName ; }