lib/rules/vue/comment-directive.js
function parse (pattern, comment) {
  const match = pattern.exec(comment)
  if (match == null) {
    return null
  }

  const type = match[1]
  const rules = (match[2] || '')
    .split(',')
    .map(s => s.trim())
    .filter(Boolean)

  return { type, rules }
}
function parse (pattern, comment) {
  const match = pattern.exec(comment)
  if (match == null) {
    return null
  }

  const type = match[1]
  const rules = (match[2] || '')
    .split(',')
    .map(s => s.trim())
    .filter(Boolean)

  return { type, rules }
}
function parse ( pattern , comment ) { const match = pattern . exec ( comment ) if ( match == null ) { return null } const type = match [ 1 ] const rules = ( match [ 2 ] || '' ) . split ( ',' ) . map ( s => s . trim ( ) ) . filter ( Boolean ) return { type , rules } }
Parse a given comment.
@param {RegExp} pattern The RegExp pattern to parse.
@param {string} comment The comment value to parse.
@returns {({type:string,rules:string[]})|null} The parsing result.
Parse a given comment .