nl_tokens: / * eslint - disable fecs - min - vars - per - destructure Find the matched transformer
pl_tokens: function findMatchTransformer ( transformers , value , matchItem ) { if ( ! value ) { return ; } let found ; transformers . some ( <mask> => { let match = item . match ; let isMatch = false ; let type = typeof match ; if ( type === 'string' ) { isMatch = match === value ; } else if ( type === 'function' ) { isMatch = match ( matchItem ) ; } else { // default RegExp isMatch = match . test ( '' + value ) ; } if ( isMatch ) { found = item . transform ; } return isMatch ; } ) ; return found ; }