cidr-regex
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -8,4 +8,4 @@ 'use strict'; | ||
var cidrv6 = exports.cidrv6 = /^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?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.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%\.+)?(\/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))?$/; | ||
exports.default = cidrv4; |
{ | ||
"name": "cidr-regex", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Regular expression for matching CIDR (Classless Inter-Domain Routing)", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"compile": "babel --presets es2015 -d lib/ src/", | ||
"prepublish": "npm run compile", | ||
"test": "ava --require babel-register" | ||
"commit": "git-cz", | ||
"prebuild": "npm run lint && npm run clean", | ||
"build": "babel --presets es2015 -d lib/ src/", | ||
"clean": "rimraf lib && mkdir lib", | ||
"lint": "eslint src/ test/", | ||
"test": "ava --require babel-register", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/flipjs/cidr-regex.git" | ||
"url": "https://github.com/flipjs/cidr-regex.git" | ||
}, | ||
@@ -32,3 +36,13 @@ "keywords": [ | ||
"babel-preset-es2015": "6.6.0", | ||
"babel-register": "6.7.2" | ||
"babel-register": "6.7.2", | ||
"commitizen": "2.7.3", | ||
"cz-conventional-changelog": "1.1.5", | ||
"eslint": "2.4.0", | ||
"eslint-config-standard": "5.1.0", | ||
"eslint-plugin-babel": "3.1.0", | ||
"eslint-plugin-promise": "1.1.0", | ||
"eslint-plugin-standard": "1.3.2", | ||
"ghooks": "1.0.3", | ||
"rimraf": "2.5.2", | ||
"semantic-release": "4.3.5" | ||
}, | ||
@@ -39,3 +53,11 @@ "babel": { | ||
] | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "node_modules/cz-conventional-changelog" | ||
}, | ||
"ghooks": { | ||
"pre-commit": "npm run test && npm run build" | ||
} | ||
} | ||
} | ||
} |
# cidr-regex | ||
Regular expression for matching CIDR (Classless Inter-Domain Routing) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) | ||
[![version](https://img.shields.io/npm/v/cidr-regex.svg?style=flat-square)](http://npm.im/cidr-regex) | ||
[![MIT License](https://img.shields.io/npm/l/cidr-regex.svg?style=flat-square)](http://opensource.org/licenses/MIT) | ||
[![travis build](https://img.shields.io/travis/flipjs/cidr-regex.svg?style=flat-square)](https://travis-ci.org/flipjs/cidr-regex) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) | ||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/) | ||
[![downloads](https://img.shields.io/npm/dm/cidr-regex.svg?style=flat-square)](http://npm-stat.com/charts.html?package=cidr-regex&from=2016-03-24) | ||
## Install | ||
@@ -46,2 +55,6 @@ | ||
## Other notes | ||
This was inspired by npm package [ip-regex](https://www.npmjs.com/package/ip-regex). I've used the same samples on unit testing for IPv4 and modified for CIDR testing. Other IPv6 test cases were taken from [IPv6 Regex by Dartware, LLC](https://www.helpsystems.com/intermapper/ipv6-test-address-validation) (licensed under CC-BY-SA 3.0). | ||
## License | ||
@@ -48,0 +61,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21905
8
588
63
14
1