Prefer adding u flag in regular expressions JS-0117
Anti-pattern
Minor
5 months ago3 years old
Use the 'u' flag with regular expressions
 6713    '\u2028': 'u2028',
 6714    '\u2029': 'u2029'
 6715  }
 6716  const V = /\\|'|\r|\n|\u2028|\u2029/g; 6717  (h.template = function (i, n, r) {
 6718    !n && r && (n = r), (n = h.defaults({}, n, h.templateSettings))
 6719    let t
Use the 'u' flag with regular expressions
 6022  (h.countBy = k(function (n, r, t) {
 6023    j(n, t) ? n[t]++ : (n[t] = 1)
 6024  }))
 6025  const S = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; 6026  (h.toArray = function (n) {
 6027    return n
 6028      ? h.isArray(n)
Use the 'u' flag with regular expressions
 218      const b_copy = b.copy(b.offset, b.offset + 7)
 219      const symbol = Buffer.from(b_copy.toBinary(), 'binary')
 220        .toString()
 221        .replace(/\ /g, '') 222      if (symbol == 'BLURT' || symbol == 'TESTS') {
 223        nai_string = '@@000000021'
 224      } else if (symbol == 'VESTS') nai_string = '@@000000037'
Use the 'u' flag with regular expressions
 105      const b_copy = b.copy(b.offset, b.offset + 7)
 106      symbol = Buffer.from(b_copy.toBinary(), 'binary')
 107        .toString()
 108        .replace(/\ /g, '') 109      b.skip(7)
 110      // "1.000 BLURT" always written with full precision
 111      amount_string = fromImpliedDecimal(amount, precision)
Use the 'u' flag with regular expressions
 3068      return this
 3069    }
 3070  })
 3071  const je = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi 3072  const qe = /<script|<style|<link/i
 3073  const Le = /checked\s*(?:[^=]|=\s*.checked.)/i
 3074  const He = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g