Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regex

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regex - npm Package Compare versions

Comparing version 5.0.2 to 5.1.0

2

dist/cjs/internals.d.ts

@@ -1,2 +0,2 @@

export { RegExpSubclass } from "./subclass.js";
export { atomic, possessive } from "./atomic.js";
export { emulationGroupMarker, RegExpSubclass } from "./subclass.js";

@@ -123,9 +123,17 @@ var __defProp = Object.defineProperty;

var RegExpSubclass = class _RegExpSubclass extends RegExp {
// Avoid `#private` to allow for subclassing
/**
Avoid `#private` to allow for subclassing.
@private
@type {Array<boolean> | undefined}
@type {Array<{
exclude: boolean;
transfer?: number;
}> | undefined}
*/
_captureMap;
/**
@private
@type {Record<number, string> | undefined}
*/
_namesByIndex;
/**
@param {string | RegExpSubclass} expression

@@ -137,14 +145,12 @@ @param {string} [flags]

if (expression instanceof RegExp && options) {
throw new Error("Cannot provide options when copying regexp");
throw new Error("Cannot provide options when copying a regexp");
}
let captureMap;
if (options?.useEmulationGroups) {
({ expression, captureMap } = unmarkEmulationGroups(expression));
const useEmulationGroups = !!options?.useEmulationGroups;
const unmarked = useEmulationGroups ? unmarkEmulationGroups(expression) : null;
super(unmarked?.expression || expression, flags);
const src = useEmulationGroups ? unmarked : expression instanceof _RegExpSubclass ? expression : null;
if (src) {
this._captureMap = src._captureMap;
this._namesByIndex = src._namesByIndex;
}
super(expression, flags);
if (captureMap) {
this._captureMap = captureMap;
} else if (expression instanceof _RegExpSubclass) {
this._captureMap = expression._captureMap;
}
}

@@ -170,3 +176,18 @@ /**

for (let i = 1; i < matchCopy.length; i++) {
if (this._captureMap[i]) {
if (this._captureMap[i].exclude) {
const transfer = this._captureMap[i].transfer;
if (transfer && match.length > transfer) {
match[transfer] = matchCopy[i];
const transferName = this._namesByIndex[transfer];
if (transferName) {
match.groups[transferName] = matchCopy[i];
if (this.hasIndices) {
match.indices.groups[transferName] = indicesCopy[i];
}
}
if (this.hasIndices) {
match.indices[transfer] = indicesCopy[i];
}
}
} else {
match.push(matchCopy[i]);

@@ -183,12 +204,23 @@ if (this.hasIndices) {

const marker = emulationGroupMarker.replace(/\$/g, "\\$");
const captureMap = [true];
const _captureMap = [{ exclude: false }];
const _namesByIndex = { 0: "" };
let captureNum = 0;
expression = replaceUnescaped(
expression,
String.raw`\((?:(?!\?)|\?<(?![=!])[^>]+>)(?<mark>${marker})?`,
({ 0: m, groups: { mark } }) => {
String.raw`\((?:(?!\?)|\?<(?![=!])(?<name>[^>]+)>)(?<mark>(?:\$(?<transfer>[1-9]\d*))?${marker})?`,
({ 0: m, groups: { name, mark, transfer } }) => {
captureNum++;
if (name) {
_namesByIndex[captureNum] = name;
}
if (mark) {
captureMap.push(false);
return m.slice(0, -emulationGroupMarker.length);
_captureMap.push({
exclude: true,
transfer: transfer && +transfer
});
return m.slice(0, -mark.length);
}
captureMap.push(true);
_captureMap.push({
exclude: false
});
return m;

@@ -199,3 +231,4 @@ },

return {
captureMap,
_captureMap,
_namesByIndex,
expression

@@ -202,0 +235,0 @@ };

@@ -16,7 +16,14 @@ export const emulationGroupMarker: "$E$";

/**
Avoid `#private` to allow for subclassing.
@private
@type {Array<boolean> | undefined}
@type {Array<{
exclude: boolean;
transfer?: number;
}> | undefined}
*/
private _captureMap;
/**
@private
@type {Record<number, string> | undefined}
*/
private _namesByIndex;
}

@@ -1,2 +0,2 @@

export { RegExpSubclass } from "./subclass.js";
export { atomic, possessive } from "./atomic.js";
export { emulationGroupMarker, RegExpSubclass } from "./subclass.js";

@@ -96,9 +96,17 @@ // node_modules/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js

var RegExpSubclass = class _RegExpSubclass extends RegExp {
// Avoid `#private` to allow for subclassing
/**
Avoid `#private` to allow for subclassing.
@private
@type {Array<boolean> | undefined}
@type {Array<{
exclude: boolean;
transfer?: number;
}> | undefined}
*/
_captureMap;
/**
@private
@type {Record<number, string> | undefined}
*/
_namesByIndex;
/**
@param {string | RegExpSubclass} expression

@@ -110,14 +118,12 @@ @param {string} [flags]

if (expression instanceof RegExp && options) {
throw new Error("Cannot provide options when copying regexp");
throw new Error("Cannot provide options when copying a regexp");
}
let captureMap;
if (options?.useEmulationGroups) {
({ expression, captureMap } = unmarkEmulationGroups(expression));
const useEmulationGroups = !!options?.useEmulationGroups;
const unmarked = useEmulationGroups ? unmarkEmulationGroups(expression) : null;
super(unmarked?.expression || expression, flags);
const src = useEmulationGroups ? unmarked : expression instanceof _RegExpSubclass ? expression : null;
if (src) {
this._captureMap = src._captureMap;
this._namesByIndex = src._namesByIndex;
}
super(expression, flags);
if (captureMap) {
this._captureMap = captureMap;
} else if (expression instanceof _RegExpSubclass) {
this._captureMap = expression._captureMap;
}
}

@@ -143,3 +149,18 @@ /**

for (let i = 1; i < matchCopy.length; i++) {
if (this._captureMap[i]) {
if (this._captureMap[i].exclude) {
const transfer = this._captureMap[i].transfer;
if (transfer && match.length > transfer) {
match[transfer] = matchCopy[i];
const transferName = this._namesByIndex[transfer];
if (transferName) {
match.groups[transferName] = matchCopy[i];
if (this.hasIndices) {
match.indices.groups[transferName] = indicesCopy[i];
}
}
if (this.hasIndices) {
match.indices[transfer] = indicesCopy[i];
}
}
} else {
match.push(matchCopy[i]);

@@ -156,12 +177,23 @@ if (this.hasIndices) {

const marker = emulationGroupMarker.replace(/\$/g, "\\$");
const captureMap = [true];
const _captureMap = [{ exclude: false }];
const _namesByIndex = { 0: "" };
let captureNum = 0;
expression = replaceUnescaped(
expression,
String.raw`\((?:(?!\?)|\?<(?![=!])[^>]+>)(?<mark>${marker})?`,
({ 0: m, groups: { mark } }) => {
String.raw`\((?:(?!\?)|\?<(?![=!])(?<name>[^>]+)>)(?<mark>(?:\$(?<transfer>[1-9]\d*))?${marker})?`,
({ 0: m, groups: { name, mark, transfer } }) => {
captureNum++;
if (name) {
_namesByIndex[captureNum] = name;
}
if (mark) {
captureMap.push(false);
return m.slice(0, -emulationGroupMarker.length);
_captureMap.push({
exclude: true,
transfer: transfer && +transfer
});
return m.slice(0, -mark.length);
}
captureMap.push(true);
_captureMap.push({
exclude: false
});
return m;

@@ -172,3 +204,4 @@ },

return {
captureMap,
_captureMap,
_namesByIndex,
expression

@@ -175,0 +208,0 @@ };

@@ -16,7 +16,14 @@ export const emulationGroupMarker: "$E$";

/**
Avoid `#private` to allow for subclassing.
@private
@type {Array<boolean> | undefined}
@type {Array<{
exclude: boolean;
transfer?: number;
}> | undefined}
*/
private _captureMap;
/**
@private
@type {Record<number, string> | undefined}
*/
private _namesByIndex;
}

@@ -1,2 +0,2 @@

var Regex=(()=>{var Z=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var Te=Object.prototype.hasOwnProperty;var Ue=(e,t)=>{for(var n in t)Z(e,n,{get:t[n],enumerable:!0})},xe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of be(t))!Te.call(e,s)&&s!==n&&Z(e,s,{get:()=>t[s],enumerable:!(r=_e(t,s))||r.enumerable});return e};var Re=e=>xe(Z({},"__esModule",{value:!0}),e);var Je={};Ue(Je,{pattern:()=>H,regex:()=>We,rewrite:()=>Ke});var g=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function C(e,t,n,r){let s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1],i=0,o="";for(let u of e.matchAll(s)){let{0:c,groups:{$skip:p}}=u;if(!p&&(!r||r===g.DEFAULT==!i)){n instanceof Function?o+=n(u,{context:i?g.CHAR_CLASS:g.DEFAULT,negated:a[a.length-1]}):o+=n;continue}c[0]==="["?(i++,a.push(c[1]==="^")):c==="]"&&i&&(i--,a.pop()),o+=c}return o}function P(e,t,n,r){C(e,t,n,r)}function V(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;let s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let a=0,i;for(;i=s.exec(e);){let{0:o,groups:{$skip:u}}=i;if(!u&&(!r||r===g.DEFAULT==!a))return i;o==="["?a++:o==="]"&&a&&a--,s.lastIndex==i.index&&s.lastIndex++}return null}function j(e,t,n){return!!V(e,t,0,n)}function J(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,s=0,a=1,i;for(;i=n.exec(e);){let[o]=i;if(o==="[")s++;else if(s)o==="]"&&s--;else if(o==="(")a++;else if(o===")"&&(a--,!a)){r=i.index;break}}return e.slice(t,r)}var I="$E$",Q=class e extends RegExp{_captureMap;constructor(t,n,r){if(t instanceof RegExp&&r)throw new Error("Cannot provide options when copying regexp");let s;r?.useEmulationGroups&&({expression:t,captureMap:s}=Fe(t)),super(t,n),s?this._captureMap=s:t instanceof e&&(this._captureMap=t._captureMap)}exec(t){let n=RegExp.prototype.exec.call(this,t);if(!n||!this._captureMap)return n;let r=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);for(let a=1;a<r.length;a++)this._captureMap[a]&&(n.push(r[a]),this.hasIndices&&n.indices.push(s[a]));return n}};function Fe(e){let t=I.replace(/\$/g,"\\$"),n=[!0];return e=C(e,String.raw`\((?:(?!\?)|\?<(?![=!])[^>]+>)(?<mark>${t})?`,({0:r,groups:{mark:s}})=>s?(n.push(!1),r.slice(0,-I.length)):(n.push(!0),r),g.DEFAULT),{captureMap:n,expression:e}}var b=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function T(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var oe=new RegExp(String.raw`(?<noncapturingStart>${b})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function ae(e,t){if(!/\(\?>/.test(e))return e;let n="(?>",r=`(?:(?=(${t?.useEmulationGroups?I:""}`,s=[0],a=0,i=0,o=NaN,u;do{u=!1;let c=0,p=0,E=!1,l;for(oe.lastIndex=Number.isNaN(o)?0:o+r.length;l=oe.exec(e);){let{0:d,index:A,groups:{capturingStart:h,noncapturingStart:S}}=l;if(d==="[")c++;else if(c)d==="]"&&c--;else if(d===n&&!E)o=A,E=!0;else if(E&&S)p++;else if(h)E?p++:(a++,s.push(a+i));else if(d===")"&&E){if(!p){i++,e=`${e.slice(0,o)}${r}${e.slice(o+n.length,A)}))<$$${i+a}>)${e.slice(A+1)}`,u=!0;break}p--}}}while(u);return e=C(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:c,groups:{backrefNum:p,wrappedBackrefNum:E}})=>{if(p){let l=+p;if(l>s.length-1)throw new Error(`Backref "${c}" greater than number of captures`);return`\\${s[l]}`}return`\\${E}`},g.DEFAULT),e}var ie=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,X=new RegExp(String.raw`
var Regex=(()=>{var Z=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var Te=(e,n)=>{for(var t in n)Z(e,t,{get:n[t],enumerable:!0})},Ue=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of De(n))!be.call(e,s)&&s!==t&&Z(e,s,{get:()=>n[s],enumerable:!(r=xe(n,s))||r.enumerable});return e};var Re=e=>Ue(Z({},"__esModule",{value:!0}),e);var Je={};Te(Je,{pattern:()=>H,regex:()=>We,rewrite:()=>Ke});var d=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function C(e,n,t,r){let s=new RegExp(String.raw`${n}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1],i=0,a="";for(let u of e.matchAll(s)){let{0:c,groups:{$skip:p}}=u;if(!p&&(!r||r===d.DEFAULT==!i)){t instanceof Function?a+=t(u,{context:i?d.CHAR_CLASS:d.DEFAULT,negated:o[o.length-1]}):a+=t;continue}c[0]==="["?(i++,o.push(c[1]==="^")):c==="]"&&i&&(i--,o.pop()),a+=c}return a}function P(e,n,t,r){C(e,n,t,r)}function V(e,n,t=0,r){if(!new RegExp(n,"su").test(e))return null;let s=new RegExp(`${n}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=t;let o=0,i;for(;i=s.exec(e);){let{0:a,groups:{$skip:u}}=i;if(!u&&(!r||r===d.DEFAULT==!o))return i;a==="["?o++:a==="]"&&o&&o--,s.lastIndex==i.index&&s.lastIndex++}return null}function j(e,n,t){return!!V(e,n,0,t)}function J(e,n){let t=/\\?./gsu;t.lastIndex=n;let r=e.length,s=0,o=1,i;for(;i=t.exec(e);){let[a]=i;if(a==="[")s++;else if(s)a==="]"&&s--;else if(a==="(")o++;else if(a===")"&&(o--,!o)){r=i.index;break}}return e.slice(n,r)}var x="$E$",Q=class e extends RegExp{_captureMap;_namesByIndex;constructor(n,t,r){if(n instanceof RegExp&&r)throw new Error("Cannot provide options when copying a regexp");let s=!!r?.useEmulationGroups,o=s?Fe(n):null;super(o?.expression||n,t);let i=s?o:n instanceof e?n:null;i&&(this._captureMap=i._captureMap,this._namesByIndex=i._namesByIndex)}exec(n){let t=RegExp.prototype.exec.call(this,n);if(!t||!this._captureMap)return t;let r=[...t];t.length=1;let s;this.hasIndices&&(s=[...t.indices],t.indices.length=1);for(let o=1;o<r.length;o++)if(this._captureMap[o].exclude){let i=this._captureMap[o].transfer;if(i&&t.length>i){t[i]=r[o];let a=this._namesByIndex[i];a&&(t.groups[a]=r[o],this.hasIndices&&(t.indices.groups[a]=s[o])),this.hasIndices&&(t.indices[i]=s[o])}}else t.push(r[o]),this.hasIndices&&t.indices.push(s[o]);return t}};function Fe(e){let n=x.replace(/\$/g,"\\$"),t=[{exclude:!1}],r={0:""},s=0;return e=C(e,String.raw`\((?:(?!\?)|\?<(?![=!])(?<name>[^>]+)>)(?<mark>(?:\$(?<transfer>[1-9]\d*))?${n})?`,({0:o,groups:{name:i,mark:a,transfer:u}})=>(s++,i&&(r[s]=i),a?(t.push({exclude:!0,transfer:u&&+u}),o.slice(0,-a.length)):(t.push({exclude:!1}),o)),d.DEFAULT),{_captureMap:t,_namesByIndex:r,expression:e}}var D=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function b(e,n,t,r){return e.slice(0,n)+r+e.slice(n+t.length)}var oe=new RegExp(String.raw`(?<noncapturingStart>${D})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function ae(e,n){if(!/\(\?>/.test(e))return e;let t="(?>",r=`(?:(?=(${n?.useEmulationGroups?x:""}`,s=[0],o=0,i=0,a=NaN,u;do{u=!1;let c=0,p=0,E=!1,l;for(oe.lastIndex=Number.isNaN(a)?0:a+r.length;l=oe.exec(e);){let{0:g,index:A,groups:{capturingStart:h,noncapturingStart:S}}=l;if(g==="[")c++;else if(c)g==="]"&&c--;else if(g===t&&!E)a=A,E=!0;else if(E&&S)p++;else if(h)E?p++:(o++,s.push(o+i));else if(g===")"&&E){if(!p){i++,e=`${e.slice(0,a)}${r}${e.slice(a+t.length,A)}))<$$${i+o}>)${e.slice(A+1)}`,u=!0;break}p--}}}while(u);return e=C(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:c,groups:{backrefNum:p,wrappedBackrefNum:E}})=>{if(p){let l=+p;if(l>s.length-1)throw new Error(`Backref "${c}" greater than number of captures`);return`\\${s[l]}`}return`\\${E}`},d.DEFAULT),e}var ie=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,X=new RegExp(String.raw`
\\(?: \d+

@@ -16,3 +16,3 @@ | c[A-Za-z]

| \\?.
`.replace(/\s+/g,""),"gsu");function ue(e){if(!new RegExp(`${ie}\\+`).test(e))return e;let t=[],n=null,r=null,s="",a=0,i;for(X.lastIndex=0;i=X.exec(e);){let{0:o,index:u,groups:{qBase:c,qMod:p,invalidQ:E}}=i;if(o==="[")a||(r=u),a++;else if(o==="]")a?a--:r=null;else if(!a)if(p==="+"&&s&&!s.startsWith("(")){if(E)throw new Error(`Invalid quantifier "${o}"`);let l=-1;if(/^\{\d+\}$/.test(c))e=T(e,u+c.length,p,"");else{if(s===")"||s==="]"){let d=s===")"?n:r;if(d===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,d)}(?>${e.slice(d,u)}${c})${e.slice(u+o.length)}`}else e=`${e.slice(0,u-s.length)}(?>${s}${c})${e.slice(u+o.length)}`;l+=4}X.lastIndex+=l}else o[0]==="("?t.push(u):o===")"&&(n=t.length?t.pop():null);s=o}return e}var L=class{#e;constructor(t){this.#e=t}toString(){return String(this.#e)}};function H(e,...t){if(Array.isArray(e?.raw))return new L(e.raw.flatMap((n,r)=>r<e.raw.length-1?[n,t[r]]:n).join(""));if(!t.length)return new L(e===void 0?"":e);throw new Error(`Unexpected arguments: ${JSON.stringify([e,...t])}`)}var f={DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS",ENCLOSED_P:"ENCLOSED_P",ENCLOSED_U:"ENCLOSED_U",GROUP_NAME:"GROUP_NAME",INTERVAL_QUANTIFIER:"INTERVAL_QUANTIFIER",INVALID_INCOMPLETE_TOKEN:"INVALID_INCOMPLETE_TOKEN"},m={DEFAULT:"DEFAULT",ENCLOSED_P:"ENCLOSED_P",ENCLOSED_Q:"ENCLOSED_Q",ENCLOSED_U:"ENCLOSED_U",INVALID_INCOMPLETE_TOKEN:"INVALID_INCOMPLETE_TOKEN",RANGE:"RANGE"},q=new Set([f.ENCLOSED_P,f.ENCLOSED_U]),k=new Set([m.ENCLOSED_P,m.ENCLOSED_Q,m.ENCLOSED_U]),G=(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),fe=(()=>{try{new RegExp("","v")}catch{return!1}return!0})(),U="&!#$%*+,.:;<=>?@^`~",B=String.raw`\(\?<(?![=!])(?<captureName>[^>]+)>`,W=String.raw`\((?!\?)(?!(?<=\(\?\()DEFINE\))|${B}`;function pe(e,t){return C(e,String.raw`\\(?<num>[1-9]\d*)`,({groups:{num:n}})=>`\\${+n+t}`,g.DEFAULT)}var Oe=["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"].join("|"),Pe=new RegExp(String.raw`
`.replace(/\s+/g,""),"gsu");function ue(e){if(!new RegExp(`${ie}\\+`).test(e))return e;let n=[],t=null,r=null,s="",o=0,i;for(X.lastIndex=0;i=X.exec(e);){let{0:a,index:u,groups:{qBase:c,qMod:p,invalidQ:E}}=i;if(a==="[")o||(r=u),o++;else if(a==="]")o?o--:r=null;else if(!o)if(p==="+"&&s&&!s.startsWith("(")){if(E)throw new Error(`Invalid quantifier "${a}"`);let l=-1;if(/^\{\d+\}$/.test(c))e=b(e,u+c.length,p,"");else{if(s===")"||s==="]"){let g=s===")"?t:r;if(g===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,g)}(?>${e.slice(g,u)}${c})${e.slice(u+a.length)}`}else e=`${e.slice(0,u-s.length)}(?>${s}${c})${e.slice(u+a.length)}`;l+=4}X.lastIndex+=l}else a[0]==="("?n.push(u):a===")"&&(t=n.length?n.pop():null);s=a}return e}var I=class{#e;constructor(n){this.#e=n}toString(){return String(this.#e)}};function H(e,...n){if(Array.isArray(e?.raw))return new I(e.raw.flatMap((t,r)=>r<e.raw.length-1?[t,n[r]]:t).join(""));if(!n.length)return new I(e===void 0?"":e);throw new Error(`Unexpected arguments: ${JSON.stringify([e,...n])}`)}var f={DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS",ENCLOSED_P:"ENCLOSED_P",ENCLOSED_U:"ENCLOSED_U",GROUP_NAME:"GROUP_NAME",INTERVAL_QUANTIFIER:"INTERVAL_QUANTIFIER",INVALID_INCOMPLETE_TOKEN:"INVALID_INCOMPLETE_TOKEN"},m={DEFAULT:"DEFAULT",ENCLOSED_P:"ENCLOSED_P",ENCLOSED_Q:"ENCLOSED_Q",ENCLOSED_U:"ENCLOSED_U",INVALID_INCOMPLETE_TOKEN:"INVALID_INCOMPLETE_TOKEN",RANGE:"RANGE"},q=new Set([f.ENCLOSED_P,f.ENCLOSED_U]),k=new Set([m.ENCLOSED_P,m.ENCLOSED_Q,m.ENCLOSED_U]),G=(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),fe=(()=>{try{new RegExp("","v")}catch{return!1}return!0})(),T="&!#$%*+,.:;<=>?@^`~",B=String.raw`\(\?<(?![=!])(?<captureName>[^>]+)>`,W=String.raw`\((?!\?)(?!(?<=\(\?\()DEFINE\))|${B}`;function pe(e,n){return C(e,String.raw`\\(?<num>[1-9]\d*)`,({groups:{num:t}})=>`\\${+t+n}`,d.DEFAULT)}var Oe=["Basic_Emoji","Emoji_Keycap_Sequence","RGI_Emoji_Modifier_Sequence","RGI_Emoji_Flag_Sequence","RGI_Emoji_Tag_Sequence","RGI_Emoji_ZWJ_Sequence","RGI_Emoji"].join("|"),Pe=new RegExp(String.raw`
\\(?: c[A-Za-z]

@@ -29,3 +29,3 @@ | p\{(?<pStrProp>${Oe})\}

| .
`.replace(/\s+/g,""),"gsu");function Y(e){let t=!1,n;for(let{0:r,groups:s}of e.matchAll(Pe)){if(s.pStrProp||s.qStrProp||r==="["&&t)return!0;if(["-","--","&&"].includes(r))t=!1;else if(r!=="["&&r!=="]"){if(t||n==="]")return!0;t=!0}n=r}return!1}function x(e){let t=0;return P(e,W,()=>t++,g.DEFAULT),t}function ee(e,t){return t===g.CHAR_CLASS?e.replace(new RegExp(String.raw`[()\[\]{}|\\/\-${U}]`,"g"),"\\$&"):e.replace(/[()\[\]{}|\\^$*+?.]/g,"\\$&")}function ge(e,t,n){let r=e.replace(/\\./gsu,"");if(r.endsWith("\\"))return"\\";if(t===f.DEFAULT)return ce(r,"(",")");if(t===f.CHAR_CLASS&&!k.has(n))return ce(r,"[","]");if(t===f.INTERVAL_QUANTIFIER||q.has(t)||k.has(n)){if(r.includes("}"))return"}"}else if(t===f.GROUP_NAME&&r.includes(">"))return">";return""}var le=new RegExp(String.raw`
`.replace(/\s+/g,""),"gsu");function Y(e){let n=!1,t;for(let{0:r,groups:s}of e.matchAll(Pe)){if(s.pStrProp||s.qStrProp||r==="["&&n)return!0;if(["-","--","&&"].includes(r))n=!1;else if(r!=="["&&r!=="]"){if(n||t==="]")return!0;n=!0}t=r}return!1}function U(e){let n=0;return P(e,W,()=>n++,d.DEFAULT),n}function ee(e,n){return n===d.CHAR_CLASS?e.replace(new RegExp(String.raw`[()\[\]{}|\\/\-${T}]`,"g"),"\\$&"):e.replace(/[()\[\]{}|\\^$*+?.]/g,"\\$&")}function de(e,n,t){let r=e.replace(/\\./gsu,"");if(r.endsWith("\\"))return"\\";if(n===f.DEFAULT)return ce(r,"(",")");if(n===f.CHAR_CLASS&&!k.has(t))return ce(r,"[","]");if(n===f.INTERVAL_QUANTIFIER||q.has(n)||k.has(t)){if(r.includes("}"))return"}"}else if(n===f.GROUP_NAME&&r.includes(">"))return">";return""}var le=new RegExp(String.raw`
(?<groupN>\(\?<(?![=!])|\\[gk]<)

@@ -43,6 +43,6 @@ | (?<enclosedPU>\\[pPu]\{)

| \\?.
`.replace(/\s+/g,""),"gsu");function R(e,t){let{regexContext:n,charClassContext:r,charClassDepth:s,lastPos:a}={regexContext:f.DEFAULT,charClassContext:m.DEFAULT,charClassDepth:0,lastPos:0,...t};le.lastIndex=a;let i;for(;i=le.exec(e);){let{0:o,groups:{groupN:u,enclosedPU:c,enclosedQ:p,intervalQ:E,incompleteT:l}}=i;o==="["?(s++,n=f.CHAR_CLASS,r=m.DEFAULT):o==="]"&&n===f.CHAR_CLASS?(s&&s--,s||(n=f.DEFAULT),r=m.DEFAULT):n===f.CHAR_CLASS?l?r=m.INVALID_INCOMPLETE_TOKEN:o==="-"?r=m.RANGE:c?r=o[1]==="u"?m.ENCLOSED_U:m.ENCLOSED_P:p?r=m.ENCLOSED_Q:(o==="}"&&k.has(r)||r===m.INVALID_INCOMPLETE_TOKEN||r===m.RANGE)&&(r=m.DEFAULT):l?n=f.INVALID_INCOMPLETE_TOKEN:u?n=f.GROUP_NAME:c?n=o[1]==="u"?f.ENCLOSED_U:f.ENCLOSED_P:E?n=f.INTERVAL_QUANTIFIER:(o===">"&&n===f.GROUP_NAME||o==="}"&&(n===f.INTERVAL_QUANTIFIER||q.has(n))||n===f.INVALID_INCOMPLETE_TOKEN)&&(n=f.DEFAULT)}return{regexContext:n,charClassContext:r,charClassDepth:s,lastPos:e.length}}function ce(e,t,n){let r=0;for(let[s]of e.matchAll(new RegExp(`[${ee(t+n,g.CHAR_CLASS)}]`,"g")))if(r+=s===t?1:-1,r<0)return n;return r>0?t:""}function de(e,t,n,r){let s={raw:[]},a=[],i;return e.raw.forEach((o,u)=>{let c=n(o,{...i,lastPos:0},r);if(s.raw.push(c.transformed),i=c.runningContext,u<e.raw.length-1){let p=t[u];if(p instanceof L){let E=n(p,{...i,lastPos:0},r);a.push(H(E.transformed)),i=E.runningContext}else a.push(p)}}),{template:s,substitutions:a}}function Ee(e){return e.replace(/^\^/,"\\^^")}function K(e){return e.replace(new RegExp(`^([${U}])(?!\\1)`),(t,n,r)=>`\\${t}${r+1===e.length?"":t}`)}function M(e,t){return C(e,String.raw`\\0(?!\d)`,"\\x00",t)}var ke="&!#%,:;<=>@`~",Ge=new RegExp(String.raw`
`.replace(/\s+/g,""),"gsu");function R(e,n){let{regexContext:t,charClassContext:r,charClassDepth:s,lastPos:o}={regexContext:f.DEFAULT,charClassContext:m.DEFAULT,charClassDepth:0,lastPos:0,...n};le.lastIndex=o;let i;for(;i=le.exec(e);){let{0:a,groups:{groupN:u,enclosedPU:c,enclosedQ:p,intervalQ:E,incompleteT:l}}=i;a==="["?(s++,t=f.CHAR_CLASS,r=m.DEFAULT):a==="]"&&t===f.CHAR_CLASS?(s&&s--,s||(t=f.DEFAULT),r=m.DEFAULT):t===f.CHAR_CLASS?l?r=m.INVALID_INCOMPLETE_TOKEN:a==="-"?r=m.RANGE:c?r=a[1]==="u"?m.ENCLOSED_U:m.ENCLOSED_P:p?r=m.ENCLOSED_Q:(a==="}"&&k.has(r)||r===m.INVALID_INCOMPLETE_TOKEN||r===m.RANGE)&&(r=m.DEFAULT):l?t=f.INVALID_INCOMPLETE_TOKEN:u?t=f.GROUP_NAME:c?t=a[1]==="u"?f.ENCLOSED_U:f.ENCLOSED_P:E?t=f.INTERVAL_QUANTIFIER:(a===">"&&t===f.GROUP_NAME||a==="}"&&(t===f.INTERVAL_QUANTIFIER||q.has(t))||t===f.INVALID_INCOMPLETE_TOKEN)&&(t=f.DEFAULT)}return{regexContext:t,charClassContext:r,charClassDepth:s,lastPos:e.length}}function ce(e,n,t){let r=0;for(let[s]of e.matchAll(new RegExp(`[${ee(n+t,d.CHAR_CLASS)}]`,"g")))if(r+=s===n?1:-1,r<0)return t;return r>0?n:""}function ge(e,n,t,r){let s={raw:[]},o=[],i;return e.raw.forEach((a,u)=>{let c=t(a,{...i,lastPos:0},r);if(s.raw.push(c.transformed),i=c.runningContext,u<e.raw.length-1){let p=n[u];if(p instanceof I){let E=t(p,{...i,lastPos:0},r);o.push(H(E.transformed)),i=E.runningContext}else o.push(p)}}),{template:s,substitutions:o}}function Ee(e){return e.replace(/^\^/,"\\^^")}function K(e){return e.replace(new RegExp(`^([${T}])(?!\\1)`),(n,t,r)=>`\\${n}${r+1===e.length?"":n}`)}function M(e,n){return C(e,String.raw`\\0(?!\d)`,"\\x00",n)}var ke="&!#%,:;<=>@`~",Ge=new RegExp(String.raw`
\[\^?-?
| --?\]
| (?<dp>[${U}])\k<dp>
| (?<dp>[${T}])\k<dp>
| --

@@ -52,8 +52,8 @@ | \\(?<vOnlyEscape>[${ke}])

| \\?.
`.replace(/\s+/g,""),"gsu");function me(e){let t='Invalid unescaped "-" in character class',n=!1,r="";for(let{0:s,groups:{dp:a,vOnlyEscape:i}}of e.matchAll(Ge)){if(s[0]==="["){if(n)throw new Error("Invalid nested character class when flag v not supported; possibly from interpolation");if(s.endsWith("-"))throw new Error(t);n=!0}else if(s.endsWith("]")){if(s[0]==="-")throw new Error(t);n=!1}else if(n){if(s==="&&"||s==="--")throw new Error(`Invalid set operator "${s}" when flag v not supported`);if(a)throw new Error(`Invalid double punctuator "${s}", reserved by flag v`);if("(){}/|".includes(s))throw new Error(`Invalid unescaped "${s}" in character class`);if(i){r+=i;continue}}r+=s}return r}var Me=new RegExp(String.raw`
${b}
`.replace(/\s+/g,""),"gsu");function me(e){let n='Invalid unescaped "-" in character class',t=!1,r="";for(let{0:s,groups:{dp:o,vOnlyEscape:i}}of e.matchAll(Ge)){if(s[0]==="["){if(t)throw new Error("Invalid nested character class when flag v not supported; possibly from interpolation");if(s.endsWith("-"))throw new Error(n);t=!0}else if(s.endsWith("]")){if(s[0]==="-")throw new Error(n);t=!1}else if(t){if(s==="&&"||s==="--")throw new Error(`Invalid set operator "${s}" when flag v not supported`);if(o)throw new Error(`Invalid double punctuator "${s}", reserved by flag v`);if("(){}/|".includes(s))throw new Error(`Invalid unescaped "${s}" in character class`);if(i){r+=i;continue}}r+=s}return r}var Me=new RegExp(String.raw`
${D}
| \(\?<
| (?<backrefNum>\\[1-9]\d*)
| \\?.
`.replace(/\s+/g,""),"gsu");function he(e,t){e=String(e);let n="",r="";for(let{0:s,groups:{backrefNum:a}}of e.matchAll(Me)){n+=s,t=R(n,t);let{regexContext:i}=t;if(i===f.DEFAULT)if(s==="(")r+="(?:";else{if(a)throw new Error(`Invalid decimal escape "${s}" with implicit flag n; replace with named backreference`);r+=s}else r+=s}return{transformed:r,runningContext:t}}var Ce=/^\s$/,ye=/^\\[\s#]$/,te=/^[ \t]$/,ve=/^\\[ \t]$/,Ve=new RegExp(String.raw`
`.replace(/\s+/g,""),"gsu");function he(e,n){e=String(e);let t="",r="";for(let{0:s,groups:{backrefNum:o}}of e.matchAll(Me)){t+=s,n=R(t,n);let{regexContext:i}=n;if(i===f.DEFAULT)if(s==="(")r+="(?:";else{if(o)throw new Error(`Invalid decimal escape "${s}" with implicit flag n; replace with named backreference`);r+=s}else r+=s}return{transformed:r,runningContext:n}}var Ce=/^\s$/,ye=/^\\[\s#]$/,te=/^[ \t]$/,ve=/^\\[ \t]$/,Ve=new RegExp(String.raw`
\\(?: [gk]<

@@ -67,9 +67,9 @@ | [pPu]\{

| \[\^
| ${b}
| ${D}
| \(\?<
| (?<dp>[${U}])\k<dp>
| (?<dp>[${T}])\k<dp>
| --
| \\?.
`.replace(/\s+/g,""),"gsu");function Ae(e,t,n){e=String(e);let r=!1,s=!1,a=!1,i="",o="",u="",c="",p=!1,E=(l,d)=>{let A={prefix:!0,postfix:!1,...d};return l=(p&&A.prefix?"(?:)":"")+l+(A.postfix?"(?:)":""),p=!1,l};for(let{0:l,index:d}of e.matchAll(Ve)){if(a){l===`
`&&(a=!1,p=!0);continue}if(r){if(Ce.test(l))continue;r=!1,p=!0}else if(s){if(te.test(l))continue;s=!1}i+=l,t=R(i,t);let{regexContext:A,charClassContext:h}=t;if(l==="-"&&A===f.CHAR_CLASS&&c===m.RANGE&&(n.flags.includes("v")||n.unicodeSetsPlugin))throw new Error("Invalid unescaped hyphen as the end value for a range");if(A===f.DEFAULT&&/^(?:[?*+]|\?\?)$/.test(l)||A===f.INTERVAL_QUANTIFIER&&l==="{")o+=E(l,{prefix:!1,postfix:u==="("&&l==="?"});else if(A===f.DEFAULT)Ce.test(l)?r=!0:l.startsWith("#")?a=!0:ye.test(l)?o+=E(l[1],{prefix:!1}):o+=E(l);else if(A===f.CHAR_CLASS&&l!=="["&&l!=="[^")if(te.test(l)&&(h===m.DEFAULT||h===m.ENCLOSED_Q||h===m.RANGE))s=!0;else{if(h===m.INVALID_INCOMPLETE_TOKEN)throw new Error(`Invalid incomplete token in character class: "${l}"`);if(ve.test(l)&&(h===m.DEFAULT||h===m.ENCLOSED_Q))o+=E(l[1],{prefix:!1});else if(h===m.DEFAULT){let S=e[d+1]??"",N=M(l);(te.test(S)||l==="^")&&(N=K(N)),o+=E(N)}else o+=E(l)}else o+=E(l);r||s||a||(u=l,c=h)}return{transformed:o,runningContext:t}}function we(e){let t=String.raw`\(\?:\)`;e=C(e,`(?:${t}){2,}`,"(?:)",g.DEFAULT);let n=I.replace(/\$/g,"\\$");return e=C(e,String.raw`(?:${t}(?=[)|.[$\\]|\((?!DEFINE)|$)|(?<=[()|.\]^>]|\\[bBdDfnrsStvwW]|\(\?(?:[:=!]|<[=!])|^)${t}(?![?*+{]))(?!${n})`,"",g.DEFAULT),e}function Se(e,t){let n=Le(e,{includeContents:!0}),r=Qe(e,n,!!t?.useEmulationGroups);return He(r,n)}var je=String.raw`\\g<(?<subroutineName>[^>&]+)>`,y=new RegExp(String.raw`
`.replace(/\s+/g,""),"gsu");function Ae(e,n,t){e=String(e);let r=!1,s=!1,o=!1,i="",a="",u="",c="",p=!1,E=(l,g)=>{let A={prefix:!0,postfix:!1,...g};return l=(p&&A.prefix?"(?:)":"")+l+(A.postfix?"(?:)":""),p=!1,l};for(let{0:l,index:g}of e.matchAll(Ve)){if(o){l===`
`&&(o=!1,p=!0);continue}if(r){if(Ce.test(l))continue;r=!1,p=!0}else if(s){if(te.test(l))continue;s=!1}i+=l,n=R(i,n);let{regexContext:A,charClassContext:h}=n;if(l==="-"&&A===f.CHAR_CLASS&&c===m.RANGE&&(t.flags.includes("v")||t.unicodeSetsPlugin))throw new Error("Invalid unescaped hyphen as the end value for a range");if(A===f.DEFAULT&&/^(?:[?*+]|\?\?)$/.test(l)||A===f.INTERVAL_QUANTIFIER&&l==="{")a+=E(l,{prefix:!1,postfix:u==="("&&l==="?"});else if(A===f.DEFAULT)Ce.test(l)?r=!0:l.startsWith("#")?o=!0:ye.test(l)?a+=E(l[1],{prefix:!1}):a+=E(l);else if(A===f.CHAR_CLASS&&l!=="["&&l!=="[^")if(te.test(l)&&(h===m.DEFAULT||h===m.ENCLOSED_Q||h===m.RANGE))s=!0;else{if(h===m.INVALID_INCOMPLETE_TOKEN)throw new Error(`Invalid incomplete token in character class: "${l}"`);if(ve.test(l)&&(h===m.DEFAULT||h===m.ENCLOSED_Q))a+=E(l[1],{prefix:!1});else if(h===m.DEFAULT){let S=e[g+1]??"",N=M(l);(te.test(S)||l==="^")&&(N=K(N)),a+=E(N)}else a+=E(l)}else a+=E(l);r||s||o||(u=l,c=h)}return{transformed:a,runningContext:n}}function we(e){let n=String.raw`\(\?:\)`;e=C(e,`(?:${n}){2,}`,"(?:)",d.DEFAULT);let t=x.replace(/\$/g,"\\$");return e=C(e,String.raw`(?:${n}(?=[)|.[$\\]|\((?!DEFINE)|$)|(?<=[()|.\]^>]|\\[bBdDfnrsStvwW]|\(\?(?:[:=!]|<[=!])|^)${n}(?![?*+{]))(?!${t})`,"",d.DEFAULT),e}function Se(e,n){let t=Ie(e,{includeContents:!0}),r=Qe(e,t,!!n?.useEmulationGroups);return He(r,t)}var je=String.raw`\\g<(?<subroutineName>[^>&]+)>`,y=new RegExp(String.raw`
${je}

@@ -80,3 +80,3 @@ | (?<capturingStart>${W})

| \\?.
`.replace(/\s+/g,""),"gsu");function Qe(e,t,n){if(!/\\g</.test(e))return e;let r=j(e,"\\\\(?:[1-9]|k<[^>]+>)",g.DEFAULT),s=r?`(${n?I:""}`:"(?:",a=new Map,i=[],o=[0],u=0,c=0,p=0,E=0,l=0,d=e,A;for(y.lastIndex=0;A=y.exec(d);){let{0:h,index:S,groups:{subroutineName:N,capturingStart:z,backrefNum:F,backrefName:v}}=A;if(h==="[")l++;else if(l)h==="]"&&l--;else if(N){if(!t.has(N))throw new Error(`Invalid named capture referenced by subroutine ${h}`);if(a.has(N))throw new Error(`Subroutine ${h} followed a recursive reference`);let w=t.get(N).contents,D=`${s}${w})`;r&&(p=0,c++),a.set(N,{unclosedGroupCount:qe(D)}),i.push(N),d=T(d,S,h,D),y.lastIndex-=h.length-s.length}else if(z)a.size?(r&&(p++,c++),h!=="("&&(d=T(d,S,h,s),y.lastIndex-=h.length-s.length)):r&&(o.push(re(o)+1+c-E),E=c,u++);else if((F||v)&&a.size){let w=F?+F:t.get(v)?.groupNum,D=!1;for(let $ of i){let _=t.get($);if(w>=_.groupNum&&w<=_.groupNum+_.numCaptures){D=!0;break}}if(D){let $=t.get(re(i)),_=u+c-p,O=`\\k<$$b${w}s${_}r${$.groupNum}c${$.numCaptures}>`;d=T(d,S,h,O),y.lastIndex+=O.length-h.length}}else if(h===")"&&a.size){let w=a.get(re(i));w.unclosedGroupCount--,w.unclosedGroupCount||a.delete(i.pop())}}return r&&(d=C(d,String.raw`\\(?:(?<bNum>[1-9]\d*)|k<\$\$b(?<bNumSub>\d+)s(?<subNum>\d+)r(?<refNum>\d+)c(?<refCaps>\d+)>)`,({0:h,groups:{bNum:S,bNumSub:N,subNum:z,refNum:F,refCaps:v}})=>{if(S){let O=+S;if(O>o.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${o[O]}`}let w=+N,D=+z,$=+F,_=+v;return w<$||w>$+_?`\\${o[w]}`:`\\${D-$+w}`},g.DEFAULT)),d}var ne=new RegExp(String.raw`${B}|\(\?:\)|(?<invalid>\\?.)`,"gsu");function He(e,t){let n=V(e,String.raw`\(\?\(DEFINE\)`,0,g.DEFAULT);if(!n)return e;let r=Ne(e,n);if(r.afterPos<e.length)throw new Error("DEFINE group allowed only at the end of a regex");if(r.afterPos>e.length)throw new Error("DEFINE group is unclosed");let s;for(ne.lastIndex=0;s=ne.exec(r.contents);){let{captureName:a,invalid:i}=s.groups;if(a){let o=Ne(r.contents,s),u;if(!t.get(a).isUnique)u=a;else{let c=Le(o.contents,{includeContents:!1});for(let p of c.keys())if(!t.get(p).isUnique){u=p;break}}if(u)throw new Error(`Duplicate group name "${u}" within DEFINE`);ne.lastIndex=o.afterPos}else if(i)throw new Error("DEFINE group includes unsupported syntax at top level")}return e.slice(0,n.index)}function qe(e){let t=0;return P(e,"\\(",()=>t++,g.DEFAULT),t}function Be(e,t){let n=0,r=0,s;for(;s=V(e,W,r,g.DEFAULT);){let{0:a,index:i,groups:{captureName:o}}=s;if(n++,o===t)break;r=i+a.length}return n}function Ne(e,t){let n=t.index+t[0].length,r=J(e,n),s=n+r.length+1;return{contents:r,afterPos:s}}function Le(e,{includeContents:t}){let n=new Map;return P(e,B,({0:r,index:s,groups:{captureName:a}})=>{if(n.has(a))n.get(a).isUnique=!1;else{let i={isUnique:!0};if(t){let o=J(e,s+r.length);Object.assign(i,{contents:o,groupNum:Be(e,a),numCaptures:x(o)})}n.set(a,i)}},g.DEFAULT),n}function re(e){return e[e.length-1]}var We=(e,...t)=>{if(Array.isArray(e?.raw))return se({},e,...t);if((typeof e=="string"||e===void 0)&&!t.length)return se.bind(null,{flags:e??""});if({}.toString.call(e)==="[object Object]"&&!t.length)return se.bind(null,e);throw new Error(`Unexpected arguments: ${JSON.stringify([e,...t])}`)},se=(e,t,...n)=>{let r=$e(e),s=Ie(t,n,r),a=0,i="",o;s.template.raw.forEach((u,c)=>{let p=!!(s.template.raw[c]||s.template.raw[c+1]);a+=x(u),i+=M(u,g.CHAR_CLASS),o=R(i,o);let{regexContext:E,charClassContext:l}=o;if(c<s.template.raw.length-1){let d=s.substitutions[c];i+=ze(d,r.flags,E,l,p,a),d instanceof RegExp?a+=x(d.source):d instanceof L&&(a+=x(String(d)))}}),i=De(i,r);try{return r.subclass?new Q(i,r.flags,{useEmulationGroups:!0}):new RegExp(i,r.flags)}catch(u){let c=u.message.replace(/ \/.+\/[a-z]*:/,"");throw u.message=`${c}: /${i}/${r.flags}`,u}};function Ke(e="",t){let n=$e(t);if(n.subclass)throw new Error("Cannot use option subclass");return{expression:De(Ie({raw:[e]},[],n).template.raw[0],n),flags:n.flags}}function $e(e){let t={flags:"",subclass:!1,plugins:[],unicodeSetsPlugin:me,disable:{},force:{},...e};if(/[nuvx]/.test(t.flags))throw new Error("Implicit flags v/u/x/n cannot be explicitly added");let n=t.force.v||(t.disable.v?!1:fe);return t.flags+=n?"v":"u",n&&(t.unicodeSetsPlugin=null),t}function Ie(e,t,n){let r=[];n.disable.x||r.push(Ae),n.disable.n||r.push(he);for(let s of r)({template:e,substitutions:t}=de(e,t,s,n));return{template:e,substitutions:t}}function De(e,t){let{flags:n,plugins:r,unicodeSetsPlugin:s,disable:a,subclass:i}=t;return[...r,...a.subroutines?[]:[Se],...a.atomic?[]:[ue,ae],...a.x?[]:[we],...s?[s]:[]].forEach(o=>e=o(e,{flags:n,useEmulationGroups:i})),e}function ze(e,t,n,r,s,a){if(e instanceof RegExp&&n!==f.DEFAULT)throw new Error("Cannot interpolate a RegExp at this position because the syntax context does not match");if(n===f.INVALID_INCOMPLETE_TOKEN||r===m.INVALID_INCOMPLETE_TOKEN)throw new Error("Interpolation preceded by invalid incomplete token");if(typeof e=="number"&&(n===f.ENCLOSED_U||r===m.ENCLOSED_U))return e.toString(16);let i=e instanceof L,o="";if(!(e instanceof RegExp)){e=String(e),i||(o=ee(e,n===f.CHAR_CLASS?g.CHAR_CLASS:g.DEFAULT));let u=ge(o||e,n,r);if(u)throw new Error(`Unescaped stray "${u}" in the interpolated value would have side effects outside it`)}if(n===f.INTERVAL_QUANTIFIER||n===f.GROUP_NAME||q.has(n)||k.has(r))return i?String(e):o;if(n===f.CHAR_CLASS){if(i){if(j(String(e),"^-|^&&|-$|&&$"))throw new Error("Cannot use range or set operator at boundary of interpolated pattern; move the operation into the pattern or the operator outside of it");let u=Ee(K(e));return Y(e)?`[${u}]`:M(u)}return Y(o)?`[${o}]`:o}if(e instanceof RegExp){let u=Ze(e,t),c=pe(u.value,a);return u.usedModifier?c:`(?:${c})`}return i?`(?:${e})`:s?`(?:${o})`:o}function Ze(e,t){let n={i:null,m:null,s:null},r="\\n\\r\\u2028\\u2029",s=e.source;if(e.ignoreCase!==t.includes("i"))if(G)n.i=e.ignoreCase;else throw new Error("Pattern modifiers not supported, so flag i on the outer and interpolated regex must match");if(e.dotAll!==t.includes("s")&&(G?n.s=e.dotAll:s=C(s,"\\.",e.dotAll?"[^]":`[^${r}]`,g.DEFAULT)),e.multiline!==t.includes("m")&&(G?n.m=e.multiline:(s=C(s,"\\^",e.multiline?`(?<=^|[${r}])`:"(?<![^])",g.DEFAULT),s=C(s,"\\$",e.multiline?`(?=$|[${r}])`:"(?![^])",g.DEFAULT))),G){let a=Object.keys(n),i=a.filter(u=>n[u]===!0).join(""),o=a.filter(u=>n[u]===!1).join("");if(o&&(i+=`-${o}`),i)return{value:`(?${i}:${s})`,usedModifier:!0}}return{value:s}}return Re(Je);})();
`.replace(/\s+/g,""),"gsu");function Qe(e,n,t){if(!/\\g</.test(e))return e;let r=j(e,"\\\\(?:[1-9]|k<[^>]+>)",d.DEFAULT),s=r?`(${t?x:""}`:"(?:",o=new Map,i=[],a=[0],u=0,c=0,p=0,E=0,l=0,g=e,A;for(y.lastIndex=0;A=y.exec(g);){let{0:h,index:S,groups:{subroutineName:N,capturingStart:z,backrefNum:F,backrefName:v}}=A;if(h==="[")l++;else if(l)h==="]"&&l--;else if(N){if(!n.has(N))throw new Error(`Invalid named capture referenced by subroutine ${h}`);if(o.has(N))throw new Error(`Subroutine ${h} followed a recursive reference`);let w=n.get(N).contents,$=`${s}${w})`;r&&(p=0,c++),o.set(N,{unclosedGroupCount:qe($)}),i.push(N),g=b(g,S,h,$),y.lastIndex-=h.length-s.length}else if(z)o.size?(r&&(p++,c++),h!=="("&&(g=b(g,S,h,s),y.lastIndex-=h.length-s.length)):r&&(a.push(re(a)+1+c-E),E=c,u++);else if((F||v)&&o.size){let w=F?+F:n.get(v)?.groupNum,$=!1;for(let L of i){let _=n.get(L);if(w>=_.groupNum&&w<=_.groupNum+_.numCaptures){$=!0;break}}if($){let L=n.get(re(i)),_=u+c-p,O=`\\k<$$b${w}s${_}r${L.groupNum}c${L.numCaptures}>`;g=b(g,S,h,O),y.lastIndex+=O.length-h.length}}else if(h===")"&&o.size){let w=o.get(re(i));w.unclosedGroupCount--,w.unclosedGroupCount||o.delete(i.pop())}}return r&&(g=C(g,String.raw`\\(?:(?<bNum>[1-9]\d*)|k<\$\$b(?<bNumSub>\d+)s(?<subNum>\d+)r(?<refNum>\d+)c(?<refCaps>\d+)>)`,({0:h,groups:{bNum:S,bNumSub:N,subNum:z,refNum:F,refCaps:v}})=>{if(S){let O=+S;if(O>a.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${a[O]}`}let w=+N,$=+z,L=+F,_=+v;return w<L||w>L+_?`\\${a[w]}`:`\\${$-L+w}`},d.DEFAULT)),g}var ne=new RegExp(String.raw`${B}|\(\?:\)|(?<invalid>\\?.)`,"gsu");function He(e,n){let t=V(e,String.raw`\(\?\(DEFINE\)`,0,d.DEFAULT);if(!t)return e;let r=Ne(e,t);if(r.afterPos<e.length)throw new Error("DEFINE group allowed only at the end of a regex");if(r.afterPos>e.length)throw new Error("DEFINE group is unclosed");let s;for(ne.lastIndex=0;s=ne.exec(r.contents);){let{captureName:o,invalid:i}=s.groups;if(o){let a=Ne(r.contents,s),u;if(!n.get(o).isUnique)u=o;else{let c=Ie(a.contents,{includeContents:!1});for(let p of c.keys())if(!n.get(p).isUnique){u=p;break}}if(u)throw new Error(`Duplicate group name "${u}" within DEFINE`);ne.lastIndex=a.afterPos}else if(i)throw new Error("DEFINE group includes unsupported syntax at top level")}return e.slice(0,t.index)}function qe(e){let n=0;return P(e,"\\(",()=>n++,d.DEFAULT),n}function Be(e,n){let t=0,r=0,s;for(;s=V(e,W,r,d.DEFAULT);){let{0:o,index:i,groups:{captureName:a}}=s;if(t++,a===n)break;r=i+o.length}return t}function Ne(e,n){let t=n.index+n[0].length,r=J(e,t),s=t+r.length+1;return{contents:r,afterPos:s}}function Ie(e,{includeContents:n}){let t=new Map;return P(e,B,({0:r,index:s,groups:{captureName:o}})=>{if(t.has(o))t.get(o).isUnique=!1;else{let i={isUnique:!0};if(n){let a=J(e,s+r.length);Object.assign(i,{contents:a,groupNum:Be(e,o),numCaptures:U(a)})}t.set(o,i)}},d.DEFAULT),t}function re(e){return e[e.length-1]}var We=(e,...n)=>{if(Array.isArray(e?.raw))return se({},e,...n);if((typeof e=="string"||e===void 0)&&!n.length)return se.bind(null,{flags:e??""});if({}.toString.call(e)==="[object Object]"&&!n.length)return se.bind(null,e);throw new Error(`Unexpected arguments: ${JSON.stringify([e,...n])}`)},se=(e,n,...t)=>{let r=Le(e),s=$e(n,t,r),o=0,i="",a;s.template.raw.forEach((u,c)=>{let p=!!(s.template.raw[c]||s.template.raw[c+1]);o+=U(u),i+=M(u,d.CHAR_CLASS),a=R(i,a);let{regexContext:E,charClassContext:l}=a;if(c<s.template.raw.length-1){let g=s.substitutions[c];i+=ze(g,r.flags,E,l,p,o),g instanceof RegExp?o+=U(g.source):g instanceof I&&(o+=U(String(g)))}}),i=_e(i,r);try{return r.subclass?new Q(i,r.flags,{useEmulationGroups:!0}):new RegExp(i,r.flags)}catch(u){let c=u.message.replace(/ \/.+\/[a-z]*:/,"");throw u.message=`${c}: /${i}/${r.flags}`,u}};function Ke(e="",n){let t=Le(n);if(t.subclass)throw new Error("Cannot use option subclass");return{expression:_e($e({raw:[e]},[],t).template.raw[0],t),flags:t.flags}}function Le(e){let n={flags:"",subclass:!1,plugins:[],unicodeSetsPlugin:me,disable:{},force:{},...e};if(/[nuvx]/.test(n.flags))throw new Error("Implicit flags v/u/x/n cannot be explicitly added");let t=n.force.v||(n.disable.v?!1:fe);return n.flags+=t?"v":"u",t&&(n.unicodeSetsPlugin=null),n}function $e(e,n,t){let r=[];t.disable.x||r.push(Ae),t.disable.n||r.push(he);for(let s of r)({template:e,substitutions:n}=ge(e,n,s,t));return{template:e,substitutions:n}}function _e(e,n){let{flags:t,plugins:r,unicodeSetsPlugin:s,disable:o,subclass:i}=n;return[...r,...o.subroutines?[]:[Se],...o.atomic?[]:[ue,ae],...o.x?[]:[we],...s?[s]:[]].forEach(a=>e=a(e,{flags:t,useEmulationGroups:i})),e}function ze(e,n,t,r,s,o){if(e instanceof RegExp&&t!==f.DEFAULT)throw new Error("Cannot interpolate a RegExp at this position because the syntax context does not match");if(t===f.INVALID_INCOMPLETE_TOKEN||r===m.INVALID_INCOMPLETE_TOKEN)throw new Error("Interpolation preceded by invalid incomplete token");if(typeof e=="number"&&(t===f.ENCLOSED_U||r===m.ENCLOSED_U))return e.toString(16);let i=e instanceof I,a="";if(!(e instanceof RegExp)){e=String(e),i||(a=ee(e,t===f.CHAR_CLASS?d.CHAR_CLASS:d.DEFAULT));let u=de(a||e,t,r);if(u)throw new Error(`Unescaped stray "${u}" in the interpolated value would have side effects outside it`)}if(t===f.INTERVAL_QUANTIFIER||t===f.GROUP_NAME||q.has(t)||k.has(r))return i?String(e):a;if(t===f.CHAR_CLASS){if(i){if(j(String(e),"^-|^&&|-$|&&$"))throw new Error("Cannot use range or set operator at boundary of interpolated pattern; move the operation into the pattern or the operator outside of it");let u=Ee(K(e));return Y(e)?`[${u}]`:M(u)}return Y(a)?`[${a}]`:a}if(e instanceof RegExp){let u=Ze(e,n),c=pe(u.value,o);return u.usedModifier?c:`(?:${c})`}return i?`(?:${e})`:s?`(?:${a})`:a}function Ze(e,n){let t={i:null,m:null,s:null},r="\\n\\r\\u2028\\u2029",s=e.source;if(e.ignoreCase!==n.includes("i"))if(G)t.i=e.ignoreCase;else throw new Error("Pattern modifiers not supported, so flag i on the outer and interpolated regex must match");if(e.dotAll!==n.includes("s")&&(G?t.s=e.dotAll:s=C(s,"\\.",e.dotAll?"[^]":`[^${r}]`,d.DEFAULT)),e.multiline!==n.includes("m")&&(G?t.m=e.multiline:(s=C(s,"\\^",e.multiline?`(?<=^|[${r}])`:"(?<![^])",d.DEFAULT),s=C(s,"\\$",e.multiline?`(?=$|[${r}])`:"(?![^])",d.DEFAULT))),G){let o=Object.keys(t),i=o.filter(u=>t[u]===!0).join(""),a=o.filter(u=>t[u]===!1).join("");if(a&&(i+=`-${a}`),i)return{value:`(?${i}:${s})`,usedModifier:!0}}return{value:s}}return Re(Je);})();
//# sourceMappingURL=regex.min.js.map
{
"name": "regex",
"version": "5.0.2",
"version": "5.1.0",
"description": "Regex template tag with extended syntax, context-aware interpolation, and always-on best practices",

@@ -27,2 +27,14 @@ "author": "Steven Levithan",

"types": "./dist/cjs/regex.d.ts",
"scripts": {
"bundle:global": "esbuild src/regex.js --global-name=Regex --bundle --minify --sourcemap --outfile=dist/regex.min.js",
"bundle:esm": "esbuild src/regex.js --format=esm --bundle --sourcemap --outfile=dist/esm/regex.js",
"bundle:cjs": "esbuild src/regex.js --format=cjs --bundle --sourcemap --outfile=dist/cjs/regex.js",
"types": "tsc src/regex.js src/internals.js --rootDir src --declaration --allowJs --emitDeclarationOnly --outDir types",
"prebuild": "rm -rf dist/* types/*",
"build": "pnpm run bundle:global && pnpm run bundle:esm && pnpm run bundle:cjs && pnpm run types",
"postbuild": "node scripts/postbuild.js",
"pretest": "pnpm run build",
"test": "jasmine && tsc --project spec/types/tsconfig.test.json && attw --pack . --entrypoints .",
"prepublishOnly": "pnpm test"
},
"files": [

@@ -44,19 +56,8 @@ "dist",

"devDependencies": {
"@arethetypeswrong/cli": "~0.17.0",
"esbuild": "^0.24.0",
"@arethetypeswrong/cli": "~0.17.2",
"esbuild": "^0.24.2",
"expect-type": "^1.1.0",
"jasmine": "^5.4.0",
"typescript": "~5.6.3"
},
"scripts": {
"bundle:global": "esbuild src/regex.js --global-name=Regex --bundle --minify --sourcemap --outfile=dist/regex.min.js",
"bundle:esm": "esbuild src/regex.js --format=esm --bundle --sourcemap --outfile=dist/esm/regex.js",
"bundle:cjs": "esbuild src/regex.js --format=cjs --bundle --sourcemap --outfile=dist/cjs/regex.js",
"types": "tsc src/regex.js src/internals.js --rootDir src --declaration --allowJs --emitDeclarationOnly --outDir types",
"prebuild": "rm -rf dist/* types/*",
"build": "pnpm run bundle:global && pnpm run bundle:esm && pnpm run bundle:cjs && pnpm run types",
"postbuild": "node scripts/postbuild.js",
"pretest": "pnpm run build",
"test": "jasmine && tsc --project spec/types/tsconfig.test.json && attw --pack . --entrypoints ."
"jasmine": "^5.5.0",
"typescript": "~5.7.2"
}
}
}

@@ -17,3 +17,3 @@ <div align="center">

Highlights include support for insignificant whitespace, comments, atomic groups and possessive quantifiers that can help you avoid [ReDoS](https://en.wikipedia.org/wiki/ReDoS), subroutines and subroutine definition groups that enable powerful subpattern composition, and context-aware interpolation of regexes, escaped strings, and partial patterns.
Highlights include support for insignificant whitespace and comments, atomic groups and possessive quantifiers (that can help you avoid [ReDoS](https://en.wikipedia.org/wiki/ReDoS)), subroutines and subroutine definition groups (that enable powerful subpattern composition), and context-aware interpolation of regexes, escaped strings, and partial patterns.

@@ -55,16 +55,21 @@ With the Regex+ library, JavaScript steps up as one of the best regex flavors alongside PCRE and Perl, possibly surpassing C++, Java, .NET, Python, and Ruby.

- **A modern regex baseline** so you don't need to continually opt-in to best practices.
- Always-on flag <kbd>v</kbd> gives you the best level of Unicode support and strict errors.
- New flags:
- Always-on flag <kbd>x</kbd> allows you to freely add whitespace and comments to your regexes.
- Always-on flag <kbd>n</kbd> (*named capture only* mode) improves regex readability and efficiency.
- No unreadable escaped backslashes `\\\\` since it's a raw string template tag.
- **Extended regex syntax**.
- Atomic groups and possessive quantifiers can dramatically improve performance and prevent ReDoS.
- Subroutines and definition groups enable powerful composition, improving readability and maintainability.
- Recursive matching is enabled by a plugin.
- **Context-aware and safe interpolation** of regexes, strings, and partial patterns.
- Interpolated strings have their special characters escaped.
- Interpolated regexes locally preserve the meaning of their own flags (or their absense), and their numbered backreferences are adjusted to work within the overall pattern.
**A modern regex baseline** so you don't need to continually opt-in to best practices.
- Always-on flag <kbd>v</kbd> gives you the best level of Unicode support and strict errors.
- New flags:
- Always-on flag <kbd>x</kbd> allows you to freely add whitespace and comments to your regexes.
- Always-on flag <kbd>n</kbd> (*named capture only* mode) improves regex readability and efficiency.
- No unreadable escaped backslashes `\\\\` since it's a raw string template tag.
**Extended regex syntax**.
- Atomic groups and possessive quantifiers can dramatically improve performance and prevent ReDoS.
- Subroutines and definition groups enable powerful composition, improving readability and maintainability.
- Recursive matching via an official plugin.
**Context-aware and safe interpolation** of regexes, strings, and partial patterns.
- Interpolated strings have their special characters escaped.
- Interpolated regexes locally preserve the meaning of their own flags (or their absense), and their numbered backreferences are adjusted to work within the overall pattern.
## 🕹️ Install and use

@@ -188,3 +193,3 @@

Consider `` regex`(?>a+)ab` `` vs `` regex`(a+)ab` ``. The former (with an atomic group) doesn't match `'aaaab'`, but the latter does. The former doesn't match because:
Consider `` regex`(?>a+)ab` `` vs `` regex`(?:a+)ab` ``. The former (with an atomic group) doesn't match `'aaaab'`, but the latter does. The former doesn't match because:

@@ -228,3 +233,3 @@ - The regex engine starts by using the greedy `a+` within the atomic group to match all the `a`s in the target string.

Possessive quantifiers are created by adding `+` to any quantifier, and they're similar to greedy quantifiers except they don't allow backtracking. Although greedy quantifiers start out by matching as much as possible, if the remainder of the regex doesn't find a match, the regex engine will backtrack and try all permutations of how many times the quantifier should repeat. Possessive quantifiers prevent the regex engine from doing this.
Possessive quantifiers are created by adding `+` to a quantifier, and they're similar to greedy quantifiers except they don't allow backtracking. Although greedy quantifiers start out by matching as much as possible, if the remainder of the regex doesn't find a match, the regex engine will backtrack and try all permutations of how many times the quantifier should repeat. Possessive quantifiers prevent the regex engine from doing this.

@@ -472,3 +477,3 @@ > Possessive quantifiers are syntactic sugar for [atomic groups](#atomic-groups) when their contents are a single repeated item (which could be a token, character class, or group).

> [!NOTE]
> Flag <kbd>n</kbd> is based on .NET, C++, PCRE, Perl, and XRegExp, which share the <kbd>n</kbd> flag letter but call it *explicit capture*, *no auto capture*, or *nosubs*. In `regex`, flag <kbd>n</kbd> also prevents using numbered backreferences to refer to named groups in the outer regex, which follows the behavior of C++ (Ruby also always prevents this, despite not having flag <kbd>n</kbd>). Referring to named groups by number is a footgun, and the way that named groups are numbered is inconsistent across regex flavors.
> Flag <kbd>n</kbd> is based on .NET, C++, Oniguruma, PCRE, Perl, and XRegExp. It's not always specified by a flag, but where it can be (.NET, PCRE, Perl, XRegExp) it's always <kbd>n</kbd>. The option is variously called *explicit capture*, *no auto capture*, *don't capture group*, or *nosubs*. In Regex+, flag <kbd>n</kbd> also prevents using numbered backreferences to refer to named groups, which follows the behavior of C++ and the default handling of Oniguruma and Ruby. Referring to named groups by number is a footgun, and the way that named groups are numbered is inconsistent across regex flavors.

@@ -776,3 +781,3 @@ ## 🧩 Interpolation

Function `rewrite` returns an object with properties `expression` and `flags` as strings, rather than returning a `RegExp` instance. This can be useful for tools that want to process the output.
Function `rewrite` returns an object with properties `expression` and `flags` as strings, rather than returning a `RegExp` instance. This can be useful when you want to apply postprocessing to the output.

@@ -779,0 +784,0 @@ ```js

export {atomic, possessive} from './atomic.js';
export {RegExpSubclass} from './subclass.js';
export {emulationGroupMarker, RegExpSubclass} from './subclass.js';

@@ -7,2 +7,6 @@ import {Context, replaceUnescaped} from 'regex-utilities';

const emulationGroupMarker = '$E$';
// Note: Emulation groups with transfer are also supported. They look like `($N$E$…)` where `N` is
// an integer 1 or greater. They're not used directly by Regex+ but can be used by plugins and
// libraries that use Regex+ internals. Emulation groups with transfer are not only excluded from
// match results, but additionally transfer their match to the group specified by `N`

@@ -14,9 +18,17 @@ /**

class RegExpSubclass extends RegExp {
// Avoid `#private` to allow for subclassing
/**
Avoid `#private` to allow for subclassing.
@private
@type {Array<boolean> | undefined}
@type {Array<{
exclude: boolean;
transfer?: number;
}> | undefined}
*/
_captureMap;
/**
@private
@type {Record<number, string> | undefined}
*/
_namesByIndex;
/**
@param {string | RegExpSubclass} expression

@@ -28,15 +40,13 @@ @param {string} [flags]

if (expression instanceof RegExp && options) {
throw new Error('Cannot provide options when copying regexp');
throw new Error('Cannot provide options when copying a regexp');
}
let captureMap;
if (options?.useEmulationGroups) {
({expression, captureMap} = unmarkEmulationGroups(expression));
}
super(expression, flags);
if (captureMap) {
this._captureMap = captureMap;
const useEmulationGroups = !!options?.useEmulationGroups;
const unmarked = useEmulationGroups ? unmarkEmulationGroups(expression) : null;
super(unmarked?.expression || expression, flags);
// The third argument `options` isn't provided when regexes are copied as part of the internal
// handling of string methods `matchAll` and `split`
} else if (expression instanceof RegExpSubclass) {
this._captureMap = expression._captureMap;
const src = useEmulationGroups ? unmarked : (expression instanceof RegExpSubclass ? expression : null);
if (src) {
this._captureMap = src._captureMap;
this._namesByIndex = src._namesByIndex;
}

@@ -64,3 +74,18 @@ }

for (let i = 1; i < matchCopy.length; i++) {
if (this._captureMap[i]) {
if (this._captureMap[i].exclude) {
const transfer = this._captureMap[i].transfer;
if (transfer && match.length > transfer) {
match[transfer] = matchCopy[i];
const transferName = this._namesByIndex[transfer];
if (transferName) {
match.groups[transferName] = matchCopy[i];
if (this.hasIndices) {
match.indices.groups[transferName] = indicesCopy[i];
}
}
if (this.hasIndices) {
match.indices[transfer] = indicesCopy[i];
}
}
} else {
match.push(matchCopy[i]);

@@ -77,20 +102,37 @@ if (this.hasIndices) {

/**
Build the capturing group map (with emulation groups marked as `false` to indicate their submatches
shouldn't appear in results), and remove the markers for anonymous captures which were added to
emulate extended syntax.
Build the capturing group map (with emulation groups marked to indicate their submatches shouldn't
appear in results), and remove the markers for captures that were added to emulate extended syntax.
@param {string} expression
@returns {{expression: string; captureMap: Array<boolean>;}}
@returns {{
_captureMap: Array<{
exclude: boolean;
transfer?: number;
}>;
_namesByIndex: Record<number, string>;
expression: string;
}}
*/
function unmarkEmulationGroups(expression) {
const marker = emulationGroupMarker.replace(/\$/g, '\\$');
const captureMap = [true];
const _captureMap = [{exclude: false}];
const _namesByIndex = {0: ''};
let captureNum = 0;
expression = replaceUnescaped(
expression,
String.raw`\((?:(?!\?)|\?<(?![=!])[^>]+>)(?<mark>${marker})?`,
({0: m, groups: {mark}}) => {
String.raw`\((?:(?!\?)|\?<(?![=!])(?<name>[^>]+)>)(?<mark>(?:\$(?<transfer>[1-9]\d*))?${marker})?`,
({0: m, groups: {name, mark, transfer}}) => {
captureNum++;
if (name) {
_namesByIndex[captureNum] = name;
}
if (mark) {
captureMap.push(false);
return m.slice(0, -emulationGroupMarker.length);
_captureMap.push({
exclude: true,
transfer: transfer && +transfer,
});
return m.slice(0, -mark.length);
}
captureMap.push(true);
_captureMap.push({
exclude: false,
});
return m;

@@ -101,3 +143,4 @@ },

return {
captureMap,
_captureMap,
_namesByIndex,
expression,

@@ -104,0 +147,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc