🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@jsep-plugin/regex

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsep-plugin/regex - npm Package Compare versions

Comparing version

to
1.0.2

12

dist/cjs/index.cjs.js
'use strict';
const FSLASH_CODE = 47; // '/'
const BSLASH_CODE = 92; // '\\'

@@ -14,4 +15,5 @@ var index = {

let inCharSet = false;
while (this.index < this.expr.length) {
if (this.char === '/') {
if (this.code === FSLASH_CODE && !inCharSet) {
const pattern = this.expr.slice(patternIndex, this.index);

@@ -50,3 +52,9 @@

}
this.index += 1;
if (this.code === jsep.OBRACK_CODE) {
inCharSet = true;
}
else if (inCharSet && this.code === jsep.CBRACK_CODE) {
inCharSet = false;
}
this.index += this.code === BSLASH_CODE ? 2 : 1;
}

@@ -53,0 +61,0 @@ this.throwError('Unclosed Regex');

2

dist/cjs/index.cjs.min.js

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

"use strict";var e={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;for(;this.index<this.expr.length;){if("/"===this.char){const s=this.expr.slice(i,this.index);let r,o="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;o+=this.char}try{r=new RegExp(s,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:r,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.index+=1}this.throwError("Unclosed Regex")}}))}};module.exports=e;
"use strict";var e={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;let s=!1;for(;this.index<this.expr.length;){if(47===this.code&&!s){const s=this.expr.slice(i,this.index);let o,h="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;h+=this.char}try{o=new RegExp(s,h)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}};module.exports=e;
//# sourceMappingURL=index.cjs.min.js.map
{
"type": "commonjs"
}

@@ -5,2 +5,3 @@ var index = (function () {

const FSLASH_CODE = 47; // '/'
const BSLASH_CODE = 92; // '\\'

@@ -16,4 +17,5 @@ var index = {

let inCharSet = false;
while (this.index < this.expr.length) {
if (this.char === '/') {
if (this.code === FSLASH_CODE && !inCharSet) {
const pattern = this.expr.slice(patternIndex, this.index);

@@ -52,3 +54,9 @@

}
this.index += 1;
if (this.code === jsep.OBRACK_CODE) {
inCharSet = true;
}
else if (inCharSet && this.code === jsep.CBRACK_CODE) {
inCharSet = false;
}
this.index += this.code === BSLASH_CODE ? 2 : 1;
}

@@ -55,0 +63,0 @@ this.throwError('Unclosed Regex');

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

var index=function(){"use strict";return{name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;for(;this.index<this.expr.length;){if("/"===this.char){const n=this.expr.slice(i,this.index);let r,s="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;s+=this.char}try{r=new RegExp(n,s)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:r,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.index+=1}this.throwError("Unclosed Regex")}}))}}}();
var index=function(){"use strict";return{name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;let s=!1;for(;this.index<this.expr.length;){if(47===this.code&&!s){const s=this.expr.slice(i,this.index);let o,n="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;n+=this.char}try{o=new RegExp(s,n)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}}}();
//# sourceMappingURL=index.iife.min.js.map
const FSLASH_CODE = 47; // '/'
const BSLASH_CODE = 92; // '\\'

@@ -12,4 +13,5 @@ var index = {

let inCharSet = false;
while (this.index < this.expr.length) {
if (this.char === '/') {
if (this.code === FSLASH_CODE && !inCharSet) {
const pattern = this.expr.slice(patternIndex, this.index);

@@ -48,3 +50,9 @@

}
this.index += 1;
if (this.code === jsep.OBRACK_CODE) {
inCharSet = true;
}
else if (inCharSet && this.code === jsep.CBRACK_CODE) {
inCharSet = false;
}
this.index += this.code === BSLASH_CODE ? 2 : 1;
}

@@ -51,0 +59,0 @@ this.throwError('Unclosed Regex');

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

var e={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;for(;this.index<this.expr.length;){if("/"===this.char){const s=this.expr.slice(i,this.index);let r,h="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;h+=this.char}try{r=new RegExp(s,h)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:r,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.index+=1}this.throwError("Unclosed Regex")}}))}};export{e as default};
var e={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;let s=!1;for(;this.index<this.expr.length;){if(47===this.code&&!s){const s=this.expr.slice(i,this.index);let o,h="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;h+=this.char}try{o=new RegExp(s,h)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}};export{e as default};
//# sourceMappingURL=index.min.js.map
{
"name": "@jsep-plugin/regex",
"version": "1.0.1",
"version": "1.0.2",
"description": "Adds regex expression support",

@@ -5,0 +5,0 @@ "author": "Shelly (https://github.com/6utt3rfly)",

@@ -0,0 +0,0 @@ [npm]: https://img.shields.io/npm/v/@jsep-plugin/regex

import * as jsep from 'jsep';
export const name: string;
export function init(this: typeof jsep): void;

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet