xref: /third_party/node/deps/npm/node_modules/is-cidr/index.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/deps/npm/node_modules/is-cidr/
11cb0ef41Sopenharmony_ciimport {v4 as v4Re, v6 as v6Re} from "cidr-regex";
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst re4 = v4Re({exact: true});
41cb0ef41Sopenharmony_ciconst re6 = v6Re({exact: true});
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst isCidr = str => re4.test(str) ? 4 : (re6.test(str) ? 6 : 0);
71cb0ef41Sopenharmony_ciexport const v4 = isCidr.v4 = str => re4.test(str);
81cb0ef41Sopenharmony_ciexport const v6 = isCidr.v6 = str => re6.test(str);
91cb0ef41Sopenharmony_ciexport default isCidr;
10

Indexes created Thu Nov 07 10:32:03 CST 2024