@hyperframes/lint 0.7.19 → 0.7.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -72,13 +72,15 @@ function findRootTag(source) {
72
72
  function readAttr(tagSource, attr) {
73
73
  if (!tagSource) return null;
74
74
  const escaped = attr.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
75
- const match = tagSource.match(new RegExp(`\\b${escaped}\\s*=\\s*["']([^"']+)["']`, "i"));
75
+ const match = tagSource.match(new RegExp(`(?<![\\w-])${escaped}\\s*=\\s*["']([^"']+)["']`, "i"));
76
76
  return match?.[1] || null;
77
77
  }
78
78
  function readJsonAttr(tagSource, attr) {
79
79
  if (!tagSource) return null;
80
80
  const escaped = attr.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
81
- const match = tagSource.match(new RegExp(`\\b${escaped}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i"));
81
+ const match = tagSource.match(
82
+ new RegExp(`(?<![\\w-])${escaped}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i")
83
+ );
82
84
  if (!match) return null;
83
85
  return match[1] ?? match[2] ?? null;
84
86
  }