Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

2
backend/node_modules/safe-regex2/.gitattributes generated vendored Normal file
View File

@@ -0,0 +1,2 @@
# Set default behavior to automatically convert line endings
* text=auto eol=lf

View File

@@ -9,5 +9,5 @@ updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
open-pull-requests-limit: 10

View File

@@ -2,6 +2,10 @@ name: CI
on:
push:
branches:
- main
- next
- 'v*'
paths-ignore:
- 'docs/**'
- '*.md'
@@ -12,7 +16,10 @@ on:
jobs:
test:
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
permissions:
contents: write
pull-requests: write
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5
with:
license-check: true
lint: true

59
backend/node_modules/safe-regex2/README.md generated vendored Normal file
View File

@@ -0,0 +1,59 @@
# safe-regex2
[![CI](https://github.com/fastify/safe-regex2/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/safe-regex2/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/safe-regex2.svg?style=flat)](https://www.npmjs.com/package/safe-regex2)
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)
Detect potentially [catastrophic](http://regular-expressions.mobi/catastrophic.html) [exponential-time](http://perlgeek.de/blog-en/perl-tips/in-search-of-an-exponetial-regexp.html)
regular expressions by limiting the [star height](https://en.wikipedia.org/wiki/Star_height) to 1.
This is a fork of https://github.com/substack/safe-regex at 1.1.0.
WARNING: This module has both false positives and false negatives.
It is not meant as a full checker, but it detects basic cases.
## Install
```
npm i safe-regex2
```
## Example
``` js
const safe = require('safe-regex2');
const regex = process.argv.slice(2).join(' ');
console.log(safe(regex));
```
```
$ node safe.js '(x+x+)+y'
false
$ node safe.js '(beep|boop)*'
true
$ node safe.js '(a+){10}'
false
$ node safe.js '\blocation\s*:[^:\n]+\b(Oakland|San Francisco)\b'
true
```
## Methods
``` js
const safe = require('safe-regex')
```
### const ok = safe(re, opts={})
Returns a boolean indicating whether the regex `re` is safe
and not possibly catastrophic.
`re` can be a `RegExp` object or just a string.
If `re` is a string and is an invalid regex, it returns `false`.
* `opts.limit` - maximum number of allowed repetitions in the entire regex.
Default: `25`.
## License
Licensed under [MIT](./LICENSE).

6
backend/node_modules/safe-regex2/eslint.config.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
'use strict'
module.exports = require('neostandard')({
ignores: require('neostandard').resolveIgnoresFromGitignore(),
ts: true
})

View File

@@ -1,3 +1,5 @@
'use strict'
const safe = require('../')
const regex = process.argv.slice(2).join(' ')
console.log(safe(regex))

View File

@@ -5,12 +5,14 @@ const types = parse.types
function safeRegex (re, opts) {
if (!opts) opts = {}
/* c8 ignore next */
const replimit = opts.limit === undefined ? 25 : opts.limit
/* c8 ignore next 2 */
if (isRegExp(re)) re = re.source
else if (typeof re !== 'string') re = String(re)
try { re = parse(re) } catch (err) { return false }
try { re = parse(re) } catch { return false }
let reps = 0
return (function walk (node, starHeight) {
@@ -31,7 +33,7 @@ function safeRegex (re, opts) {
if (!ok) return false
}
}
const stack = node.stack || (node.value && node.value.stack)
const stack = node.stack || node.value?.stack
if (!stack) return true
for (i = 0; i < stack.length; i++) {

View File

@@ -1,28 +1,46 @@
{
"name": "safe-regex2",
"version": "3.1.0",
"version": "5.0.0",
"description": "detect possibly catastrophic, exponential-time regular expressions",
"main": "index.js",
"type": "commonjs",
"types": "types/index.d.ts",
"dependencies": {
"ret": "~0.4.0"
"ret": "~0.5.0"
},
"devDependencies": {
"standard": "^17.0.0",
"tape": "^5.0.0",
"tsd": "^0.25.0"
"@fastify/pre-commit": "^2.1.0",
"c8": "^10.1.3",
"eslint": "^9.17.0",
"neostandard": "^0.12.0",
"tape": "^5.7.5",
"tsd": "^0.31.0"
},
"scripts": {
"lint": "standard",
"test": "npm run test:unit",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "npm run test:unit && npm run test:typescript",
"test:typescript": "tsd",
"test:unit": "tape test/*.js"
"test:unit": "c8 tape test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/fastify/safe-regex.git"
"url": "git://github.com/fastify/safe-regex2.git"
},
"homepage": "https://github.com/fastify/safe-regex",
"bugs": {
"url": "https://github.com/fastify/safe-regex2/issues"
},
"homepage": "https://github.com/fastify/safe-regex2",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fastify"
},
{
"type": "opencollective",
"url": "https://opencollective.com/fastify"
}
],
"keywords": [
"catastrophic",
"exponential",
@@ -36,7 +54,24 @@
"url": "http://substack.net"
},
"contributors": [
"Matteo Collina <hello@matteocollina.com>"
{
"name": "Matteo Collina",
"email": "hello@matteocollina.com"
},
{
"name": "Gürgün Dayıoğlu",
"email": "hey@gurgun.day",
"url": "https://heyhey.to/G"
},
{
"name": "James Sumners",
"url": "https://james.sumners.info"
},
{
"name": "Frazer Smith",
"email": "frazer.dev@icloud.com",
"url": "https://github.com/fdawgs"
}
],
"license": "MIT"
}

View File

@@ -1,61 +0,0 @@
# safe-regex2
detect potentially
[catastrophic](http://regular-expressions.mobi/catastrophic.html)
[exponential-time](http://perlgeek.de/blog-en/perl-tips/in-search-of-an-exponetial-regexp.html)
regular expressions by limiting the
[star height](https://en.wikipedia.org/wiki/Star_height) to 1
This is a fork of https://github.com/substack/safe-regex at 1.1.0.
WARNING: This module has both false positives and false negatives.
It is not meant as a full checker, but it detect basic cases.
# example
``` js
var safe = require('safe-regex2');
var regex = process.argv.slice(2).join(' ');
console.log(safe(regex));
```
```
$ node safe.js '(x+x+)+y'
false
$ node safe.js '(beep|boop)*'
true
$ node safe.js '(a+){10}'
false
$ node safe.js '\blocation\s*:[^:\n]+\b(Oakland|San Francisco)\b'
true
```
# methods
``` js
var safe = require('safe-regex')
```
## var ok = safe(re, opts={})
Return a boolean `ok` whether or not the regex `re` is safe and not possibly
catastrophic.
`re` can be a `RegExp` object or just a string.
If the `re` is a string and is an invalid regex, returns `false`.
* `opts.limit` - maximum number of allowed repetitions in the entire regex.
Default: `25`.
# install
With [npm](https://npmjs.org) do:
```
npm install safe-regex2
```
# license
MIT

View File

@@ -1,3 +1,5 @@
'use strict'
const safe = require('../')
const test = require('tape')

View File

@@ -5,5 +5,5 @@ declare namespace safeRegex {
export { safeRegex as default }
}
declare function safeRegex(...params: Parameters<SafeRegex2>): ReturnType<SafeRegex2>
declare function safeRegex (...params: Parameters<SafeRegex2>): ReturnType<SafeRegex2>
export = safeRegex