summaryrefslogtreecommitdiffstats
path: root/node_modules/safe-regex
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/safe-regex
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/safe-regex')
-rw-r--r--node_modules/safe-regex/.travis.yml4
-rw-r--r--node_modules/safe-regex/LICENSE18
-rw-r--r--node_modules/safe-regex/example/safe.js3
-rw-r--r--node_modules/safe-regex/index.js43
-rw-r--r--node_modules/safe-regex/package.json74
-rw-r--r--node_modules/safe-regex/readme.markdown65
-rw-r--r--node_modules/safe-regex/test/regex.js50
7 files changed, 0 insertions, 257 deletions
diff --git a/node_modules/safe-regex/.travis.yml b/node_modules/safe-regex/.travis.yml
deleted file mode 100644
index cc4dba2..0000000
--- a/node_modules/safe-regex/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - "0.8"
- - "0.10"
diff --git a/node_modules/safe-regex/LICENSE b/node_modules/safe-regex/LICENSE
deleted file mode 100644
index ee27ba4..0000000
--- a/node_modules/safe-regex/LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-This software is released under the MIT license:
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/safe-regex/example/safe.js b/node_modules/safe-regex/example/safe.js
deleted file mode 100644
index f486f59..0000000
--- a/node_modules/safe-regex/example/safe.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var safe = require('../');
-var regex = process.argv.slice(2).join(' ');
-console.log(safe(regex));
diff --git a/node_modules/safe-regex/index.js b/node_modules/safe-regex/index.js
deleted file mode 100644
index 488f501..0000000
--- a/node_modules/safe-regex/index.js
+++ /dev/null
@@ -1,43 +0,0 @@
-var parse = require('ret');
-var types = parse.types;
-
-module.exports = function (re, opts) {
- if (!opts) opts = {};
- var replimit = opts.limit === undefined ? 25 : opts.limit;
-
- if (isRegExp(re)) re = re.source;
- else if (typeof re !== 'string') re = String(re);
-
- try { re = parse(re) }
- catch (err) { return false }
-
- var reps = 0;
- return (function walk (node, starHeight) {
- if (node.type === types.REPETITION) {
- starHeight ++;
- reps ++;
- if (starHeight > 1) return false;
- if (reps > replimit) return false;
- }
-
- if (node.options) {
- for (var i = 0, len = node.options.length; i < len; i++) {
- var ok = walk({ stack: node.options[i] }, starHeight);
- if (!ok) return false;
- }
- }
- var stack = node.stack || (node.value && node.value.stack);
- if (!stack) return true;
-
- for (var i = 0; i < stack.length; i++) {
- var ok = walk(stack[i], starHeight);
- if (!ok) return false;
- }
-
- return true;
- })(re, 0);
-};
-
-function isRegExp (x) {
- return {}.toString.call(x) === '[object RegExp]';
-}
diff --git a/node_modules/safe-regex/package.json b/node_modules/safe-regex/package.json
deleted file mode 100644
index a539a18..0000000
--- a/node_modules/safe-regex/package.json
+++ /dev/null
@@ -1,74 +0,0 @@
-{
- "_from": "safe-regex@^1.1.0",
- "_id": "safe-regex@1.1.0",
- "_inBundle": false,
- "_integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
- "_location": "/safe-regex",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "safe-regex@^1.1.0",
- "name": "safe-regex",
- "escapedName": "safe-regex",
- "rawSpec": "^1.1.0",
- "saveSpec": null,
- "fetchSpec": "^1.1.0"
- },
- "_requiredBy": [
- "/regex-not",
- "/to-regex"
- ],
- "_resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
- "_shasum": "40a3669f3b077d1e943d44629e157dd48023bf2e",
- "_spec": "safe-regex@^1.1.0",
- "_where": "/home/pruss/Dev/3-minute-website/node_modules/to-regex",
- "author": {
- "name": "James Halliday",
- "email": "mail@substack.net",
- "url": "http://substack.net"
- },
- "bugs": {
- "url": "https://github.com/substack/safe-regex/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "ret": "~0.1.10"
- },
- "deprecated": false,
- "description": "detect possibly catastrophic, exponential-time regular expressions",
- "devDependencies": {
- "tape": "^3.5.0"
- },
- "homepage": "https://github.com/substack/safe-regex",
- "keywords": [
- "catastrophic",
- "exponential",
- "regex",
- "safe",
- "sandbox"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "safe-regex",
- "repository": {
- "type": "git",
- "url": "git://github.com/substack/safe-regex.git"
- },
- "scripts": {
- "test": "tape test/*.js"
- },
- "testling": {
- "files": "test/*.js",
- "browsers": [
- "ie/8",
- "ie/9",
- "ie/10",
- "firefox/latest",
- "chrome/latest",
- "opera/latest",
- "safari/latest"
- ]
- },
- "version": "1.1.0"
-}
diff --git a/node_modules/safe-regex/readme.markdown b/node_modules/safe-regex/readme.markdown
deleted file mode 100644
index 83673ac..0000000
--- a/node_modules/safe-regex/readme.markdown
+++ /dev/null
@@ -1,65 +0,0 @@
-# safe-regex
-
-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
-
-WARNING: This module merely *seems* to work given all the catastrophic regular
-expressions I could find scouring the internet, but I don't have enough of a
-background in automata to be absolutely sure that this module will catch all
-exponential-time cases.
-
-[![browser support](https://ci.testling.com/substack/safe-regex.png)](https://ci.testling.com/substack/safe-regex)
-
-[![build status](https://secure.travis-ci.org/substack/safe-regex.png)](http://travis-ci.org/substack/safe-regex)
-
-# example
-
-``` js
-var safe = require('safe-regex');
-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-regex
-```
-
-# license
-
-MIT
diff --git a/node_modules/safe-regex/test/regex.js b/node_modules/safe-regex/test/regex.js
deleted file mode 100644
index 0bda850..0000000
--- a/node_modules/safe-regex/test/regex.js
+++ /dev/null
@@ -1,50 +0,0 @@
-var safe = require('../');
-var test = require('tape');
-
-var good = [
- /\bOakland\b/,
- /\b(Oakland|San Francisco)\b/i,
- /^\d+1337\d+$/i,
- /^\d+(1337|404)\d+$/i,
- /^\d+(1337|404)*\d+$/i,
- RegExp(Array(26).join('a?') + Array(26).join('a')),
-];
-
-test('safe regex', function (t) {
- t.plan(good.length);
- good.forEach(function (re) {
- t.equal(safe(re), true);
- });
-});
-
-
-var bad = [
- /^(a?){25}(a){25}$/,
- RegExp(Array(27).join('a?') + Array(27).join('a')),
- /(x+x+)+y/,
- /foo|(x+x+)+y/,
- /(a+){10}y/,
- /(a+){2}y/,
- /(.*){1,32000}[bc]/
-];
-
-test('unsafe regex', function (t) {
- t.plan(bad.length);
- bad.forEach(function (re) {
- t.equal(safe(re), false);
- });
-});
-
-var invalid = [
- '*Oakland*',
- 'hey(yoo))',
- 'abcde(?>hellow)',
- '[abc'
-];
-
-test('invalid regex', function (t) {
- t.plan(invalid.length);
- invalid.forEach(function (re) {
- t.equal(safe(re), false);
- });
-});