🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

regexp-support

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.12

@@ -93,2 +93,3 @@ /**

};
objectStringTag: string;
}>;

@@ -95,0 +96,0 @@ export import FlagsName = FlagsName;

@@ -52,2 +52,3 @@ "use strict";

symbol: symbol_1.testSymbol(),
objectStringTag: Object.prototype.toString.call(/a/),
};

@@ -54,0 +55,0 @@ _support.nativeFlags = Object

@@ -67,2 +67,4 @@ /**

symbol: testSymbol(),
objectStringTag: Object.prototype.toString.call(/a/) as string,
};

@@ -69,0 +71,0 @@

@@ -20,6 +20,15 @@ "use strict";

function testPrototype(RegExpClass = RegExp) {
let r = index_1.createRegExp('', '', RegExpClass);
const flags = 'g';
let r = index_1.createRegExp('', flags, RegExpClass);
return Object.keys(exports.PROTOTYPE)
.reduce(function (a, b) {
a[b] = (b in r);
switch (b) {
case 'flags':
// @ts-ignore
a[b] = (b in r) && r[b] === flags;
break;
default:
a[b] = (b in r);
break;
}
return a;

@@ -26,0 +35,0 @@ }, {});

@@ -33,8 +33,19 @@ /**

{
let r = createRegExp('', '', RegExpClass);
const flags = 'g';
let r = createRegExp('', flags, RegExpClass);
return Object.keys(PROTOTYPE)
.reduce(function (a, b)
{
a[b] = (b in r);
switch (b)
{
case 'flags':
// @ts-ignore
a[b] = (b in r) && r[b] === flags;
break;
default:
a[b] = (b in r);
break;
}

@@ -41,0 +52,0 @@ return a;

{
"name": "regexp-support",
"version": "1.0.11",
"version": "1.0.12",
"description": "check RegExp ( regular expressions ) support",

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

@@ -49,3 +49,3 @@ # regexp-support

```ts
const RE_DOLLAR_PREFIX = /(?<=\\$)foo/g;
const RE_DOLLAR_PREFIX = /(?<=\$)foo/g;
'$foo %foo foo'.replace(RE_DOLLAR_PREFIX, 'bar'); // => '$bar %foo foo'

@@ -59,3 +59,3 @@ ```

```ts
const RE_NO_DOLLAR_PREFIX = /(?<!\\$)foo/g;
const RE_NO_DOLLAR_PREFIX = /(?<!\$)foo/g;
'$foo %foo foo'.replace(RE_NO_DOLLAR_PREFIX, 'bar'); // => '$foo %bar bar'

@@ -62,0 +62,0 @@ ```