Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « is-cidr « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8caef5fbb72a38594e185a581f5ba78d031b5273 (plain)
1
2
3
4
5
6
7
8
9
"use strict";
const {v4, v6} = require("cidr-regex");

const re4 = v4({exact: true});
const re6 = v6({exact: true});

module.exports = str => re4.test(str) ? 4 : (re6.test(str) ? 6 : 0);
module.exports.v4 = str => re4.test(str);
module.exports.v6 = str => re6.test(str);