is-html-tag-opening 4.2.2 → 4.2.4

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/README.md CHANGED
@@ -21,6 +21,8 @@
21
21
  <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
22
22
  </p>
23
23
 
24
+ **No 3rd party dependencies.** All dependencies and devDependencies, checked recursively, are Codsen packages.
25
+
24
26
  ## Install
25
27
 
26
28
  This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 2.1.0 (`npm i is-html-tag-opening@2.1.0`).
@@ -44,7 +46,7 @@ assert.equal(isOpening(html, 0), true);
44
46
 
45
47
  ## Documentation
46
48
 
47
- Please [visit codsen.com](https://codsen.com/os/is-html-tag-opening/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/is-html-tag-opening/CHANGELOG.md).
49
+ Please [visit codsen.com](https://codsen.com/os/is-html-tag-opening/) for a full description of the API. For **Changelog**, see [raw md on GitHub](https://github.com/codsen/codsen/blob/main/packages/is-html-tag-opening/CHANGELOG.md) or [the website](https://codsen.com/os/is-html-tag-opening/changelog).
48
50
 
49
51
  ## Contributing
50
52
 
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * @name is-html-tag-opening
3
3
  * @fileoverview Does an HTML tag start at given position?
4
- * @version 4.2.2
4
+ * @version 4.2.4
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/is-html-tag-opening/}
8
8
  */
9
9
 
10
- import{formatDiagnosticValue as h}from"codsen-utils";import{left as c}from"string-left-right";import{matchRight as q,matchRightIncl as F}from"string-match-left-right";var d="4.2.2";import{left as j}from"string-left-right";function p(e,t){return e[t]==="<"||e[j(e,t)]==="<"}function b(e){return e===void 0||e.toUpperCase()===e.toLowerCase()&&!/\d/.test(e)&&e!=="="}var f={allowCustomTagNames:!1,skipOpeningBracket:!1},m="\\",g=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h1 - h6","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xml"];var W=d;function P(e,t=0,k){if(typeof e!="string")throw new Error(`is-html-tag-opening/isOpening(): [THROW_ID_01] the first input argument should have been a string but it was given as "${typeof e}", value being ${h(e,4)}`);if(!Number.isInteger(t)||t<0)throw new Error(`is-html-tag-opening/isOpening(): [THROW_ID_02] the second input argument should have been a natural number string index but it was given as "${typeof t}", value being ${h(t,4)}`);let n={...f,...k},i="[\\\\ \\t\\r\\n/]*",r="._a-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\uFFFF",w=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}\\w+${i}\\/?${i}>`,"g"),E=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}[${r}]+[-${r}]*${i}>`,"g"),y=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\w+\\s+\\w+(?:-\\w+)?\\s*=\\s*['"\\w]`,"g"),D=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\w+\\s+[${r}]+[-${r}]*(?:-\\w+)?\\s*=\\s*['"\\w]`),O=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\/?\\s*\\w+\\s*\\/?\\s*>`,"g"),v=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\/?\\s*[${r}]+[-${r}]*\\s*\\/?\\s*>`,"g"),R=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}\\w+(?:\\s*\\w+)?\\s*\\w+=['"]`,"g"),V=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}[${r}]+[-${r}]*\\s+(?:\\s*\\w+)?\\s*\\w+=['"]`,"g"),$=new RegExp(`^<${n.skipOpeningBracket?"?\\/?":""}(${i}[${r}]+)+${i}[\\\\/=>]`,""),B=/^\/\s*\w+s*>/,s=t?e.slice(t):e,a=c(e,t),l=!1,o=!1,C={cb:b,i:!0,trimCharsBeforeMatching:["/",m,"!"," "," ",`
10
+ import{formatDiagnosticValue as h}from"codsen-utils";import{left as c}from"string-left-right";import{matchRight as q,matchRightIncl as F}from"string-match-left-right";var d="4.2.4";import{left as j}from"string-left-right";function p(e,t){return e[t]==="<"||e[j(e,t)]==="<"}function b(e){return e===void 0||e.toUpperCase()===e.toLowerCase()&&!/\d/.test(e)&&e!=="="}var f={allowCustomTagNames:!1,skipOpeningBracket:!1},m="\\",g=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h1 - h6","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xml"];var W=d;function P(e,t=0,k){if(typeof e!="string")throw new Error(`is-html-tag-opening/isOpening(): [THROW_ID_01] the first input argument should have been a string but it was given as "${typeof e}", value being ${h(e,4)}`);if(!Number.isInteger(t)||t<0)throw new Error(`is-html-tag-opening/isOpening(): [THROW_ID_02] the second input argument should have been a natural number string index but it was given as "${typeof t}", value being ${h(t,4)}`);let n={...f,...k},i="[\\\\ \\t\\r\\n/]*",r="._a-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\uFFFF",w=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}\\w+${i}\\/?${i}>`,"g"),E=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}[${r}]+[-${r}]*${i}>`,"g"),y=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\w+\\s+\\w+(?:-\\w+)?\\s*=\\s*['"\\w]`,"g"),D=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\w+\\s+[${r}]+[-${r}]*(?:-\\w+)?\\s*=\\s*['"\\w]`),O=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\/?\\s*\\w+\\s*\\/?\\s*>`,"g"),v=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\/?\\s*[${r}]+[-${r}]*\\s*\\/?\\s*>`,"g"),R=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}\\w+(?:\\s*\\w+)?\\s*\\w+=['"]`,"g"),V=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}[${r}]+[-${r}]*\\s+(?:\\s*\\w+)?\\s*\\w+=['"]`,"g"),$=new RegExp(`^<${n.skipOpeningBracket?"?\\/?":""}(${i}[${r}]+)+${i}[\\\\/=>]`,""),B=/^\/\s*\w+s*>/,s=t?e.slice(t):e,a=c(e,t),l=!1,o=!1,C={cb:b,i:!0,trimCharsBeforeMatching:["/",m,"!"," "," ",`
11
11
  `,"\r"]};return n.allowCustomTagNames?((n.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[c(e,a)]==="<")||s[0]==="<"&&s[1]?.trim())&&($.test(s)||/^<\w+$/.test(s))||E.test(s)&&p(e,t)||D.test(s)||v.test(s)&&p(e,t)||V.test(s)||e[t]==="/"&&e[a]!=="<"&&B.test(s))&&(o=!0):(((n.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[c(e,a)]==="<")||(s[0]==="<"||s[0]==="/"&&(!e[a]||e[a]!=="<"))&&s[1]?.trim())&&$.test(s)||w.test(s)&&p(e,t)||y.test(s)||O.test(s)&&p(e,t)||R.test(s))&&(l=!0),l&&F(e,t,g,{cb:u=>u===void 0?((e[t]==="<"&&e[t+1]?.trim()||e[t-1]==="<")&&(o=!0),!0):u.toUpperCase()===u.toLowerCase()&&!/\d/.test(u)&&u!=="=",i:!0,trimCharsBeforeMatching:["<","/",m,"!"," "," ",`
12
12
  `,"\r"]})&&(o=!0)),!o&&e[t]==="<"&&e[t+1]?.trim()&&q(e,t,g,C)&&(o=!0),typeof e=="string"&&t<e.length&&o}export{f as defaults,P as isOpening,W as version};
@@ -1,17 +1,25 @@
1
1
  /**
2
2
  * @name is-html-tag-opening
3
3
  * @fileoverview Does an HTML tag start at given position?
4
- * @version 4.2.2
4
+ * @version 4.2.4
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/is-html-tag-opening/}
8
8
  */
9
9
 
10
- "use strict";var isHtmlTagOpening=(()=>{var B=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;var _=(t,e,r)=>e in t?B(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C=(t,e)=>{for(var r in e||(e={}))F.call(e,r)&&_(t,r,e[r]);if(V)for(var r of V(e))et.call(e,r)&&_(t,r,e[r]);return t};var rt=(t,e)=>{for(var r in e)B(t,r,{get:e[r],enumerable:!0})},nt=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of tt(e))!F.call(t,s)&&s!==r&&B(t,s,{get:()=>e[s],enumerable:!(i=X(e,s))||i.enumerable});return t};var it=t=>nt(B({},"__esModule",{value:!0}),t);var mt={};rt(mt,{defaults:()=>j,isOpening:()=>gt,version:()=>ht});function st(){let t=[],e=0,r=!1;return{append(i){return r?!1:e+i.length>1999?(t.push("\u2026"),e+=1,r=!0,!1):(t.push(i),e+=i.length,!0)},result(){return t.join("")},stopped(){return r}}}function ot(t){return"\\u".concat(t.toString(16).padStart(4,"0"))}function L(t,e){if(t.append('"')){for(let r=0;r<e.length&&!t.stopped();r+=1){let i=e.charCodeAt(r);i===34?t.append('\\"'):i===92?t.append("\\\\"):i===8?t.append("\\b"):i===9?t.append("\\t"):i===10?t.append("\\n"):i===12?t.append("\\f"):i===13?t.append("\\r"):i<32||i===8232||i===8233||i>=55296&&i<=57343?t.append(ot(i)):t.append(e[r])}t.append('"')}}function lt(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function q(t,e){t.append("Symbol(");let r=String(e);r.length>8&&L(t,r.slice(7,-1)),t.append(")")}function P(t,e){typeof e=="symbol"?q(t,e):L(t,String(e))}function k(t,e=0){let r=st(),i=e===4?4:0,s=new WeakSet,o=0;function m(n){i&&r.append(" ".repeat(n*i))}function l(n,a){n&&r.append(","),i&&(r.append("\n"),m(a+1))}function d(n,a,u){i&&a&&(r.append("\n"),m(u)),r.append(n)}function b(n,a){Object.prototype.hasOwnProperty.call(n,"value")?h(n.value,a):r.append(lt(n))}function $(n,a){let u;try{u=Reflect.getOwnPropertyDescriptor(n,"length")}catch(f){r.append("[Uninspectable]");return}let c=u==null?void 0:u.value;if(!Number.isSafeInteger(c)||c<0){r.append("[Uninspectable]");return}r.append("[");let g=!1;for(let f=0;f<c&&!r.stopped();f+=1){if(l(g,a),g=!0,o>=50){r.append("[MaxEntries]");break}o+=1;let p;try{p=Reflect.getOwnPropertyDescriptor(n,String(f))}catch(O){r.append("[Uninspectable]");continue}p!=null&&p.enumerable?b(p,a+1):r.append("[Empty]")}d("]",g,a)}function y(n,a){let u;try{u=Reflect.ownKeys(n)}catch(g){r.append("[Uninspectable]");return}r.append("{");let c=!1;for(let g of u){if(r.stopped())break;if(o>=50){l(c,a),c=!0,L(r,"\u2026"),r.append(i?": ":":"),r.append("[MaxEntries]");break}o+=1;let f;try{f=Reflect.getOwnPropertyDescriptor(n,g)}catch(p){l(c,a),c=!0,P(r,g),r.append(i?": ":":"),r.append("[Uninspectable]");continue}f!=null&&f.enumerable&&(l(c,a),c=!0,P(r,g),r.append(i?": ":":"),b(f,a+1))}d("}",c,a)}function w(n,a){if(s.has(n)){r.append("[Circular]");return}if(a>=5){r.append("[MaxDepth]");return}let u;try{u=Array.isArray(n)}catch(c){r.append("[Uninspectable]");return}s.add(n);try{u?$(n,a):y(n,a)}finally{s.delete(n)}}function h(n,a){n===null?r.append("null"):typeof n=="string"?L(r,n):typeof n=="number"?r.append(Object.is(n,-0)?"-0":String(n)):typeof n=="boolean"?r.append(n?"true":"false"):typeof n>"u"?r.append("undefined"):typeof n=="bigint"?r.append("".concat(n,"n")):typeof n=="symbol"?q(r,n):typeof n=="function"?r.append("[Function]"):w(n,a)}try{return h(t,0),r.result()}catch(n){return"[Uninspectable]"}}var yt=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),at=Object.prototype.hasOwnProperty;function x(t){if(t==null||typeof t!="object")return!1;let e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null?!1:!(Symbol.iterator in t)&&!(Symbol.toStringTag in t)}function R(t){return typeof t=="string"}var H,wt=(H=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:H.get;var $t=Date.prototype.getTime;function U(t,e){return x(t)&&R(e)&&at.call(t,e)}var I="\xA0";function ut({str:t,idx:e,stopAtNewlines:r,stopAtRawNbsp:i}){if(typeof t!="string"||!t.length||((!e||typeof e!="number")&&(e=0),e<1))return null;if(t[~-e]&&(t[~-e].trim()||r&&"\n\r".includes(t[~-e])||i&&t[~-e]===I))return~-e;if(t[e-2]&&(t[e-2].trim()||r&&"\n\r".includes(t[e-2])||i&&t[e-2]===I))return e-2;for(let s=e;s--;)if(t[s]&&(t[s].trim()||r&&"\n\r".includes(t[s])||i&&t[s]===I))return s;return null}function M(t,e=0){return ut({str:t,idx:e,stopAtNewlines:!1,stopAtRawNbsp:!1})}function J(t){return typeof t!="string"?t:t.length?[t]:[]}var Q={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ft=t=>t+1;function ct(t,e,r,i,s=!1,o=ft){var f;let m=typeof r=="function"?r():r;if(+e<0&&s&&m==="EOL")return m;let l=C(C({},Q),i);if(e>=t.length&&!s)return!1;let d=s?1:r.length,b=0,$=!1,y=!1,w=!1,h=l.maxMismatches,n=e,a=!1,u=!1,c=!1;function g(){return b===1&&h<l.maxMismatches-1}for(;t[n];){let p=o(n);if(l.trimBeforeMatching&&t[n].trim()===""){if(!t[p]&&s&&r==="EOL")return!0;n=o(n);continue}if(l&&!l.i&&((f=l==null?void 0:l.trimCharsBeforeMatching)!=null&&f.includes(t[n]))||l!=null&&l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(t[n].toLowerCase())){if(s&&r==="EOL"&&!t[p])return!0;n=o(n);continue}let O=p>n?r[r.length-d]:r[d-1];if(!l.i&&t[n]===O||l.i&&O!==void 0&&t[n].toLowerCase()===O.toLowerCase()){if(a||(a=!0),w||(w=!0),d===r.length){if(u=!0,h!==l.maxMismatches)return!1}else d===1&&(c=!0);if(d-=1,b++,g())return!1;if(!d)return b!==r.length||h===l.maxMismatches||!$?n:!1}else if(!$&&!b&&($=!0),l.maxMismatches&&h&&n){h-=1;for(let A=0;A<=h;A++){let v=p>n?r[r.length-d+1+A]:r[d-2-A],D=t[o(n)];if(v&&(!l.i&&t[n]===v||l.i&&t[n].toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||d!==r.length)){if(b++,g())return!1;d-=2,a=!0;break}else if(D&&v&&(!l.i&&D===v||l.i&&D.toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||d!==r.length)){if(!b&&!l.hungry)return!1;d-=1,a=!0;break}else if(v===void 0&&h>=0&&a&&(!l.firstMustMatch||u)&&(!l.lastMustMatch||c))return n}a||(y=n)}else return n===0&&d===1&&!l.lastMustMatch&&w?0:!1;if(y!==!1&&y!==n&&(y=!1),d<1)return n;n=o(n)}if(d>0)return s&&m==="EOL"?!0:l&&l.maxMismatches>=d&&w?y||0:!1}function z(t,e,r,i,s){var $,y,w;if(x(s)&&U(s,"trimBeforeMatching")&&s&&typeof s.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(s.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let o=C(C({},Q),s);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=J(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map(h=>R(h)?h:String(h)),!R(e)||!e.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof r,", equal to:\n").concat(k(r,4)));let m,l;if(R(i))m=[i];else if(Array.isArray(i))m=i;else if(!i)m=i;else if(typeof i=="function")m=[],m.push(i);else throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof i,", equal to:\n").concat(k(i,4)));if(s&&!x(s))throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof s,'", and equal to:\n').concat(k(s,4)));let d=0,b="";if(($=o==null?void 0:o.trimCharsBeforeMatching)!=null&&$.some((h,n)=>h.length>1?(d=n,b=h,!0):!1))throw new Error("string-match-left-right/".concat(t,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(d," is longer than 1 character, ").concat(b.length," (equals to ").concat(b,"). Please split it into separate characters and put into array as separate elements."));if(!m||!Array.isArray(m)||Array.isArray(m)&&!m.length||Array.isArray(m)&&m.length===1&&R(m[0])&&!m[0].trim()){if(typeof o.cb=="function"){let n,a=r;if((t==="matchLeftIncl"||t==="matchRight")&&(a+=1),t[5]==="L")for(let f=a;f--;){let p=e[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&(p!=null&&p.trim()))&&(!((y=o.trimCharsBeforeMatching)!=null&&y.length)||p!==void 0&&!o.trimCharsBeforeMatching.includes(p))){n=f;break}}else if(t.startsWith("matchRight"))for(let f=a;f<e.length;f++){let p=e[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p.trim())&&(!((w=o.trimCharsBeforeMatching)!=null&&w.length)||!o.trimCharsBeforeMatching.includes(p))){n=f;break}}if(n===void 0)return!1;let u=e[n],c=n+1,g="";return c&&c>0&&(g=e.slice(0,c)),t[5]==="L"||n&&n>0&&(g=e.slice(n)),o.cb(u,g,n)}let h="";throw s||(h=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(t,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(h))}for(let h=0,n=m.length;h<n;h++){l=typeof m[h]=="function";let a=m[h],u,c,g="",f=r;t==="matchRight"?f+=1:t==="matchLeft"&&(f-=1);let p=ct(e,f,a,o,l,O=>t[5]==="L"?O-1:O+1);if(p&&l&&typeof a=="function"&&a()==="EOL")return a()&&(!o.cb||o.cb(u,g,c))?a():!1;if(Number.isInteger(p)&&(c=t.startsWith("matchLeft")?p-1:p+1,t[5]==="L"?g=e.slice(0,p):g=e.slice(c)),c<0&&(c=void 0),e[c]&&(u=e[c]),Number.isInteger(p)&&(!o.cb||o.cb(u,g,c)))return a}return!1}function K(t,e,r,i){return z("matchRightIncl",t,e,r,i)}function G(t,e,r,i){return z("matchRight",t,e,r,i)}var Z="4.2.2";function S(t,e){return t[e]==="<"||t[M(t,e)]==="<"}function Y(t){return t===void 0||t.toUpperCase()===t.toLowerCase()&&!/\d/.test(t)&&t!=="="}var j={allowCustomTagNames:!1,skipOpeningBracket:!1},N="\\",T=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h1 - h6","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xml"];var ht=Z;function gt(t,e=0,r){var A,v,D;if(typeof t!="string")throw new Error('is-html-tag-opening/isOpening(): [THROW_ID_01] the first input argument should have been a string but it was given as "'.concat(typeof t,'", value being ').concat(k(t,4)));if(!Number.isInteger(e)||e<0)throw new Error('is-html-tag-opening/isOpening(): [THROW_ID_02] the second input argument should have been a natural number string index but it was given as "'.concat(typeof e,'", value being ').concat(k(e,4)));let i=C(C({},j),r),s="[\\\\ \\t\\r\\n/]*",o="._a-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\uFFFF",m=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"\\w+").concat(s,"\\/?").concat(s,">"),"g"),l=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"[").concat(o,"]+[-").concat(o,"]*").concat(s,">"),"g"),d=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\w+\\s+\\w+(?:-\\w+)?\\s*=\\s*['\"\\w]"),"g"),b=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\w+\\s+[").concat(o,"]+[-").concat(o,"]*(?:-\\w+)?\\s*=\\s*['\"\\w]")),$=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\/?\\s*\\w+\\s*\\/?\\s*>"),"g"),y=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\/?\\s*[").concat(o,"]+[-").concat(o,"]*\\s*\\/?\\s*>"),"g"),w=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"\\w+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),h=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"[").concat(o,"]+[-").concat(o,"]*\\s+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),n=new RegExp("^<".concat(i.skipOpeningBracket?"?\\/?":"","(").concat(s,"[").concat(o,"]+)+").concat(s,"[\\\\/=>]"),""),a=/^\/\s*\w+s*>/,u=e?t.slice(e):t,c=M(t,e),g=!1,f=!1,p={cb:Y,i:!0,trimCharsBeforeMatching:["/",N,"!"," "," ","\n","\r"]};return i.allowCustomTagNames?((i.skipOpeningBracket&&(t[e-1]==="<"||t[e-1]==="/"&&t[M(t,c)]==="<")||u[0]==="<"&&((A=u[1])!=null&&A.trim()))&&(n.test(u)||/^<\w+$/.test(u))||l.test(u)&&S(t,e)||b.test(u)||y.test(u)&&S(t,e)||h.test(u)||t[e]==="/"&&t[c]!=="<"&&a.test(u))&&(f=!0):(((i.skipOpeningBracket&&(t[e-1]==="<"||t[e-1]==="/"&&t[M(t,c)]==="<")||(u[0]==="<"||u[0]==="/"&&(!t[c]||t[c]!=="<"))&&((v=u[1])!=null&&v.trim()))&&n.test(u)||m.test(u)&&S(t,e)||d.test(u)||$.test(u)&&S(t,e)||w.test(u))&&(g=!0),g&&K(t,e,T,{cb:E=>{var W;return E===void 0?((t[e]==="<"&&((W=t[e+1])!=null&&W.trim())||t[e-1]==="<")&&(f=!0),!0):E.toUpperCase()===E.toLowerCase()&&!/\d/.test(E)&&E!=="="},i:!0,trimCharsBeforeMatching:["<","/",N,"!"," "," ","\n","\r"]})&&(f=!0)),!f&&t[e]==="<"&&((D=t[e+1])!=null&&D.trim())&&G(t,e,T,p)&&(f=!0),typeof t=="string"&&e<t.length&&f}return it(mt);})();
10
+ "use strict";var isHtmlTagOpening=(()=>{var j=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var V=(e,r,t)=>r in e?j(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,R=(e,r)=>{for(var t in r||(r={}))q.call(r,t)&&V(e,t,r[t]);if(P)for(var t of P(r))se.call(r,t)&&V(e,t,r[t]);return e};var ae=(e,r)=>{for(var t in r)j(e,t,{get:r[t],enumerable:!0})},ue=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of oe(r))!q.call(e,a)&&a!==t&&j(e,a,{get:()=>r[a],enumerable:!(n=le(r,a))||n.enumerable});return e};var fe=e=>ue(j({},"__esModule",{value:!0}),e);var Re={};ae(Re,{defaults:()=>I,isOpening:()=>ke,version:()=>Ce});function ce(){let e=[],r=0,t=!1;return{append(n){return t?!1:r+n.length>1999?(e.push("\u2026"),r+=1,t=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return t}}}function pe(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function E(e,r){if(e.append('"')){for(let t=0;t<r.length&&!e.stopped();t+=1){let n=r.charCodeAt(t);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(pe(n)):e.append(r[t])}e.append('"')}}function he(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function H(e,r){e.append("Symbol(");let t=String(r);t.length>8&&E(e,t.slice(7,-1)),e.append(")")}function F(e,r){typeof r=="symbol"?H(e,r):E(e,String(r))}function k(e,r=0){let t=ce(),n=r===4?4:0,a=new WeakSet,i=0;function f(_){n&&t.append(" ".repeat(_*n))}function c(_,u){_&&t.append(","),n&&(t.append("\n"),f(u+1))}function w(_,u,s){n&&u&&(t.append("\n"),f(s)),t.append(_)}function $(_,u){Object.prototype.hasOwnProperty.call(_,"value")?y(_.value,u):t.append(he(_))}function O(_,u){let s;try{s=Reflect.getOwnPropertyDescriptor(_,"length")}catch(o){t.append("[Uninspectable]");return}let p=s==null?void 0:s.value;if(!Number.isSafeInteger(p)||p<0){t.append("[Uninspectable]");return}t.append("[");let l=!1;for(let o=0;o<p&&!t.stopped();o+=1){if(c(l,u),l=!0,i>=50){t.append("[MaxEntries]");break}i+=1;let g;try{g=Reflect.getOwnPropertyDescriptor(_,String(o))}catch(v){t.append("[Uninspectable]");continue}g!=null&&g.enumerable?$(g,u+1):t.append("[Empty]")}w("]",l,u)}function A(_,u){let s;try{s=Reflect.ownKeys(_)}catch(l){t.append("[Uninspectable]");return}t.append("{");let p=!1;for(let l of s){if(t.stopped())break;if(i>=50){c(p,u),p=!0,E(t,"\u2026"),t.append(n?": ":":"),t.append("[MaxEntries]");break}i+=1;let o;try{o=Reflect.getOwnPropertyDescriptor(_,l)}catch(g){c(p,u),p=!0,F(t,l),t.append(n?": ":":"),t.append("[Uninspectable]");continue}o!=null&&o.enumerable&&(c(p,u),p=!0,F(t,l),t.append(n?": ":":"),$(o,u+1))}w("}",p,u)}function b(_,u){if(a.has(_)){t.append("[Circular]");return}if(u>=5){t.append("[MaxDepth]");return}let s;try{s=Array.isArray(_)}catch(p){t.append("[Uninspectable]");return}a.add(_);try{s?O(_,u):A(_,u)}finally{a.delete(_)}}function y(_,u){_===null?t.append("null"):typeof _=="string"?E(t,_):typeof _=="number"?t.append(Object.is(_,-0)?"-0":String(_)):typeof _=="boolean"?t.append(_?"true":"false"):typeof _>"u"?t.append("undefined"):typeof _=="bigint"?t.append("".concat(_,"n")):typeof _=="symbol"?H(t,_):typeof _=="function"?t.append("[Function]"):b(_,u)}try{return y(e,0),t.result()}catch(_){return"[Uninspectable]"}}var ge=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),L=ge.slice(1).split("_"),me=[],z=127;for(let e=0;e<L.length;e+=2){let r=z+1+Number.parseInt(L[e],36),t=r+Number.parseInt(L[e+1],36);me.push([r,t]),z=t}var Ee=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),de=Object.prototype.hasOwnProperty,G=Function.prototype.toString,be=G.call(Object);var Se=Map.prototype.entries,Le=Set.prototype.values;var U,Be=(U=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:U.get,J,Ie=(J=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:J.get,K,Ne=(K=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:K.get,Q,We=(Q=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Q.get,Te=RegExp.prototype.test;function S(e){var n;if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);if(r===null||r===Object.prototype)return!0;let t=Object.getOwnPropertyDescriptor(r,"constructor");return!t||!("value"in t)||typeof t.value!="function"?!1:((n=Object.getOwnPropertyDescriptor(t.value,"prototype"))==null?void 0:n.value)===r&&G.call(t.value)===be}function D(e){return typeof e=="string"}var Pe=Date.prototype.getTime;function Z(e,r){return e!=null&&de.call(e,r)}function B(e){return e===32||e>=9&&e<=13||e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function ye(e,r){return r==null?0:typeof r!="number"||!Number.isInteger(r)||r<0?null:r>e?e:r}function x(e,r=0){if(typeof e!="string"||!e.length)return null;let t=ye(e.length,r);if(t===null||t<1)return null;let n=t-1;if(!B(e.charCodeAt(n)))return n;if(n-=1,n<0)return null;if(!B(e.charCodeAt(n)))return n;for(n-=1;n>=0;n--)if(!B(e.charCodeAt(n)))return n;return null}function Y(e){return typeof e!="string"?e:e.length?[e]:[]}var X={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ee=e=>e+1,we=e=>e-1;function ve(e,r,t,n,a=()=>!1,i=!1,f=ee){if(+r<0&&i&&t==="EOL")return t;if(r>=e.length&&!i)return!1;let c=i?1:t.length,w=0,$=!1,O=!1,A=!1,b=Math.min(n.maxMismatches,e.length+t.length),y=b,_=r,u=!1,s=!1,p=!1;function l(){return w===1&&y<b-1}for(;e[_];){let o=f(_);if(n.trimBeforeMatching&&e[_].trim()===""){if(!e[o]&&i&&t==="EOL")return!0;_=f(_);continue}if(a(e[_])){if(i&&t==="EOL"&&!e[o])return!0;_=f(_);continue}if(i)return!1;let g=o>_?t[t.length-c]:t[c-1];if(!n.i&&e[_]===g||n.i&&g!==void 0&&e[_].toLowerCase()===g.toLowerCase()){if(u||(u=!0),A||(A=!0),c===t.length){if(s=!0,y!==b)return!1}else c===1&&(p=!0);if(c-=1,w++,l())return!1;if(!c)return w!==t.length||y===b||!$?_:!1}else if(!$&&!w&&($=!0),b&&y&&_){y-=1;for(let v=0;v<=y;v++){let m=o>_?t[t.length-c+1+v]:t[c-2-v],h=e[f(_)];if(m&&(!n.i&&e[_]===m||n.i&&e[_].toLowerCase()===m.toLowerCase())&&(!n.firstMustMatch||c!==t.length)){if(w++,l())return!1;c-=2,u=!0;break}else if(h&&m&&(!n.i&&h===m||n.i&&h.toLowerCase()===m.toLowerCase())&&(!n.firstMustMatch||c!==t.length)){if(!w&&!n.hungry)return!1;c-=1,u=!0;break}else if(m===void 0&&y>=0&&u&&(!n.firstMustMatch||s)&&(!n.lastMustMatch||p))return _}u||(O=_)}else return _===0&&c===1&&b>0&&y>0&&(!n.firstMustMatch||s)&&!n.lastMustMatch&&A?0:!1;if(O!==!1&&O!==_&&(O=!1),c<1)return _;_=f(_)}if(c>0)return i&&t==="EOL"?!0:n&&b>=c&&A?O||0:!1}function te(e,r,t,n,a){var _,u,s,p;if(S(a)&&Z(a,"trimBeforeMatching")&&a&&typeof a.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let i=R(R({},X),a);if(i.maxMismatches=(_=a==null?void 0:a.maxMismatches)!=null?_:X.maxMismatches,$e(i.maxMismatches,e),typeof i.trimCharsBeforeMatching=="string"&&(i.trimCharsBeforeMatching=Y(i.trimCharsBeforeMatching)),i.trimCharsBeforeMatching=i.trimCharsBeforeMatching.map(l=>D(l)?l:String(l)),!D(r)||!r.length)return!1;if(!Number.isInteger(t)||t<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof t,", equal to:\n").concat(k(t,4)));let f,c;if(D(n))f=[n];else if(Array.isArray(n))f=n;else if(!n)f=n;else if(typeof n=="function")f=[],f.push(n);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof n,", equal to:\n").concat(k(n,4)));if(Oe(f,e),a&&!S(a))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof a,'", and equal to:\n').concat(k(a,4)));let w=0,$="";if((u=i==null?void 0:i.trimCharsBeforeMatching)!=null&&u.some((l,o)=>l.length>1?(w=o,$=l,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(w," is longer than 1 character, ").concat($.length," (equals to ").concat($,"). Please split it into separate characters and put into array as separate elements."));if(t>=r.length)return!1;let O=i.i?i.trimCharsBeforeMatching.map(l=>l.toLowerCase()):i.trimCharsBeforeMatching,A=i.i?l=>O.includes(l.toLowerCase()):l=>O.includes(l);if(!f||!Array.isArray(f)||Array.isArray(f)&&!f.length||Array.isArray(f)&&f.length===1&&D(f[0])&&!f[0].trim()){if(typeof i.cb=="function"){let o,g=t;if((e==="matchLeftIncl"||e==="matchRight")&&(g+=1),e[5]==="L")for(let h=g;h--;){let d=r[h];if((!i.trimBeforeMatching||i.trimBeforeMatching&&(d!=null&&d.trim()))&&(!((s=i.trimCharsBeforeMatching)!=null&&s.length)||d!==void 0&&!A(d))){o=h;break}}else if(e.startsWith("matchRight"))for(let h=g;h<r.length;h++){let d=r[h];if((!i.trimBeforeMatching||i.trimBeforeMatching&&d.trim())&&(!((p=i.trimCharsBeforeMatching)!=null&&p.length)||!A(d))){o=h;break}}if(o===void 0)return!1;let v=r[o],m=e[5]==="L"?r.slice(0,o+1):r.slice(o);return e[5],i.cb(v,m,o)}let l="";throw a||(l=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(l))}if(!i.cb&&!i.i&&!i.trimBeforeMatching&&!i.trimCharsBeforeMatching.length&&i.maxMismatches===0&&!i.firstMustMatch&&!i.lastMustMatch&&!i.hungry&&f.every(D)){for(let l of f){if(!l.length)continue;let o=t;if(e==="matchRight"?o+=1:e==="matchLeft"?o-=l.length:e==="matchLeftIncl"&&(o-=l.length-1),o>=0&&r.startsWith(l,o))return l}return!1}let b=t;e==="matchRight"?b+=1:e==="matchLeft"&&(b-=1);let y=e[5]==="L"?we:ee;for(let l=0,o=f.length;l<o;l++){c=typeof f[l]=="function";let g=f[l],v=typeof g=="function"?g():g;if(c&&v!=="EOL")throw new Error("string-match-left-right/".concat(e,'(): [THROW_ID_09] EOL marker functions must return "EOL". The function at index ').concat(l," returned:\n").concat(k(v,4)));if(c&&e.endsWith("Incl"))continue;let m,h,d="",C=ve(r,b,v,i,A,c,y);if(C&&c)return!i.cb||i.cb(m,d,h)?v:!1;if(Number.isInteger(C)&&(h=e.startsWith("matchLeft")?C-1:C+1,e[5]==="L"?d=r.slice(0,C):d=r.slice(h)),h<0&&(h=void 0),r[h]&&(m=r[h]),Number.isInteger(C)&&(!i.cb||i.cb(m,d,h)))return v}return!1}function $e(e,r){if(!Number.isSafeInteger(e)||e<0)throw new Error("string-match-left-right/".concat(r,"(): [THROW_ID_07] opts.maxMismatches must be a non-negative safe integer. Currently it's of a type: ").concat(typeof e,", equal to:\n").concat(k(e,4)))}function Oe(e,r){if(e)for(let t=0;t<e.length;t+=1){let n=e[t];if(typeof n!="string"&&typeof n!="function")throw new Error("string-match-left-right/".concat(r,"(): [THROW_ID_08] matcher alternatives must be strings or EOL marker functions. The value at index ").concat(t," is of a type: ").concat(typeof n,", equal to:\n").concat(k(n,4)))}}function re(e,r,t,n){return te("matchRightIncl",e,r,t,n)}function ne(e,r,t,n){return te("matchRight",e,r,t,n)}var _e="4.2.4";function M(e,r){return e[r]==="<"||e[x(e,r)]==="<"}function ie(e){return e===void 0||e.toUpperCase()===e.toLowerCase()&&!/\d/.test(e)&&e!=="="}var I={allowCustomTagNames:!1,skipOpeningBracket:!1},N="\\",W=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h1 - h6","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xml"];var Ce=_e;function ke(e,r=0,t){var m,h,d;if(typeof e!="string")throw new Error('is-html-tag-opening/isOpening(): [THROW_ID_01] the first input argument should have been a string but it was given as "'.concat(typeof e,'", value being ').concat(k(e,4)));if(!Number.isInteger(r)||r<0)throw new Error('is-html-tag-opening/isOpening(): [THROW_ID_02] the second input argument should have been a natural number string index but it was given as "'.concat(typeof r,'", value being ').concat(k(r,4)));let n=R(R({},I),t),a="[\\\\ \\t\\r\\n/]*",i="._a-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\uFFFF",f=new RegExp("^<".concat(n.skipOpeningBracket?"?":"").concat(a,"\\w+").concat(a,"\\/?").concat(a,">"),"g"),c=new RegExp("^<".concat(n.skipOpeningBracket?"?":"").concat(a,"[").concat(i,"]+[-").concat(i,"]*").concat(a,">"),"g"),w=new RegExp("^<".concat(n.skipOpeningBracket?"?":"","\\s*\\w+\\s+\\w+(?:-\\w+)?\\s*=\\s*['\"\\w]"),"g"),$=new RegExp("^<".concat(n.skipOpeningBracket?"?":"","\\s*\\w+\\s+[").concat(i,"]+[-").concat(i,"]*(?:-\\w+)?\\s*=\\s*['\"\\w]")),O=new RegExp("^<".concat(n.skipOpeningBracket?"?":"","\\s*\\/?\\s*\\w+\\s*\\/?\\s*>"),"g"),A=new RegExp("^<".concat(n.skipOpeningBracket?"?":"","\\s*\\/?\\s*[").concat(i,"]+[-").concat(i,"]*\\s*\\/?\\s*>"),"g"),b=new RegExp("^<".concat(n.skipOpeningBracket?"?":"").concat(a,"\\w+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),y=new RegExp("^<".concat(n.skipOpeningBracket?"?":"").concat(a,"[").concat(i,"]+[-").concat(i,"]*\\s+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),_=new RegExp("^<".concat(n.skipOpeningBracket?"?\\/?":"","(").concat(a,"[").concat(i,"]+)+").concat(a,"[\\\\/=>]"),""),u=/^\/\s*\w+s*>/,s=r?e.slice(r):e,p=x(e,r),l=!1,o=!1,g={cb:ie,i:!0,trimCharsBeforeMatching:["/",N,"!"," "," ","\n","\r"]};return n.allowCustomTagNames?((n.skipOpeningBracket&&(e[r-1]==="<"||e[r-1]==="/"&&e[x(e,p)]==="<")||s[0]==="<"&&((m=s[1])!=null&&m.trim()))&&(_.test(s)||/^<\w+$/.test(s))||c.test(s)&&M(e,r)||$.test(s)||A.test(s)&&M(e,r)||y.test(s)||e[r]==="/"&&e[p]!=="<"&&u.test(s))&&(o=!0):(((n.skipOpeningBracket&&(e[r-1]==="<"||e[r-1]==="/"&&e[x(e,p)]==="<")||(s[0]==="<"||s[0]==="/"&&(!e[p]||e[p]!=="<"))&&((h=s[1])!=null&&h.trim()))&&_.test(s)||f.test(s)&&M(e,r)||w.test(s)||O.test(s)&&M(e,r)||b.test(s))&&(l=!0),l&&re(e,r,W,{cb:C=>{var T;return C===void 0?((e[r]==="<"&&((T=e[r+1])!=null&&T.trim())||e[r-1]==="<")&&(o=!0),!0):C.toUpperCase()===C.toLowerCase()&&!/\d/.test(C)&&C!=="="},i:!0,trimCharsBeforeMatching:["<","/",N,"!"," "," ","\n","\r"]})&&(o=!0)),!o&&e[r]==="<"&&((d=e[r+1])!=null&&d.trim())&&ne(e,r,W,g)&&(o=!0),typeof e=="string"&&r<e.length&&o}return fe(Re);})();
11
+ /**
12
+ * @name codsen-format-diagnostic-value
13
+ * @fileoverview Safely format untrusted JavaScript values for diagnostics
14
+ * @version 1.1.1
15
+ * @author Roy Revelt
16
+ * @license MIT
17
+ * {@link https://codsen.com/os/codsen-format-diagnostic-value/}
18
+ */
11
19
  /**
12
20
  * @name codsen-utils
13
21
  * @fileoverview Various utility functions
14
- * @version 1.9.0
22
+ * @version 1.10.1
15
23
  * @author Roy Revelt
16
24
  * @license MIT
17
25
  * {@link https://codsen.com/os/codsen-utils/}
@@ -19,7 +27,7 @@
19
27
  /**
20
28
  * @name string-left-right
21
29
  * @fileoverview Looks up the first non-whitespace character to the left/right of a given index
22
- * @version 6.2.1
30
+ * @version 6.2.3
23
31
  * @author Roy Revelt
24
32
  * @license MIT
25
33
  * {@link https://codsen.com/os/string-left-right/}
@@ -27,7 +35,7 @@
27
35
  /**
28
36
  * @name arrayiffy-if-string
29
37
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
30
- * @version 5.2.1
38
+ * @version 5.2.3
31
39
  * @author Roy Revelt
32
40
  * @license MIT
33
41
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -35,7 +43,7 @@
35
43
  /**
36
44
  * @name string-match-left-right
37
45
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
38
- * @version 9.2.2
46
+ * @version 9.2.4
39
47
  * @author Roy Revelt
40
48
  * @license MIT
41
49
  * {@link https://codsen.com/os/string-match-left-right/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "is-html-tag-opening",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "description": "Does an HTML tag start at given position?",
5
5
  "keywords": [
6
6
  "bracket",
@@ -69,12 +69,12 @@
69
69
  }
70
70
  },
71
71
  "dependencies": {
72
- "codsen-utils": "^1.9.0",
73
- "string-left-right": "^6.2.1",
74
- "string-match-left-right": "^9.2.2"
72
+ "codsen-utils": "^1.10.1",
73
+ "string-left-right": "^6.2.3",
74
+ "string-match-left-right": "^9.2.4"
75
75
  },
76
76
  "devDependencies": {
77
- "test-mixer": "^4.3.1"
77
+ "test-mixer": "^4.4.1"
78
78
  },
79
79
  "engines": {
80
80
  "node": ">=18.20.8"