New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rauschma/helpers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rauschma/helpers - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

19

dist/src/lang/regexp.js

@@ -29,8 +29,12 @@ const { raw } = String;

/**
* - Based on {@link https://github.com/tc39/proposal-regex-escaping/blob/main/EscapedChars.md|this list}
* - Based on
* {@link https://github.com/tc39/proposal-regex-escaping/blob/main/EscapedChars.md this list}
* - Ignored: escaping text for `eval()`
* - Changes needed for upcoming `/v` flag: {@link https://github.com/tc39/proposal-regexp-v-flag/issues/71}
* - Changes needed for upcoming `/v` flag:
* {@link https://github.com/tc39/proposal-regexp-v-flag/issues/71}
*/
const specialAnywhere = [
raw `\^`, raw `\$`,
// We escape all characters even though they are put inside a character
// class, to be ready for future changes.
raw `\^`, raw `$`,
raw `\\`,

@@ -41,9 +45,12 @@ raw `\.`,

raw `\|`,
raw `\-`, // inside character classes (square brackets)
// Omitted – not allowed by /u
// raw`\-`, // inside character classes (square brackets)
];
// Only first character of string needs to be escaped in these cases:
const specialAtStart = [
// Alas, both cases have to be omitted because they are not allowed by /u
// - Decimal digits: inserting after (e.g.) `\1`
// - All (hex digits): inserting after (e.g.) `\u004`
raw `0-9a-fA-F`,
// - Hex digits: inserting after (e.g.) `\u004`
// `0-9A-Za-z`,
``,
];

@@ -50,0 +57,0 @@ const re_specialCharacters = new RegExp(raw `[${specialAnywhere.join('')}]|^[${specialAtStart.join('')}]`, 'g');

{
"name": "@rauschma/helpers",
"version": "0.2.0",
"version": "0.3.0",
"type": "module",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -31,8 +31,12 @@ const {raw} = String;

/**
* - Based on {@link https://github.com/tc39/proposal-regex-escaping/blob/main/EscapedChars.md|this list}
* - Based on
* {@link https://github.com/tc39/proposal-regex-escaping/blob/main/EscapedChars.md this list}
* - Ignored: escaping text for `eval()`
* - Changes needed for upcoming `/v` flag: {@link https://github.com/tc39/proposal-regexp-v-flag/issues/71}
* - Changes needed for upcoming `/v` flag:
* {@link https://github.com/tc39/proposal-regexp-v-flag/issues/71}
*/
const specialAnywhere = [
raw`\^`, raw`\$`,
// We escape all characters even though they are put inside a character
// class, to be ready for future changes.
raw`\^`, raw`$`,
raw`\\`,

@@ -43,9 +47,12 @@ raw`\.`,

raw`\|`,
raw`\-`, // inside character classes (square brackets)
// Omitted – not allowed by /u
// raw`\-`, // inside character classes (square brackets)
];
// Only first character of string needs to be escaped in these cases:
const specialAtStart = [
// Alas, both cases have to be omitted because they are not allowed by /u
// - Decimal digits: inserting after (e.g.) `\1`
// - All (hex digits): inserting after (e.g.) `\u004`
raw`0-9a-fA-F`,
// - Hex digits: inserting after (e.g.) `\u004`
// `0-9A-Za-z`,
``,
];

@@ -52,0 +59,0 @@ const re_specialCharacters = new RegExp(

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