| Current Path : /home/emeraadmin/public_html/4d695/ |
| Current File : /home/emeraadmin/public_html/4d695/cidr-regex.tar |
package.json 0000644 00000002720 15170141461 0007033 0 ustar 00 {
"_id": "cidr-regex@4.1.1",
"_inBundle": true,
"_location": "/npm/cidr-regex",
"_phantomChildren": {},
"_requiredBy": [
"/npm/is-cidr"
],
"author": {
"name": "silverwind",
"email": "me@silverwind.io"
},
"bugs": {
"url": "https://github.com/silverwind/cidr-regex/issues"
},
"contributors": [
{
"name": "Felipe Apostol",
"email": "flipjs.io@gmail.com",
"url": "http://flipjs.io/"
}
],
"dependencies": {
"ip-regex": "^5.0.0"
},
"description": "Regular expression for matching IP addresses in CIDR notation",
"devDependencies": {
"@types/node": "20.12.12",
"eslint": "8.57.0",
"eslint-config-silverwind": "85.1.4",
"eslint-config-silverwind-typescript": "3.2.7",
"typescript": "5.4.5",
"typescript-config-silverwind": "4.3.2",
"updates": "16.1.1",
"versions": "12.0.2",
"vite": "5.2.11",
"vite-config-silverwind": "1.1.2",
"vite-plugin-dts": "3.9.1",
"vitest": "1.6.0",
"vitest-config-silverwind": "9.0.6"
},
"engines": {
"node": ">=14"
},
"exports": "./dist/index.js",
"files": [
"dist"
],
"homepage": "https://github.com/silverwind/cidr-regex#readme",
"license": "BSD-2-Clause",
"main": "./dist/index.js",
"name": "cidr-regex",
"repository": {
"type": "git",
"url": "git+https://github.com/silverwind/cidr-regex.git"
},
"sideEffects": false,
"type": "module",
"types": "./dist/index.d.ts",
"version": "4.1.1"
}
LICENSE 0000644 00000002412 15170141461 0005550 0 ustar 00 Copyright (c) silverwind
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dist/index.js 0000644 00000001302 15170141461 0007150 0 ustar 00 import ipRegex from "ip-regex";
const defaultOpts = { exact: false };
const v4str = `${ipRegex.v4().source}\\/(3[0-2]|[12]?[0-9])`;
const v6str = `${ipRegex.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
const v4exact = new RegExp(`^${v4str}$`);
const v6exact = new RegExp(`^${v6str}$`);
const v46exact = new RegExp(`(?:^${v4str}$)|(?:^${v6str}$)`);
const cidrRegex = ({ exact } = defaultOpts) => exact ? v46exact : new RegExp(`(?:${v4str})|(?:${v6str})`, "g");
const v4 = cidrRegex.v4 = ({ exact } = defaultOpts) => exact ? v4exact : new RegExp(v4str, "g");
const v6 = cidrRegex.v6 = ({ exact } = defaultOpts) => exact ? v6exact : new RegExp(v6str, "g");
export {
cidrRegex as default,
v4,
v6
};