generate-ip 2.4.4 → 2.4.6

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/README.md CHANGED
@@ -6,17 +6,24 @@
6
6
 
7
7
  <br>
8
8
 
9
- <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
10
- <a href="https://github.com/adamlui/js-utils/releases/tag/generate-ip-2.4.4"><img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.4-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
- <a href="https://www.npmjs.com/package/generate-ip?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/generate-ip?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
12
- <a href="https://github.com/adamlui/js-utils/blob/generate-ip-2.4.4/generate-ip/dist/generate-ip.min.js"><img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/generate-ip/dist/generate-ip.min.js?branch=generate-ip-2.4.4&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
13
- <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-ip/src/generate-ip.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Agenerate-ip%2Fsrc%2Fgenerate-ip.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
14
- <a href="https://github.com/toolleeo/cli-apps#networking"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
15
- <a href="https://www.jsdelivr.com/package/npm/generate-ip?tab=stats"><img height=31 src="https://img.shields.io/jsdelivr/npm/hm/generate-ip?style=for-the-badge&logo=jsdelivr&logoColor=white&label=jsDelivr%20Hits&labelColor=464646&color=49c5d8"></a>
9
+ <a href="#%EF%B8%8F-mit-license">
10
+ <img height=31 src="https://img.shields.io/badge/License-MIT-fc4f2d.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
+ <a href="https://github.com/adamlui/js-utils/releases/tag/generate-ip-2.4.6">
12
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.6-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
13
+ <a href="https://www.npmjs.com/package/generate-ip?activeTab=code">
14
+ <img height=31 src="https://img.shields.io/npm/unpacked-size/generate-ip?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
15
+ <a href="https://github.com/adamlui/js-utils/blob/generate-ip-2.4.6/generate-ip/dist/generate-ip.min.js">
16
+ <img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/generate-ip/dist/generate-ip.min.js?branch=generate-ip-2.4.6&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
17
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-ip/src/generate-ip.js">
18
+ <img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Agenerate-ip%2Fsrc%2Fgenerate-ip.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
19
+ <a href="https://github.com/toolleeo/cli-apps#networking">
20
+ <img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
21
+ <a href="https://www.jsdelivr.com/package/npm/generate-ip?tab=stats">
22
+ <img height=31 src="https://img.shields.io/jsdelivr/npm/hm/generate-ip?style=for-the-badge&logo=jsdelivr&logoColor=white&label=jsDelivr%20Hits&labelColor=464646&color=49c5d8"></a>
16
23
 
17
24
  </div>
18
25
 
19
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
26
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
20
27
 
21
28
  ## 💡 About
22
29
 
@@ -27,7 +34,7 @@
27
34
  - **Multi-environment support —** Use in Node.js or the web browser
28
35
  - **Command line usable —** Just type `generate-ip`, that's it
29
36
 
30
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
37
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
31
38
 
32
39
  ## ⚡ Installation
33
40
 
@@ -51,13 +58,13 @@ $ npm install generate-ip
51
58
 
52
59
  <br>
53
60
 
54
- <a href="https://github.com/sponsors/adamlui"><img src="https://media.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?09f5d64"></a>
61
+ <a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
55
62
 
56
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
63
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
57
64
 
58
65
  ## 🔌 Importing the APIs
59
66
 
60
- ### <img height=18 src="https://media.js-utils.org/images/icons/platforms/node.js/icon25x28.png?3e22bae"> Node.js
67
+ ### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
61
68
 
62
69
  #### ECMAScript*:
63
70
 
@@ -73,28 +80,28 @@ const { ipv4, ipv6, mac } = require('generate-ip');
73
80
 
74
81
  ###### _*Node.js version 14 or higher required_
75
82
 
76
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.org/images/icons/platforms/web/light/icon25.png?3e22bae"><img width=16 src="https://media.js-utils.org/images/icons/platforms/web/dark/icon25.png?3e22bae"></picture> Web
83
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/platforms/web/light/icon25.png?v=0d36e26"><img width=16 src="https://assets.js-utils.org/images/icons/platforms/web/dark/icon25.png?v=0d36e26"></picture> Web
77
84
 
78
85
  #### <> HTML script tag:
79
86
 
80
87
  ```html
81
- <script src="https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js"></script>
88
+ <script src="https://cdn.jsdelivr.net/npm/generate-ip@2.4.6/dist/generate-ip.min.js"></script>
82
89
  ```
83
90
 
84
91
  #### ES6:
85
92
 
86
93
  ```js
87
94
  (async () => {
88
- await import('https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js');
95
+ await import('https://cdn.jsdelivr.net/npm/generate-ip@2.4.6/dist/generate-ip.min.js');
89
96
  // Your code here...
90
97
  })();
91
98
  ```
92
99
 
93
- ### <img height=17 src="https://media.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?4fd2fa7"><img height=17.5 src="https://media.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?2fe972c"> Greasemonkey
100
+ ### <img height=17 src="https://assets.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?v=0d36e26"><img height=17.5 src="https://assets.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?v=0d36e26"> Greasemonkey
94
101
 
95
102
  ```js
96
103
  ...
97
- // @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js
104
+ // @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.6/dist/generate-ip.min.js
98
105
  // ==/UserScript==
99
106
 
100
107
  // Your code here...
@@ -102,11 +109,11 @@ const { ipv4, ipv6, mac } = require('generate-ip');
102
109
 
103
110
  <br>
104
111
 
105
- 📝 **Note:** To always import the latest version (not recommended in production!) remove the `@2.4.4` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-ip/dist/generate-ip.min.js`
112
+ 📝 **Note:** To always import the latest version (not recommended in production!) remove the `@2.4.6` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-ip/dist/generate-ip.min.js`
106
113
 
107
114
  <br>
108
115
 
109
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
116
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
110
117
 
111
118
  ## 📋 API usage
112
119
 
@@ -337,7 +344,7 @@ Name | Type | Description | Default Value
337
344
 
338
345
  <br>
339
346
 
340
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
347
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
341
348
 
342
349
  ## 💻 Command line usage
343
350
 
@@ -349,7 +356,7 @@ $ generate-ip
349
356
 
350
357
  Sample output:
351
358
 
352
- <img src="https://media.generate-ip.org/images/screenshots/cli/generate-ip-cmd-output.png?7b16322">
359
+ <img src="https://media.generate-ip.org/images/screenshots/cli/generate-ip-cmd-output.png?0d36e26">
353
360
 
354
361
  📝 **Note:** To generate other address types, type `generate-ipv6` or `generate-mac`
355
362
 
@@ -373,11 +380,11 @@ Info commands:
373
380
 
374
381
  <br>
375
382
 
376
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
383
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
377
384
 
378
385
  ## 🏛️ MIT License
379
386
 
380
- **Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors.**
387
+ **Copyright © 2024–2026 [Adam Lui](https://github.com/adamlui) & contributors.**
381
388
 
382
389
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
383
390
 
@@ -387,32 +394,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
387
394
 
388
395
  <br>
389
396
 
390
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
397
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
391
398
 
392
399
  ## 🛠️ Related utilities
393
400
 
394
- ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://media.js-utils.org/images/badges/awesome/badge.svg?7b16322"></a>
401
+ ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
395
402
 
396
403
  > Randomly generate, strengthen, and validate cryptographically-secure passwords.
397
404
  <br>[Install](https://docs.generatepw.org/#-installation) /
398
405
  [Readme](https://docs.generatepw.org/#readme) /
399
406
  [API usage](https://docs.generatepw.org/#-api-usage) /
400
407
  [CLI usage](https://docs.generatepw.org/#-command-line-usage) /
401
- [Discuss](https://github.js-utils.org/discussions)
408
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
402
409
 
403
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?e735b99"><img height=22 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?e735b99"></picture> [geolocate](https://js-utils.org/geolocate) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://media.js-utils.org/images/badges/awesome/badge.svg?7b16322"></a>
410
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?0d36e26"><img height=22 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?0d36e26"></picture> [geolocate](https://js-utils.org/geolocate) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
404
411
 
405
412
  > Fetch IP geolocation data from the CLI.
406
413
  <br>[Install](https://docs.geolocatejs.org/#-installation) /
407
414
  [Readme](https://docs.geolocatejs.org/#readme) /
408
415
  [CLI usage](https://docs.geolocatejs.org/#-command-line-usage) /
409
416
  [API usage](https://docs.geolocatejs.org/#-api-usage) /
410
- [Discuss](https://github.js-utils.org/discussions)
417
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
411
418
 
412
419
  <br>
413
420
 
414
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
421
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
415
422
 
416
- <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.org/images/icons/home/white/icon32x27.png?e735b99"><img height=13 src="https://media.js-utils.org/images/icons/home/dark-gray/icon32x27.png?e735b99"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
417
- <a href="https://github.js-utils.org/discussions">Discuss</a> /
423
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/home/white/icon32x27.png?v=0d36e26"><img height=13 src="https://assets.js-utils.org/images/icons/home/dark-gray/icon32x27.png?v=0d36e26"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
424
+ <a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
418
425
  <a href="#-generate-ip">Back to top ↑</a>
@@ -1,6 +1,6 @@
1
1
  /**
2
- * © 2024 Adam Lui & contributors under the MIT license.
2
+ * © 2024–2026 Adam Lui & contributors under the MIT license.
3
3
  * Source: https://code.generate-ip.org
4
4
  * Documentation: https://docs.generate-ip.org
5
5
  */
6
- const ipv4={generate:function(o={}){var e={verbose:!0,qty:1};if(validateOptions(o,e,"https://docs.generate-ip.org/#ipv4generateoptions","ipv4.generate({ verbose: false, qty: 3 })")){(o={...e,...o}).verbose&&console.info(`ipv4.generate() » Generating IPv4 address${1<o.qty?"es":""}...`);var t=[];if(1<o.qty)for(let e=0;e<o.qty;e++)t.push(this.generate({...o,qty:1,verbose:!1}));else{var r=[];for(let e=0;e<4;e++)r.push(randomInt(0,256));t.push(r.join("."))}e=1<o.qty?t:t[0];return o.verbose&&(console.info(`ipv4.generate() » IPv4 address${1<o.qty?"es":""} generated!`),console.info("ipv4.generate() » "+(1==o.qty?e:e.join(", ")))),e}},validate:function(e,o={}){var t="https://docs.generate-ip.org/#ipv4validateaddress-options",r={verbose:!0};if("string"!=typeof e)console.error("ipv4.validate() » ERROR: 1st arg <address> must be a string."),console.info("ipv4.validate() » For more help, please visit "+t);else if(validateOptions(o,r,t,"ipv4.validate('0.0.255.255', { verbose: false })"))return(o={...r,...o}).verbose&&console.info(`ipv4.validate() » Validating ${e}...`),r=!(4!=(t=e.split(".")).length||t.some(e=>!/^\d+$/.test(e)||parseInt(e,10)<0||255<parseInt(e,10))),o.verbose&&console.info(`ipv4.validate() » IP is ${r?"":"in"}valid IPv4 address!`),r}},ipv6={generate:function(o={}){var e={verbose:!0,qty:1,leadingZeros:!1,doubleColon:!0};if(validateOptions(o,e,"https://docs.generate-ip.org/#ipv6generateoptions","ipv6.generate({ leadingZeros: true, qty: 5 })")){(o={...e,...o}).verbose&&console.info(`ipv6.generate() » Generating IPv6 address${1<o.qty?"es":""}...`);var t=[];if(1<o.qty)for(let e=0;e<o.qty;e++)t.push(this.generate({...o,qty:1,verbose:!1}));else{const i=[],{qty:n,...s}=o;for(let e=0;e<8;e++){var r=randomHex(4);i.push(r)}t.push(this.format(i.join(":"),{...s,verbose:!1}))}e=1<o.qty?t:t[0];return o.verbose&&(console.info(`ipv6.generate() » IPv6 address${1<o.qty?"es":""} generated!`),console.info("ipv6.generate() » "+(1==o.qty?e:e.join(", ")))),e}},format:function(o,t={}){var r,e="https://docs.generate-ip.org/#ipv6formatipv6address-options",i={verbose:!0,leadingZeros:!1,doubleColon:!0};if("string"!=typeof o)console.error("ipv6.format() » ERROR: 1st arg <ipv6address> must be a string."),console.info("ipv6.format() » For more help, please visit "+e);else if(this.validate(o,{verbose:!1})){if(validateOptions(t,i,e,"ipv6.format('0d::ffff:192.1.56.10/96', { leadingZeros: true, doubleColon: false })")){t={...i,...t};let e=o;if(e=t.doubleColon?(t.verbose&&console.info("ipv6.format() » Replacing zero series w/ '::'..."),e.replace(/:(?:0+:)+/,"::")):(t.verbose&&console.info("ipv6.format() » Expanding '::' into zero series..."),i=e.split(":").filter(Boolean).length,r=t.leadingZeros?"0000":"0",i=Array(8-i).fill(r).join(":"),e.replace("::",`:${i}:`)),t.leadingZeros){t.verbose&&console.info("ipv6.format() » Adding leading zeros...");var n=e.split(":");for(let e=0;e<n.length;e++)for(;n[e].length<4;)n[e]="0"+n[e];e=n.join(":")}else t.verbose&&console.info("ipv6.format() » Stripping leading zeros..."),e=o.replace(/(^|(?<=:))0+(?!:)/g,"$1");return t.verbose&&(e!=o?console.info("ipv6.format() » IP formatted successfully!"):console.info("ipv6.format() » IP already formatted to specs."),console.info("ipv6.format() » "+e)),e}}else console.error(`ipv6.format() » ERROR: ${o} is not a valid IPv6 address.`),console.info("ipv6.format() » For more help, please visit "+e)},validate:function(e,o={}){var t="https://docs.generate-ip.org/#ipv6validateaddress-options",r={verbose:!0};if("string"!=typeof e)console.error("ipv6.validate() » ERROR: 1st arg <address> must be a string."),console.info("ipv6.validate() » For more help, please visit "+t);else if(validateOptions(o,r,t,"ipv6.validate('0:0:0:0:0:ffff:192.1.56.10/96', { verbose: false })")){(o={...r,...o}).verbose&&console.info(`ipv6.validate() » Validating ${e}...`);const i=e.split(/::?/),n=i[i.length-1];t=!(e.includes("::")&&2<e.split("::").length||/:{3,}/.test(e)||i.length<2||8<i.length||i.some(e=>!(/^[\da-f]{1,4}$/i.test(e)||e==n&&ipv4.validate(n.replace(/\/(?:12[0-8]|[1-9]?\d)$/,""),{verbose:!1}))));return o.verbose&&console.info(`ipv6.validate() » IP is ${t?"":"in"}valid IPv6 address!`),t}}},mac={generate:function(o={}){var e={verbose:!0,qty:1};if(validateOptions(o,e,"https://docs.generate-ip.org/#macgenerateoptions","mac.generate({ verbose: false, qty: 2 })")){(o={...e,...o}).verbose&&console.info(`mac.generate() » Generating MAC address${1<o.qty?"es":""}...`);var t=[];if(1<o.qty)for(let e=0;e<o.qty;e++)t.push(this.generate({...o,qty:1,verbose:!1}));else{var[e,r]=Array.from({length:2},()=>{var o=[];for(let e=0;e<3;e++)o.push(randomHex(2));return o.join(":")});t.push(e+":"+r)}e=1<o.qty?t:t[0];return o.verbose&&(console.info(`mac.generate() » MAC address${1<o.qty?"es":""} generated!`),console.info("mac.generate() » "+(1==o.qty?e:e.join(", ")))),e}},validate:function(e,o={}){var t="https://docs.generate-ip.org/#macvalidateaddress-options",r={verbose:!0};if("string"!=typeof e)console.error("mac.validate() » ERROR: 1st arg <address> must be a string."),console.info("mac.validate() » For more help, please visit "+t);else if(validateOptions(o,r,t,"mac.validate('00:1A:2B:3C:4D:5E', { verbose: false })"))return(o={...r,...o}).verbose&&console.info(`mac.validate() » Validating ${e}...`),t=/^(?:[\da-f]{2}[:-]){5}[\da-f]{2}$/i.test(e),o.verbose&&console.info(`mac.validate() » Address is ${t?"":"in"}valid MAC address!`),t}};function randomInt(e,o){var t;return"undefined"==typeof require?(t=(window.crypto||window.msCrypto)?.getRandomValues(new Uint32Array(1))[0]/4294967295||Math.random(),Math.floor(t*(o-e))+e):require("crypto").randomInt(e,o)}function randomHex(o){let t="";for(let e=0;e<o;e++)t+=randomInt(0,16).toString(16);return t}function validateOptions(e,o,t,r){const i=JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),n=Object.keys(o).join(", "),s=Object.keys(o).filter(e=>"boolean"==typeof o[e]),a=Object.keys(o).filter(e=>Number.isInteger(o[e]));let l="validateOptions() » ";try{l=validateOptions.caller?.name+"() » "}catch(e){}var v=r.split(",").findIndex(e=>e.trim().startsWith("{"))+1,p=(v+=["st","nd","rd"][v-1]||"th",()=>{console.info(`${l}Valid options: [ ${n} ]`),console.info(l+"If omitted, default settings are: "+i)}),d=()=>{console.info(l+"For more help, please visit "+t)};if("object"!=typeof e)return console.error(l+`ERROR: ${"0th"==v?"[O":v+" arg [o"}ptions] can only be an object of key/values.`),console.info(l+"Example valid call: "+r),p(),d(),!1;for(const f in e){if(!Object.prototype.hasOwnProperty.call(o,f))return console.error(`${l}ERROR: \`${f}\` is an invalid option.`),p(),d(),!1;if(s.includes(f)&&"boolean"!=typeof e[f])return console.error(`${l}ERROR: [${f}] option can only be \`true\` or \`false\`.`),d(),!1;if(a.includes(f)&&(e[f]=parseInt(e[f],10),isNaN(e[f])||e[f]<1))return console.error(`${l}ERROR: [${f}] option can only be an integer > 0.`),d(),!1}return!0}const gipAliases={ipv4:["ipV4","IPv4","IPV4","Ipv4","IpV4","ip","IP","Ip"],ipv6:["ipV6","IPv6","IPV6","Ipv6","IpV6"],mac:["MAC","Mac","ethernet","Ethernet"]};try{module.exports={ipv4:ipv4,ipv6:ipv6,mac:mac}}catch(e){}try{window.ipv4=ipv4,window.ipv6=ipv6,window.mac=mac}catch(e){}for(const Ma in gipAliases)gipAliases[Ma].forEach(e=>{try{module.exports[e]=module.exports[Ma]}catch(e){}try{window[e]=window[Ma]}catch(e){}});
6
+ const ipv4={generate:function(o={}){var e={verbose:!0,qty:1};if(validateOptions(o,e,"https://docs.generate-ip.org/#ipv4generateoptions","ipv4.generate({ verbose: false, qty: 3 })")){(o={...e,...o}).verbose&&console.info(`ipv4.generate() » Generating IPv4 address${1<o.qty?"es":""}...`);var t=[];if(1<o.qty)for(let e=0;e<o.qty;e++)t.push(this.generate({...o,qty:1,verbose:!1}));else{var r=[];for(let e=0;e<4;e++)r.push(randomInt(0,256));t.push(r.join("."))}e=1<o.qty?t:t[0];return o.verbose&&(console.info(`ipv4.generate() » IPv4 address${1<o.qty?"es":""} generated!`),console.info("ipv4.generate() » "+(1==o.qty?e:e.join(", ")))),e}},validate:function(e,o={}){var t="https://docs.generate-ip.org/#ipv4validateaddress-options",r={verbose:!0};if("string"!=typeof e)console.error("ipv4.validate() » ERROR: 1st arg <address> must be a string."),console.info("ipv4.validate() » For more help, please visit "+t);else if(validateOptions(o,r,t,"ipv4.validate('0.0.255.255', { verbose: false })"))return(o={...r,...o}).verbose&&console.info(`ipv4.validate() » Validating ${e}...`),r=!(4!=(t=e.split(".")).length||t.some(e=>!/^\d+$/.test(e)||parseInt(e,10)<0||255<parseInt(e,10))),o.verbose&&console.info(`ipv4.validate() » IP is ${r?"":"in"}valid IPv4 address!`),r}},ipv6={generate:function(o={}){var e={verbose:!0,qty:1,leadingZeros:!1,doubleColon:!0};if(validateOptions(o,e,"https://docs.generate-ip.org/#ipv6generateoptions","ipv6.generate({ leadingZeros: true, qty: 5 })")){(o={...e,...o}).verbose&&console.info(`ipv6.generate() » Generating IPv6 address${1<o.qty?"es":""}...`);var t=[];if(1<o.qty)for(let e=0;e<o.qty;e++)t.push(this.generate({...o,qty:1,verbose:!1}));else{const i=[],{qty:s,...n}=o;for(let e=0;e<8;e++){var r=randomHex(4);i.push(r)}t.push(this.format(i.join(":"),{...n,verbose:!1}))}e=1<o.qty?t:t[0];return o.verbose&&(console.info(`ipv6.generate() » IPv6 address${1<o.qty?"es":""} generated!`),console.info("ipv6.generate() » "+(1==o.qty?e:e.join(", ")))),e}},format:function(o,t={}){var r,e="https://docs.generate-ip.org/#ipv6formatipv6address-options",i={verbose:!0,leadingZeros:!1,doubleColon:!0};if("string"!=typeof o)console.error("ipv6.format() » ERROR: 1st arg <ipv6address> must be a string."),console.info("ipv6.format() » For more help, please visit "+e);else if(this.validate(o,{verbose:!1})){if(validateOptions(t,i,e,"ipv6.format('0d::ffff:192.1.56.10/96', { leadingZeros: true, doubleColon: false })")){t={...i,...t};let e=o;if(e=t.doubleColon?(t.verbose&&console.info("ipv6.format() » Replacing zero series w/ '::'..."),e.replace(/:(?:0+:)+/,"::")):(t.verbose&&console.info("ipv6.format() » Expanding '::' into zero series..."),i=e.split(":").filter(Boolean).length,r=t.leadingZeros?"0000":"0",i=Array(8-i).fill(r).join(":"),e.replace("::",`:${i}:`)),t.leadingZeros){t.verbose&&console.info("ipv6.format() » Adding leading zeros...");var s=e.split(":");for(let e=0;e<s.length;e++)for(;s[e].length<4;)s[e]="0"+s[e];e=s.join(":")}else t.verbose&&console.info("ipv6.format() » Stripping leading zeros..."),e=o.replace(/(^|(?<=:))0+(?!:)/g,"$1");return t.verbose&&(e!=o?console.info("ipv6.format() » IP formatted successfully!"):console.info("ipv6.format() » IP already formatted to specs."),console.info("ipv6.format() » "+e)),e}}else console.error(`ipv6.format() » ERROR: ${o} is not a valid IPv6 address.`),console.info("ipv6.format() » For more help, please visit "+e)},validate:function(e,o={}){var t="https://docs.generate-ip.org/#ipv6validateaddress-options",r={verbose:!0};if("string"!=typeof e)console.error("ipv6.validate() » ERROR: 1st arg <address> must be a string."),console.info("ipv6.validate() » For more help, please visit "+t);else if(validateOptions(o,r,t,"ipv6.validate('0:0:0:0:0:ffff:192.1.56.10/96', { verbose: false })")){(o={...r,...o}).verbose&&console.info(`ipv6.validate() » Validating ${e}...`);const i=e.split(/::?/),s=i[i.length-1];t=!(e.includes("::")&&2<e.split("::").length||/:{3,}/.test(e)||i.length<2||8<i.length||i.some(e=>!(/^[\da-f]{1,4}$/i.test(e)||e==s&&ipv4.validate(s.replace(/\/(?:12[0-8]|[1-9]?\d)$/,""),{verbose:!1}))));return o.verbose&&console.info(`ipv6.validate() » IP is ${t?"":"in"}valid IPv6 address!`),t}}},mac={generate:function(o={}){var e={verbose:!0,qty:1};if(validateOptions(o,e,"https://docs.generate-ip.org/#macgenerateoptions","mac.generate({ verbose: false, qty: 2 })")){(o={...e,...o}).verbose&&console.info(`mac.generate() » Generating MAC address${1<o.qty?"es":""}...`);var t=[];if(1<o.qty)for(let e=0;e<o.qty;e++)t.push(this.generate({...o,qty:1,verbose:!1}));else{var[e,r]=Array.from({length:2},()=>{var o=[];for(let e=0;e<3;e++)o.push(randomHex(2));return o.join(":")});t.push(e+":"+r)}e=1<o.qty?t:t[0];return o.verbose&&(console.info(`mac.generate() » MAC address${1<o.qty?"es":""} generated!`),console.info("mac.generate() » "+(1==o.qty?e:e.join(", ")))),e}},validate:function(e,o={}){var t="https://docs.generate-ip.org/#macvalidateaddress-options",r={verbose:!0};if("string"!=typeof e)console.error("mac.validate() » ERROR: 1st arg <address> must be a string."),console.info("mac.validate() » For more help, please visit "+t);else if(validateOptions(o,r,t,"mac.validate('00:1A:2B:3C:4D:5E', { verbose: false })"))return(o={...r,...o}).verbose&&console.info(`mac.validate() » Validating ${e}...`),t=/^(?:[\da-f]{2}[:-]){5}[\da-f]{2}$/i.test(e),o.verbose&&console.info(`mac.validate() » Address is ${t?"":"in"}valid MAC address!`),t}};function randomInt(e,o){var t;return"undefined"==typeof require?(t=(window.crypto||window.msCrypto)?.getRandomValues(new Uint32Array(1))[0]/4294967295||Math.random(),Math.floor(t*(o-e))+e):require("crypto").randomInt(e,o)}function randomHex(o){let t="";for(let e=0;e<o;e++)t+=randomInt(0,16).toString(16);return t}function validateOptions(e,o,t,r){const i=JSON.stringify(o,void 0,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),s=Object.keys(o).join(", "),n=Object.keys(o).filter(e=>"boolean"==typeof o[e]),a=Object.keys(o).filter(e=>Number.isInteger(o[e])),l=`${validateOptions.caller?.name||"validateOptions"}() » `;var v=r.split(",").findIndex(e=>e.trim().startsWith("{"))+1,p=(v+=["st","nd","rd"][v-1]||"th",()=>{console.info(l+`Valid options: [ ${s} ]`),console.info(l+"If omitted, default settings are: "+i)}),d=()=>{console.info(l+"For more help, please visit "+t)};if("object"!=typeof e)return console.error(l+`ERROR: ${"0th"==v?"[O":v+" arg [o"}ptions] can only be an object of key/values.`),console.info(l+"Example valid call: "+r),p(),d(),!1;for(const f in e){if(!Object.prototype.hasOwnProperty.call(o,f))return console.error(l+`ERROR: \`${f}\` is an invalid option.`),p(),d(),!1;if(n.includes(f)&&"boolean"!=typeof e[f])return console.error(l+`ERROR: [${f}] option can only be \`true\` or \`false\`.`),d(),!1;if(a.includes(f)&&(e[f]=parseInt(e[f],10),isNaN(e[f])||e[f]<1))return console.error(l+`ERROR: [${f}] option can only be an integer > 0.`),d(),!1}return!0}const gipAliases={ipv4:["ipV4","IPv4","IPV4","Ipv4","IpV4","ip","IP","Ip"],ipv6:["ipV6","IPv6","IPV6","Ipv6","IpV6"],mac:["MAC","Mac","ethernet","Ethernet"]};try{module.exports={ipv4:ipv4,ipv6:ipv6,mac:mac}}catch(e){}try{window.ipv4=ipv4,window.ipv6=ipv6,window.mac=mac}catch(e){}for(const La in gipAliases)gipAliases[La].forEach(e=>{try{module.exports[e]=module.exports[La]}catch(e){}try{window[e]=window[La]}catch(e){}});
package/docs/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🏛️ MIT License
2
2
 
3
- **Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors**
3
+ **Copyright © 2024–2026 [Adam Lui](https://github.com/adamlui) & contributors**
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/docs/README.md CHANGED
@@ -6,17 +6,24 @@
6
6
 
7
7
  <br>
8
8
 
9
- <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
10
- <a href="https://github.com/adamlui/js-utils/releases/tag/generate-ip-2.4.4"><img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.4-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
- <a href="https://www.npmjs.com/package/generate-ip?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/generate-ip?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
12
- <a href="https://github.com/adamlui/js-utils/blob/generate-ip-2.4.4/generate-ip/dist/generate-ip.min.js"><img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/generate-ip/dist/generate-ip.min.js?branch=generate-ip-2.4.4&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
13
- <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-ip/src/generate-ip.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Agenerate-ip%2Fsrc%2Fgenerate-ip.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
14
- <a href="https://github.com/toolleeo/cli-apps#networking"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
15
- <a href="https://www.jsdelivr.com/package/npm/generate-ip?tab=stats"><img height=31 src="https://img.shields.io/jsdelivr/npm/hm/generate-ip?style=for-the-badge&logo=jsdelivr&logoColor=white&label=jsDelivr%20Hits&labelColor=464646&color=49c5d8"></a>
9
+ <a href="#%EF%B8%8F-mit-license">
10
+ <img height=31 src="https://img.shields.io/badge/License-MIT-fc4f2d.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
+ <a href="https://github.com/adamlui/js-utils/releases/tag/generate-ip-2.4.6">
12
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.6-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
13
+ <a href="https://www.npmjs.com/package/generate-ip?activeTab=code">
14
+ <img height=31 src="https://img.shields.io/npm/unpacked-size/generate-ip?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
15
+ <a href="https://github.com/adamlui/js-utils/blob/generate-ip-2.4.6/generate-ip/dist/generate-ip.min.js">
16
+ <img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/generate-ip/dist/generate-ip.min.js?branch=generate-ip-2.4.6&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
17
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:generate-ip/src/generate-ip.js">
18
+ <img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Agenerate-ip%2Fsrc%2Fgenerate-ip.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
19
+ <a href="https://github.com/toolleeo/cli-apps#networking">
20
+ <img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
21
+ <a href="https://www.jsdelivr.com/package/npm/generate-ip?tab=stats">
22
+ <img height=31 src="https://img.shields.io/jsdelivr/npm/hm/generate-ip?style=for-the-badge&logo=jsdelivr&logoColor=white&label=jsDelivr%20Hits&labelColor=464646&color=49c5d8"></a>
16
23
 
17
24
  </div>
18
25
 
19
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
26
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
20
27
 
21
28
  ## 💡 About
22
29
 
@@ -27,7 +34,7 @@
27
34
  - **Multi-environment support —** Use in Node.js or the web browser
28
35
  - **Command line usable —** Just type `generate-ip`, that's it
29
36
 
30
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
37
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
31
38
 
32
39
  ## ⚡ Installation
33
40
 
@@ -51,13 +58,13 @@ $ npm install generate-ip
51
58
 
52
59
  <br>
53
60
 
54
- <a href="https://github.com/sponsors/adamlui"><img src="https://media.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?09f5d64"></a>
61
+ <a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
55
62
 
56
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
63
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
57
64
 
58
65
  ## 🔌 Importing the APIs
59
66
 
60
- ### <img height=18 src="https://media.js-utils.org/images/icons/platforms/node.js/icon25x28.png?3e22bae"> Node.js
67
+ ### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
61
68
 
62
69
  #### ECMAScript*:
63
70
 
@@ -73,28 +80,28 @@ const { ipv4, ipv6, mac } = require('generate-ip');
73
80
 
74
81
  ###### _*Node.js version 14 or higher required_
75
82
 
76
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.org/images/icons/platforms/web/light/icon25.png?3e22bae"><img width=16 src="https://media.js-utils.org/images/icons/platforms/web/dark/icon25.png?3e22bae"></picture> Web
83
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/platforms/web/light/icon25.png?v=0d36e26"><img width=16 src="https://assets.js-utils.org/images/icons/platforms/web/dark/icon25.png?v=0d36e26"></picture> Web
77
84
 
78
85
  #### <> HTML script tag:
79
86
 
80
87
  ```html
81
- <script src="https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js"></script>
88
+ <script src="https://cdn.jsdelivr.net/npm/generate-ip@2.4.6/dist/generate-ip.min.js"></script>
82
89
  ```
83
90
 
84
91
  #### ES6:
85
92
 
86
93
  ```js
87
94
  (async () => {
88
- await import('https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js');
95
+ await import('https://cdn.jsdelivr.net/npm/generate-ip@2.4.6/dist/generate-ip.min.js');
89
96
  // Your code here...
90
97
  })();
91
98
  ```
92
99
 
93
- ### <img height=17 src="https://media.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?4fd2fa7"><img height=17.5 src="https://media.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?2fe972c"> Greasemonkey
100
+ ### <img height=17 src="https://assets.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?v=0d36e26"><img height=17.5 src="https://assets.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?v=0d36e26"> Greasemonkey
94
101
 
95
102
  ```js
96
103
  ...
97
- // @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.4/dist/generate-ip.min.js
104
+ // @require https://cdn.jsdelivr.net/npm/generate-ip@2.4.6/dist/generate-ip.min.js
98
105
  // ==/UserScript==
99
106
 
100
107
  // Your code here...
@@ -102,11 +109,11 @@ const { ipv4, ipv6, mac } = require('generate-ip');
102
109
 
103
110
  <br>
104
111
 
105
- 📝 **Note:** To always import the latest version (not recommended in production!) remove the `@2.4.4` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-ip/dist/generate-ip.min.js`
112
+ 📝 **Note:** To always import the latest version (not recommended in production!) remove the `@2.4.6` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/generate-ip/dist/generate-ip.min.js`
106
113
 
107
114
  <br>
108
115
 
109
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
116
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
110
117
 
111
118
  ## 📋 API usage
112
119
 
@@ -337,7 +344,7 @@ Name | Type | Description | Default Value
337
344
 
338
345
  <br>
339
346
 
340
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
347
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
341
348
 
342
349
  ## 💻 Command line usage
343
350
 
@@ -349,7 +356,7 @@ $ generate-ip
349
356
 
350
357
  Sample output:
351
358
 
352
- <img src="https://media.generate-ip.org/images/screenshots/cli/generate-ip-cmd-output.png?7b16322">
359
+ <img src="https://media.generate-ip.org/images/screenshots/cli/generate-ip-cmd-output.png?0d36e26">
353
360
 
354
361
  📝 **Note:** To generate other address types, type `generate-ipv6` or `generate-mac`
355
362
 
@@ -373,11 +380,11 @@ Info commands:
373
380
 
374
381
  <br>
375
382
 
376
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
383
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
377
384
 
378
385
  ## 🏛️ MIT License
379
386
 
380
- **Copyright © 2024 [Adam Lui](https://github.com/adamlui) & contributors.**
387
+ **Copyright © 2024–2026 [Adam Lui](https://github.com/adamlui) & contributors.**
381
388
 
382
389
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
383
390
 
@@ -387,32 +394,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
387
394
 
388
395
  <br>
389
396
 
390
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
397
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
391
398
 
392
399
  ## 🛠️ Related utilities
393
400
 
394
- ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://media.js-utils.org/images/badges/awesome/badge.svg?7b16322"></a>
401
+ ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
395
402
 
396
403
  > Randomly generate, strengthen, and validate cryptographically-secure passwords.
397
404
  <br>[Install](https://docs.generatepw.org/#-installation) /
398
405
  [Readme](https://docs.generatepw.org/#readme) /
399
406
  [API usage](https://docs.generatepw.org/#-api-usage) /
400
407
  [CLI usage](https://docs.generatepw.org/#-command-line-usage) /
401
- [Discuss](https://github.js-utils.org/discussions)
408
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
402
409
 
403
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?e735b99"><img height=22 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?e735b99"></picture> [geolocate](https://js-utils.org/geolocate) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://media.js-utils.org/images/badges/awesome/badge.svg?7b16322"></a>
410
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?0d36e26"><img height=22 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?0d36e26"></picture> [geolocate](https://js-utils.org/geolocate) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
404
411
 
405
412
  > Fetch IP geolocation data from the CLI.
406
413
  <br>[Install](https://docs.geolocatejs.org/#-installation) /
407
414
  [Readme](https://docs.geolocatejs.org/#readme) /
408
415
  [CLI usage](https://docs.geolocatejs.org/#-command-line-usage) /
409
416
  [API usage](https://docs.geolocatejs.org/#-api-usage) /
410
- [Discuss](https://github.js-utils.org/discussions)
417
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
411
418
 
412
419
  <br>
413
420
 
414
- <img height=6px width="100%" src="https://media.js-utils.org/images/separators/gradient-aqua.png?c0192d3">
421
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
415
422
 
416
- <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.org/images/icons/home/white/icon32x27.png?e735b99"><img height=13 src="https://media.js-utils.org/images/icons/home/dark-gray/icon32x27.png?e735b99"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
417
- <a href="https://github.js-utils.org/discussions">Discuss</a> /
423
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/home/white/icon32x27.png?v=0d36e26"><img height=13 src="https://assets.js-utils.org/images/icons/home/dark-gray/icon32x27.png?v=0d36e26"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
424
+ <a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
418
425
  <a href="#-generate-ip">Back to top ↑</a>
package/docs/SECURITY.md CHANGED
@@ -1,5 +1,3 @@
1
1
  # 🛡️ Security Policy
2
2
 
3
- If you find a vulnerability, please open a [draft security advisory](https://github.js-utils.org/security/advisories/new).
4
-
5
- Pull requests are also welcome, but for safety reasons, send an email to <adam@kudoai.com> and wait for a response before making it public.
3
+ If you find a vulnerability, please follow the reporting instructions @ https://tidelift.com/security
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generate-ip",
3
- "version": "2.4.4",
3
+ "version": "2.4.6",
4
4
  "description": "Randomly generate, format, and validate IPv4 + IPv6 + MAC addresses.",
5
5
  "author": {
6
6
  "name": "Adam Lui",
@@ -10,6 +10,10 @@
10
10
  "homepage": "https://generate-ip.org",
11
11
  "license": "MIT",
12
12
  "funding": [
13
+ {
14
+ "type": "cashapp",
15
+ "url": "https://cash.app/$AdamLui"
16
+ },
13
17
  {
14
18
  "type": "github",
15
19
  "url": "http://github.com/sponsors/adamlui"
@@ -17,6 +21,10 @@
17
21
  {
18
22
  "type": "ko-fi",
19
23
  "url": "https://ko-fi.com/adamlui"
24
+ },
25
+ {
26
+ "type": "paypal",
27
+ "url": "https://paypal.me/adamlui"
20
28
  }
21
29
  ],
22
30
  "main": "dist/generate-ip.min.js",
@@ -29,14 +37,10 @@
29
37
  "doc": "./docs"
30
38
  },
31
39
  "scripts": {
32
- "test": "echo \"Error: no test specified\" && exit 1",
33
40
  "build": "bash utils/build.sh",
34
41
  "bump:patch": "bash utils/bump.sh patch",
35
42
  "bump:minor": "bash utils/bump.sh minor",
36
- "bump:major": "bash utils/bump.sh major",
37
- "publish:patch": "bash utils/bump.sh patch --publish",
38
- "publish:minor": "bash utils/bump.sh minor --publish",
39
- "publish:major": "bash utils/bump.sh major --publish"
43
+ "bump:major": "bash utils/bump.sh major"
40
44
  },
41
45
  "repository": {
42
46
  "type": "git",
@@ -58,6 +62,6 @@
58
62
  "url": "https://support.generate-ip.org"
59
63
  },
60
64
  "devDependencies": {
61
- "@adamlui/minify.js": "^1.8.5"
65
+ "@adamlui/minify.js": "^1.8.6"
62
66
  }
63
67
  }