UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

107 lines (106 loc) 4.16 kB
{ "_args": [ [ { "raw": "safe-regex@^1.1.0", "scope": null, "escapedName": "safe-regex", "name": "safe-regex", "rawSpec": "^1.1.0", "spec": ">=1.1.0 <2.0.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/to-regex" ] ], "_from": "safe-regex@>=1.1.0 <2.0.0", "_id": "safe-regex@1.1.0", "_inCache": true, "_location": "/safe-regex", "_nodeVersion": "0.12.0", "_npmUser": { "name": "substack", "email": "mail@substack.net" }, "_npmVersion": "2.3.0", "_phantomChildren": {}, "_requested": { "raw": "safe-regex@^1.1.0", "scope": null, "escapedName": "safe-regex", "name": "safe-regex", "rawSpec": "^1.1.0", "spec": ">=1.1.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/regex-not", "/to-regex" ], "_resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "_shasum": "40a3669f3b077d1e943d44629e157dd48023bf2e", "_shrinkwrap": null, "_spec": "safe-regex@^1.1.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/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" }, "dependencies": { "ret": "~0.1.10" }, "description": "detect possibly catastrophic, exponential-time regular expressions", "devDependencies": { "tape": "^3.5.0" }, "directories": {}, "dist": { "shasum": "40a3669f3b077d1e943d44629e157dd48023bf2e", "tarball": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" }, "gitHead": "d2570f31bd9d779515015917bb8297c753e46572", "homepage": "https://github.com/substack/safe-regex", "keywords": [ "catastrophic", "exponential", "regex", "safe", "sandbox" ], "license": "MIT", "main": "index.js", "maintainers": [ { "name": "substack", "email": "mail@substack.net" } ], "name": "safe-regex", "optionalDependencies": {}, "readme": "# safe-regex\n\ndetect potentially\n[catastrophic](http://regular-expressions.mobi/catastrophic.html)\n[exponential-time](http://perlgeek.de/blog-en/perl-tips/in-search-of-an-exponetial-regexp.html)\nregular expressions by limiting the\n[star height](https://en.wikipedia.org/wiki/Star_height) to 1\n\nWARNING: This module merely *seems* to work given all the catastrophic regular\nexpressions I could find scouring the internet, but I don't have enough of a\nbackground in automata to be absolutely sure that this module will catch all\nexponential-time cases.\n\n[![browser support](https://ci.testling.com/substack/safe-regex.png)](https://ci.testling.com/substack/safe-regex)\n\n[![build status](https://secure.travis-ci.org/substack/safe-regex.png)](http://travis-ci.org/substack/safe-regex)\n\n# example\n\n``` js\nvar safe = require('safe-regex');\nvar regex = process.argv.slice(2).join(' ');\nconsole.log(safe(regex));\n```\n\n```\n$ node safe.js '(x+x+)+y'\nfalse\n$ node safe.js '(beep|boop)*'\ntrue\n$ node safe.js '(a+){10}'\nfalse\n$ node safe.js '\\blocation\\s*:[^:\\n]+\\b(Oakland|San Francisco)\\b'\ntrue\n```\n\n# methods\n\n``` js\nvar safe = require('safe-regex')\n```\n\n## var ok = safe(re, opts={})\n\nReturn a boolean `ok` whether or not the regex `re` is safe and not possibly\ncatastrophic.\n\n`re` can be a `RegExp` object or just a string.\n\nIf the `re` is a string and is an invalid regex, returns `false`.\n\n* `opts.limit` - maximum number of allowed repetitions in the entire regex.\nDefault: `25`.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install safe-regex\n```\n\n# license\n\nMIT\n", "readmeFilename": "readme.markdown", "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" }