@ztimson/utils 0.26.8 → 0.26.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1727,6 +1727,10 @@ function ipV6ToV4(ip) {
1727
1727
  if (ipv4 == "1") return "127.0.0.1";
1728
1728
  return ipv4;
1729
1729
  }
1730
+ function reservedIp(ip) {
1731
+ if (ip == "localhost") return true;
1732
+ return /\b(10\.(?:[0-9]{1,3}\.){2}[0-9]{1,3})\b|\b(172\.(?:1[6-9]|2[0-9]|3[0-1])\.(?:[0-9]{1,3}\.)[0-9]{1,3})\b|\b(192\.168\.(?:[0-9]{1,3}\.)[0-9]{1,3})\b/.test(ip);
1733
+ }
1730
1734
  function PE(str, ...args) {
1731
1735
  const combined = [];
1732
1736
  for (let i = 0; i < str.length || i < args.length; i++) {
@@ -2332,6 +2336,7 @@ export {
2332
2336
  randomHex,
2333
2337
  randomString,
2334
2338
  randomStringBuilder,
2339
+ reservedIp,
2335
2340
  search,
2336
2341
  sleep,
2337
2342
  sleepWhile,