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

regexp-support

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regexp-support - npm Package Compare versions

Comparing version

to
1.0.13

42

lib/proto/static.js

@@ -6,2 +6,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
* Created by user on 2018/4/28/028.
*/
const index_1 = require("../index");
exports.REGEXP_STATIC = {

@@ -32,6 +36,40 @@ $1: false,

function testStatic(RegExpClass = RegExp) {
let r = RegExpClass;
let rc = RegExpClass;
let re = index_1.createRegExp('(wor)(ld)', 'g', RegExpClass);
re.test('hello world!');
return Object.keys(exports.REGEXP_STATIC)
.reduce(function (a, b) {
a[b] = (b in r);
a[b] = (b in rc);
if (a[b]) {
switch (b) {
case 'leftContext':
case '$`':
a[b] = rc[b] === 'hello ';
break;
case 'rightContext':
case "$'":
a[b] = rc[b] === '!';
break;
case 'lastParen':
case "$+":
a[b] = rc[b] === 'ld';
break;
case 'lastMatch':
case '$&':
a[b] = rc[b] === 'world';
break;
case 'input':
case '$_':
a[b] = rc[b] === 'hello world!';
break;
case '$1':
a[b] = rc[b] === 'wor';
break;
case '$2':
a[b] = rc[b] === 'ld';
break;
default:
//console.log(b, rc[b]);
}
}
return a;

@@ -38,0 +76,0 @@ }, {});

@@ -132,9 +132,47 @@ /**

{
let r = RegExpClass;
let rc = RegExpClass;
let re = createRegExp('(wor)(ld)', 'g', RegExpClass);
re.test('hello world!');
return Object.keys(REGEXP_STATIC)
.reduce(function (a, b)
{
a[b] = (b in r);
a[b] = (b in rc);
if (a[b])
{
switch (b)
{
case 'leftContext':
case '$`':
a[b] = rc[b] === 'hello ';
break;
case 'rightContext':
case "$'":
a[b] = rc[b] === '!';
break;
case 'lastParen':
case "$+":
a[b] = rc[b] === 'ld';
break;
case 'lastMatch':
case '$&':
a[b] = rc[b] === 'world';
break;
case 'input':
case '$_':
a[b] = rc[b] === 'hello world!';
break;
case '$1':
a[b] = rc[b] === 'wor';
break;
case '$2':
a[b] = rc[b] === 'ld';
break;
default:
//console.log(b, rc[b]);
}
}
return a;

@@ -141,0 +179,0 @@ }, {} as typeof REGEXP_STATIC)

2

package.json
{
"name": "regexp-support",
"version": "1.0.12",
"version": "1.0.13",
"description": "check RegExp ( regular expressions ) support",

@@ -5,0 +5,0 @@ "keywords": [