08-27-周三_17-09-29

This commit is contained in:
2025-08-27 17:10:05 +08:00
commit 86df397d8f
12735 changed files with 1145479 additions and 0 deletions

21
node_modules/is-my-ip-valid/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Linus Unnebäck
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,19 @@
[
" 127.0.0.1",
"127.0.0.1 ",
"127.0.0.1 127.0.0.1",
"127.0.0.256",
"127.0.0.1//1",
"127.0.0.1/0x1",
"127.0.0.1/-1",
"127.0.0.1/ab",
"127.0.0.1/",
"127.0.0.256/32",
"127.0.0.1/33",
"001.002.003.004",
" ----- Valid but with subnets ----- ",
"127.0.0.1/02",
"127.0.0.1/32",
"255.255.255.255/32"
]

View File

@@ -0,0 +1,335 @@
[
"':10.0.0.1",
"-1",
"::1 ::1",
"02001:0000:1234:0000:0000:C1C0:ABCD:0876",
"1.2.3.4",
"1.2.3.4:1111:2222:3333:4444::5555",
"1.2.3.4:1111:2222:3333::5555",
"1.2.3.4:1111:2222::5555",
"1.2.3.4:1111::5555",
"1.2.3.4::",
"1.2.3.4::5555",
"1111",
"11112222:3333:4444:5555:6666:1.2.3.4",
"11112222:3333:4444:5555:6666:7777:8888",
"::1//64",
"::1/0001",
"1111:",
"1111:1.2.3.4",
"1111:2222",
"1111:22223333:4444:5555:6666:1.2.3.4",
"1111:22223333:4444:5555:6666:7777:8888",
"1111:2222:",
"1111:2222:1.2.3.4",
"1111:2222:3333",
"1111:2222:33334444:5555:6666:1.2.3.4",
"1111:2222:33334444:5555:6666:7777:8888",
"1111:2222:3333:",
"1111:2222:3333:1.2.3.4",
"1111:2222:3333:4444",
"1111:2222:3333:44445555:6666:1.2.3.4",
"1111:2222:3333:44445555:6666:7777:8888",
"1111:2222:3333:4444:",
"1111:2222:3333:4444:1.2.3.4",
"1111:2222:3333:4444:5555",
"1111:2222:3333:4444:55556666:1.2.3.4",
"1111:2222:3333:4444:55556666:7777:8888",
"1111:2222:3333:4444:5555:",
"1111:2222:3333:4444:5555:1.2.3.4",
"1111:2222:3333:4444:5555:6666",
"1111:2222:3333:4444:5555:66661.2.3.4",
"1111:2222:3333:4444:5555:66667777:8888",
"1111:2222:3333:4444:5555:6666:",
"1111:2222:3333:4444:5555:6666:00.00.00.00",
"1111:2222:3333:4444:5555:6666:000.000.000.000",
"1111:2222:3333:4444:5555:6666:1.2.3.4.5",
"1111:2222:3333:4444:5555:6666:255.255.255255",
"1111:2222:3333:4444:5555:6666:255.255255.255",
"1111:2222:3333:4444:5555:6666:255255.255.255",
"1111:2222:3333:4444:5555:6666:256.256.256.256",
"1111:2222:3333:4444:5555:6666:7777",
"1111:2222:3333:4444:5555:6666:77778888",
"1111:2222:3333:4444:5555:6666:7777:",
"1111:2222:3333:4444:5555:6666:7777:1.2.3.4",
"1111:2222:3333:4444:5555:6666:7777:8888:",
"1111:2222:3333:4444:5555:6666:7777:8888:1.2.3.4",
"1111:2222:3333:4444:5555:6666:7777:8888:9999",
"1111:2222:3333:4444:5555:6666:7777:8888::",
"1111:2222:3333:4444:5555:6666:7777:::",
"1111:2222:3333:4444:5555:6666::1.2.3.4",
"1111:2222:3333:4444:5555:6666::8888:",
"1111:2222:3333:4444:5555:6666:::",
"1111:2222:3333:4444:5555:6666:::8888",
"1111:2222:3333:4444:5555::7777:8888:",
"1111:2222:3333:4444:5555::7777::",
"1111:2222:3333:4444:5555::8888:",
"1111:2222:3333:4444:5555:::",
"1111:2222:3333:4444:5555:::1.2.3.4",
"1111:2222:3333:4444:5555:::7777:8888",
"1111:2222:3333:4444::5555:",
"1111:2222:3333:4444::6666:7777:8888:",
"1111:2222:3333:4444::6666:7777::",
"1111:2222:3333:4444::6666::8888",
"1111:2222:3333:4444::7777:8888:",
"1111:2222:3333:4444::8888:",
"1111:2222:3333:4444:::",
"1111:2222:3333:4444:::6666:1.2.3.4",
"1111:2222:3333:4444:::6666:7777:8888",
"1111:2222:3333::5555:",
"1111:2222:3333::5555:6666:7777:8888:",
"1111:2222:3333::5555:6666:7777::",
"1111:2222:3333::5555:6666::8888",
"1111:2222:3333::5555::1.2.3.4",
"1111:2222:3333::5555::7777:8888",
"1111:2222:3333::6666:7777:8888:",
"1111:2222:3333::7777:8888:",
"1111:2222:3333::8888:",
"1111:2222:3333:::",
"1111:2222:3333:::5555:6666:1.2.3.4",
"1111:2222:3333:::5555:6666:7777:8888",
"1111:2222::4444:5555:6666:7777:8888:",
"1111:2222::4444:5555:6666:7777::",
"1111:2222::4444:5555:6666::8888",
"1111:2222::4444:5555::1.2.3.4",
"1111:2222::4444:5555::7777:8888",
"1111:2222::4444::6666:1.2.3.4",
"1111:2222::4444::6666:7777:8888",
"1111:2222::5555:",
"1111:2222::5555:6666:7777:8888:",
"1111:2222::6666:7777:8888:",
"1111:2222::7777:8888:",
"1111:2222::8888:",
"1111:2222:::",
"1111:2222:::4444:5555:6666:1.2.3.4",
"1111:2222:::4444:5555:6666:7777:8888",
"1111::3333:4444:5555:6666:7777:8888:",
"1111::3333:4444:5555:6666:7777::",
"1111::3333:4444:5555:6666::8888",
"1111::3333:4444:5555::1.2.3.4",
"1111::3333:4444:5555::7777:8888",
"1111::3333:4444::6666:1.2.3.4",
"1111::3333:4444::6666:7777:8888",
"1111::3333::5555:6666:1.2.3.4",
"1111::3333::5555:6666:7777:8888",
"1111::4444:5555:6666:7777:8888:",
"1111::5555:",
"1111::5555:6666:7777:8888:",
"1111::6666:7777:8888:",
"1111::7777:8888:",
"1111::8888:",
"1111:::",
"1111:::3333:4444:5555:6666:1.2.3.4",
"1111:::3333:4444:5555:6666:7777:8888",
"123",
"12345::6:7:8",
"124.15.6.89/60",
"1:2:3:4:5:6:7:8:9",
"1:2:3::4:5:6:7:8:9",
"1:2:3::4:5::7:8",
"1::1.2.256.4",
"1::1.2.3.256",
"1::1.2.3.300",
"1::1.2.3.900",
"1::1.2.300.4",
"1::1.2.900.4",
"1::1.256.3.4",
"1::1.300.3.4",
"1::1.900.3.4",
"1::256.2.3.4",
"1::260.2.3.4",
"1::2::3",
"1::300.2.3.4",
"1::300.300.300.300",
"1::3000.30.30.30",
"1::400.2.3.4",
"1::5:1.2.256.4",
"1::5:1.2.3.256",
"1::5:1.2.3.300",
"1::5:1.2.3.900",
"1::5:1.2.300.4",
"1::5:1.2.900.4",
"1::5:1.256.3.4",
"1::5:1.300.3.4",
"1::5:1.900.3.4",
"1::5:256.2.3.4",
"1::5:260.2.3.4",
"1::5:300.2.3.4",
"1::5:300.300.300.300",
"1::5:3000.30.30.30",
"1::5:400.2.3.4",
"1::5:900.2.3.4",
"1::900.2.3.4",
"1:::3:4:5",
"2001:0000:1234: 0000:0000:C1C0:ABCD:0876",
"2001:0000:1234:0000:00001:C1C0:ABCD:0876",
"2001:0000:1234:0000:0000:C1C0:ABCD:0876 0",
"2001:1:1:1:1:1:255Z255X255Y255",
"2001::FFD3::57ab",
"2001:DB8:0:0:8:800:200C:417A:221",
"2001:db8:85a3::8a2e:37023:7334",
"2001:db8:85a3::8a2e:370k:7334",
"3ffe:0b00:0000:0001:0000:0000:000a",
"3ffe:b00::1::a",
":",
":1.2.3.4",
":1111:2222:3333:4444:5555:6666:1.2.3.4",
":1111:2222:3333:4444:5555:6666:7777:8888",
":1111:2222:3333:4444:5555:6666:7777::",
":1111:2222:3333:4444:5555:6666::",
":1111:2222:3333:4444:5555:6666::8888",
":1111:2222:3333:4444:5555::",
":1111:2222:3333:4444:5555::1.2.3.4",
":1111:2222:3333:4444:5555::7777:8888",
":1111:2222:3333:4444:5555::8888",
":1111:2222:3333:4444::",
":1111:2222:3333:4444::1.2.3.4",
":1111:2222:3333:4444::5555",
":1111:2222:3333:4444::6666:1.2.3.4",
":1111:2222:3333:4444::6666:7777:8888",
":1111:2222:3333:4444::7777:8888",
":1111:2222:3333:4444::8888",
":1111:2222:3333::",
":1111:2222:3333::1.2.3.4",
":1111:2222:3333::5555",
":1111:2222:3333::5555:6666:1.2.3.4",
":1111:2222:3333::5555:6666:7777:8888",
":1111:2222:3333::6666:1.2.3.4",
":1111:2222:3333::6666:7777:8888",
":1111:2222:3333::7777:8888",
":1111:2222:3333::8888",
":1111:2222::",
":1111:2222::1.2.3.4",
":1111:2222::4444:5555:6666:1.2.3.4",
":1111:2222::4444:5555:6666:7777:8888",
":1111:2222::5555",
":1111:2222::5555:6666:1.2.3.4",
":1111:2222::5555:6666:7777:8888",
":1111:2222::6666:1.2.3.4",
":1111:2222::6666:7777:8888",
":1111:2222::7777:8888",
":1111:2222::8888",
":1111::",
":1111::1.2.3.4",
":1111::3333:4444:5555:6666:1.2.3.4",
":1111::3333:4444:5555:6666:7777:8888",
":1111::4444:5555:6666:1.2.3.4",
":1111::4444:5555:6666:7777:8888",
":1111::5555",
":1111::5555:6666:1.2.3.4",
":1111::5555:6666:7777:8888",
":1111::6666:1.2.3.4",
":1111::6666:7777:8888",
":1111::7777:8888",
":1111::8888",
":2222:3333:4444:5555:6666:1.2.3.4",
":2222:3333:4444:5555:6666:7777:8888",
":3333:4444:5555:6666:1.2.3.4",
":3333:4444:5555:6666:7777:8888",
":4444:5555:6666:1.2.3.4",
":4444:5555:6666:7777:8888",
":5555:6666:1.2.3.4",
":5555:6666:7777:8888",
":6666:1.2.3.4",
":6666:7777:8888",
":7777:8888",
":8888",
"::-1",
"::.",
"::..",
"::...",
"::...4",
"::..3.",
"::..3.4",
"::.2..",
"::.2.3.",
"::.2.3.4",
"::1...",
"::1.2..",
"::1.2.256.4",
"::1.2.3.",
"::1.2.3.256",
"::1.2.3.300",
"::1.2.3.900",
"::1.2.300.4",
"::1.2.900.4",
"::1.256.3.4",
"::1.300.3.4",
"::1.900.3.4",
"::1111:2222:3333:4444:5555:6666::",
"::2222:3333:4444:5555:6666:7777:1.2.3.4",
"::2222:3333:4444:5555:6666:7777:8888:",
"::2222:3333:4444:5555:6666:7777:8888:9999",
"::2222:3333:4444:5555:7777:8888::",
"::2222:3333:4444:5555:7777::8888",
"::2222:3333:4444:5555::1.2.3.4",
"::2222:3333:4444:5555::7777:8888",
"::2222:3333:4444::6666:1.2.3.4",
"::2222:3333:4444::6666:7777:8888",
"::2222:3333::5555:6666:1.2.3.4",
"::2222:3333::5555:6666:7777:8888",
"::2222::4444:5555:6666:1.2.3.4",
"::2222::4444:5555:6666:7777:8888",
"::256.2.3.4",
"::260.2.3.4",
"::300.2.3.4",
"::300.300.300.300",
"::3000.30.30.30",
"::3333:4444:5555:6666:7777:8888:",
"::400.2.3.4",
"::4444:5555:6666:7777:8888:",
"::5555:",
"::5555:6666:7777:8888:",
"::6666:7777:8888:",
"::7777:8888:",
"::8888:",
"::900.2.3.4",
":::",
":::1.2.3.4",
":::2222:3333:4444:5555:6666:1.2.3.4",
":::2222:3333:4444:5555:6666:7777:8888",
":::3333:4444:5555:6666:7777:8888",
":::4444:5555:6666:1.2.3.4",
":::4444:5555:6666:7777:8888",
":::5555",
":::5555:6666:1.2.3.4",
":::5555:6666:7777:8888",
":::6666:1.2.3.4",
":::6666:7777:8888",
":::7777:8888",
":::8888",
"::ffff:192x168.1.26",
"::ffff:2.3.4",
"::ffff:257.1.2.3",
"FF01::101::2",
"FF02:0000:0000:0000:0000:0000:0000:0000:0001",
"XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:1.2.3.4",
"XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX",
"a::b::c",
"a::g",
"a:a:a:a:a:a:a:a:a",
"a:aaaaa::",
"a:b",
"a:b:c:d:e:f:g:0",
"fe80:0000:0000:0000:0204:61ff:254.157.241.086",
"ffff:",
"ffff::ffff::ffff",
"ffgg:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"ldkfj",
"::/129",
"1000:://32",
"::/",
" ----- Valid but with subnets ----- ",
"0000:0000:0000:0000:0000:0000:0000:0000/128",
"0:1:2:3:4:5:6:7/001",
"0:1:2:3:4:5:6:7/128",
"2001:0DB8:0000:CD30:0000:0000:0000:0000/60",
"2001:0DB8:0:CD30::/60",
"2001:0DB8::CD30:0:0:0:0/60",
"::/128",
"::1/128",
"FE80::/10",
"FEC0::/10",
"FF00::/8"
]

View File

@@ -0,0 +1,6 @@
[
"127.0.0.1",
"1.1.1.1",
"255.255.255.255",
"255.1.255.1"
]

View File

@@ -0,0 +1,189 @@
[
"0000:0000:0000:0000:0000:0000:0000:0000",
"0000:0000:0000:0000:0000:0000:0000:0001",
"0:0:0:0:0:0:0:0",
"0:0:0:0:0:0:0:1",
"0:0:0:0:0:0:0::",
"0:0:0:0:0:0:13.1.68.3",
"0:0:0:0:0:0::",
"0:0:0:0:0::",
"0:0:0:0:0:FFFF:129.144.52.38",
"0:0:0:0:1:0:0:0",
"0:0:0:0::",
"0:0:0::",
"0:0::",
"0:1:2:3:4:5:6:7",
"0::",
"0:a:b:c:d:e:f::",
"1080:0:0:0:8:800:200c:417a",
"1080::8:800:200c:417a",
"1111:2222:3333:4444:5555:6666:123.123.123.123",
"1111:2222:3333:4444:5555:6666:7777:8888",
"1111:2222:3333:4444:5555:6666:7777::",
"1111:2222:3333:4444:5555:6666::",
"1111:2222:3333:4444:5555:6666::8888",
"1111:2222:3333:4444:5555::",
"1111:2222:3333:4444:5555::123.123.123.123",
"1111:2222:3333:4444:5555::7777:8888",
"1111:2222:3333:4444:5555::8888",
"1111:2222:3333:4444::",
"1111:2222:3333:4444::123.123.123.123",
"1111:2222:3333:4444::6666:123.123.123.123",
"1111:2222:3333:4444::6666:7777:8888",
"1111:2222:3333:4444::7777:8888",
"1111:2222:3333:4444::8888",
"1111:2222:3333::",
"1111:2222:3333::123.123.123.123",
"1111:2222:3333::5555:6666:123.123.123.123",
"1111:2222:3333::5555:6666:7777:8888",
"1111:2222:3333::6666:123.123.123.123",
"1111:2222:3333::6666:7777:8888",
"1111:2222:3333::7777:8888",
"1111:2222:3333::8888",
"1111:2222::",
"1111:2222::123.123.123.123",
"1111:2222::4444:5555:6666:123.123.123.123",
"1111:2222::4444:5555:6666:7777:8888",
"1111:2222::5555:6666:123.123.123.123",
"1111:2222::5555:6666:7777:8888",
"1111:2222::6666:123.123.123.123",
"1111:2222::6666:7777:8888",
"1111:2222::7777:8888",
"1111:2222::8888",
"1111::",
"1111::123.123.123.123",
"1111::3333:4444:5555:6666:123.123.123.123",
"1111::3333:4444:5555:6666:7777:8888",
"1111::4444:5555:6666:123.123.123.123",
"1111::4444:5555:6666:7777:8888",
"1111::5555:6666:123.123.123.123",
"1111::5555:6666:7777:8888",
"1111::6666:123.123.123.123",
"1111::6666:7777:8888",
"1111::7777:8888",
"1111::8888",
"1:2:3:4:5:6:1.2.3.4",
"1:2:3:4:5:6:7:8",
"1:2:3:4:5:6::",
"1:2:3:4:5:6::8",
"1:2:3:4:5::",
"1:2:3:4:5::1.2.3.4",
"1:2:3:4:5::7:8",
"1:2:3:4:5::8",
"1:2:3:4::",
"1:2:3:4::1.2.3.4",
"1:2:3:4::5:1.2.3.4",
"1:2:3:4::7:8",
"1:2:3:4::8",
"1:2:3::",
"1:2:3::1.2.3.4",
"1:2:3::5:1.2.3.4",
"1:2:3::7:8",
"1:2:3::8",
"1:2::",
"1:2::1.2.3.4",
"1:2::5:1.2.3.4",
"1:2::7:8",
"1:2::8",
"1::",
"1::1.2.3.4",
"1::2:3",
"1::2:3:4",
"1::2:3:4:5",
"1::2:3:4:5:6",
"1::2:3:4:5:6:7",
"1::5:1.2.3.4",
"1::5:11.22.33.44",
"1::7:8",
"1::8",
"2001:0000:1234:0000:0000:C1C0:ABCD:0876",
"2001:0000:4136:e378:8000:63bf:3fff:fdd2",
"2001:0db8:0000:0000:0000:0000:1428:57ab",
"2001:0db8:0000:0000:0000::1428:57ab",
"2001:0db8:0:0:0:0:1428:57ab",
"2001:0db8:0:0::1428:57ab",
"2001:0db8:1234:0000:0000:0000:0000:0000",
"2001:0db8:1234::",
"2001:0db8:1234:ffff:ffff:ffff:ffff:ffff",
"2001:0db8:85a3:0000:0000:8a2e:0370:7334",
"2001:0db8::1428:57ab",
"2001::CE49:7601:2CAD:DFFF:7C94:FFFE",
"2001::CE49:7601:E866:EFFF:62C3:FFFE",
"2001:DB8:0:0:8:800:200C:417A",
"2001:DB8::8:800:200C:417A",
"2001:db8:85a3:0:0:8a2e:370:7334",
"2001:db8:85a3::8a2e:370:7334",
"2001:db8::",
"2001:db8::1428:57ab",
"2001:db8:a::123",
"2002::",
"2608::3:5",
"2608:af09:30:0:0:0:0:134",
"2608:af09:30::102a:7b91:c239:baff",
"2::10",
"3ffe:0b00:0000:0000:0001:0000:0000:000a",
"7:6:5:4:3:2:1:0",
"::",
"::0",
"::0:0",
"::0:0:0",
"::0:0:0:0",
"::0:0:0:0:0",
"::0:0:0:0:0:0",
"::0:0:0:0:0:0:0",
"::0:a:b:c:d:e:f",
"::1",
"::123.123.123.123",
"::13.1.68.3",
"::2222:3333:4444:5555:6666:123.123.123.123",
"::2222:3333:4444:5555:6666:7777:8888",
"::2:3",
"::2:3:4",
"::2:3:4:5",
"::2:3:4:5:6",
"::2:3:4:5:6:7",
"::2:3:4:5:6:7:8",
"::3333:4444:5555:6666:7777:8888",
"::4444:5555:6666:123.123.123.123",
"::4444:5555:6666:7777:8888",
"::5555:6666:123.123.123.123",
"::5555:6666:7777:8888",
"::6666:123.123.123.123",
"::6666:7777:8888",
"::7777:8888",
"::8",
"::8888",
"::FFFF:129.144.52.38",
"::ffff:0:0",
"::ffff:0c22:384e",
"::ffff:12.34.56.78",
"::ffff:192.0.2.128",
"::ffff:192.168.1.1",
"::ffff:192.168.1.26",
"::ffff:c000:280",
"FF01:0:0:0:0:0:0:101",
"FF01::101",
"FF02:0000:0000:0000:0000:0000:0000:0001",
"a:b:c:d:e:f:0::",
"fe80:0000:0000:0000:0204:61ff:fe9d:f156",
"fe80:0:0:0:204:61ff:254.157.241.86",
"fe80:0:0:0:204:61ff:fe9d:f156",
"fe80::",
"fe80::1",
"fe80::204:61ff:254.157.241.86",
"fe80::204:61ff:fe9d:f156",
"fe80::217:f2ff:254.7.237.98",
"fe80::217:f2ff:fe07:ed62",
"fedc:ba98:7654:3210:fedc:ba98:7654:3210",
"ff02::1",
"ffff::",
"ffff::3:5",
"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
"a:0::0:b",
"a:0:0::0:b",
"a:0::0:0:b",
"a::0:0:b",
"a::0:b",
"a:0::b",
"a:0:0::b"
]

90
node_modules/is-my-ip-valid/index.js generated vendored Normal file
View File

@@ -0,0 +1,90 @@
var reIpv4FirstPass = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/
var reSubnetString = /\/\d{1,3}(?=%|$)/
var reForwardSlash = /\//
var reZone = /%.*$/
var reBadCharacters = /([^0-9a-f:/%])/i
var reBadAddress = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/i
function validate4 (input) {
if (!(reIpv4FirstPass.test(input))) return false
var parts = input.split('.')
if (parts.length !== 4) return false
if (parts[0][0] === '0' && parts[0].length > 1) return false
if (parts[1][0] === '0' && parts[1].length > 1) return false
if (parts[2][0] === '0' && parts[2].length > 1) return false
if (parts[3][0] === '0' && parts[3].length > 1) return false
var n0 = Number(parts[0])
var n1 = Number(parts[1])
var n2 = Number(parts[2])
var n3 = Number(parts[3])
return (n0 >= 0 && n0 < 256 && n1 >= 0 && n1 < 256 && n2 >= 0 && n2 < 256 && n3 >= 0 && n3 < 256)
}
function validate6 (input) {
var withoutSubnet = input.replace(reSubnetString, '')
var hasSubnet = (input.length !== withoutSubnet.length)
// FIXME: this should probably be an option in the future
if (hasSubnet) return false
if (!hasSubnet) {
if (reForwardSlash.test(input)) return false
}
var withoutZone = withoutSubnet.replace(reZone, '')
var lastPartSeparator = withoutZone.lastIndexOf(':')
if (lastPartSeparator === -1) return false
var lastPart = withoutZone.substring(lastPartSeparator + 1)
var hasV4Part = validate4(lastPart)
var address = (hasV4Part ? withoutZone.substring(0, lastPartSeparator + 1) + '1234:5678' : withoutZone)
if (reBadCharacters.test(address)) return false
if (reBadAddress.test(address)) return false
var halves = address.split('::')
if (halves.length > 2) return false
if (halves.length === 2) {
var first = (halves[0] === '' ? [] : halves[0].split(':'))
var last = (halves[1] === '' ? [] : halves[1].split(':'))
var remainingLength = 8 - (first.length + last.length)
if (remainingLength <= 0) return false
} else {
if (address.split(':').length !== 8) return false
}
return true
}
function validate (input) {
return validate4(input) || validate6(input)
}
module.exports = function validator (options) {
if (!options) options = {}
if (options.version === 4) return validate4
if (options.version === 6) return validate6
if (options.version == null) return validate
throw new Error('Unknown version: ' + options.version)
}
module.exports['__all_regexes__'] = [
reIpv4FirstPass,
reSubnetString,
reForwardSlash,
reZone,
reBadCharacters,
reBadAddress
]

92
node_modules/is-my-ip-valid/package.json generated vendored Normal file
View File

@@ -0,0 +1,92 @@
{
"_args": [
[
{
"name": "is-my-ip-valid",
"raw": "is-my-ip-valid@^1.0.0",
"rawSpec": "^1.0.0",
"scope": null,
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"/root/gitbook/node_modules/is-my-json-valid"
]
],
"_from": "is-my-ip-valid@>=1.0.0 <2.0.0",
"_hasShrinkwrap": false,
"_id": "is-my-ip-valid@1.0.1",
"_inCache": true,
"_installable": true,
"_location": "/is-my-ip-valid",
"_nodeVersion": "17.3.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/is-my-ip-valid_1.0.1_1646151758383_0.4861271044908939"
},
"_npmUser": {
"email": "linus@folkdatorn.se",
"name": "linusu"
},
"_npmVersion": "8.3.0",
"_phantomChildren": {},
"_requested": {
"name": "is-my-ip-valid",
"raw": "is-my-ip-valid@^1.0.0",
"rawSpec": "^1.0.0",
"scope": null,
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/is-my-json-valid"
],
"_resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz",
"_shasum": "f7220d1146257c98672e6fba097a9f3f2d348442",
"_shrinkwrap": null,
"_spec": "is-my-ip-valid@^1.0.0",
"_where": "/root/gitbook/node_modules/is-my-json-valid",
"bugs": {
"url": "https://github.com/LinusU/is-my-ip-valid/issues"
},
"dependencies": {},
"description": "A small lib to validate IP addresses.",
"devDependencies": {
"safe-regex": "^1.1.0",
"standard": "^10.0.3"
},
"directories": {},
"dist": {
"fileCount": 9,
"integrity": "sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg==",
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHkhOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgWw/7B6F2XG9zPrWbMMn4Zh+p6pRmgtcGJnhNcVUZen3UXs+OXAm2\r\nD66HcmNEklwFErdATrQnIK5ATGY4YFmU8RMlnHBeDcX0uO2erUOUzIFDxmg5\r\n8EqsBotbCFTyWIpCb9CanhYp/TcINsi06Vh9Y3UjC+swFlp3ThqF06b+OvxG\r\nzQccmmeSt1x9bv1ihPI7aI9vJZ0kPSttsKwccpiCsHJpTRAZTJzWWws/hkcv\r\nJPEqetVmqIBbpLl0o8g1HI7VIZWK0bMoNsZ7idlJJKSHBOupmHs/Geqv7Eiy\r\nm2ocCj7DS6HfP5+e/n55hVVXY8fZvYgzTGQ+bCBHzUuhfzzPAeEvoP/RNgkS\r\nhcqB2+0vo+dOlsYQGJbTcNWH7PSaN+JJb6kYIePM3cFrgwKEbnLUvMOn2nOw\r\nhA/WnK+TmIl1YJB3klOcEYNcIaiGHO6f4k9FHF1IqtaWEBPr8DV+4qVKez9H\r\n9sYRpdpNB3boY71tJLTyB/yefRfvzMec0d0jfvhb9/53gyWhSbfz/cJlgXOw\r\nRjC6gYNn4waCGNXq2cygTse5r7Ory+kL2JiIRP8W9OeJOZZMjrbNYYcYYuWz\r\n9pScf/K2MxD9/J5wlNL64yn+4eHMH2nNJ7PaYGUDp2K3bPkzpm49uh0A9MVi\r\nBDoWLzef8j2qeNWNiUvhqVZajf+sQiub2zQ=\r\n=YRHJ\r\n-----END PGP SIGNATURE-----\r\n",
"shasum": "f7220d1146257c98672e6fba097a9f3f2d348442",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQDQ653AEnsZL4PDTV7QlXfpGH9ETIK1rDlSg1sqwI69oQIgE/5FYgZUOamuG3bdcEl8piyB86J08dxh+PvgH1FUHeQ="
}
],
"tarball": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz",
"unpackedSize": 21051
},
"gitHead": "9c650fa3039f99293e45eb09df7829af1980afde",
"homepage": "https://github.com/LinusU/is-my-ip-valid#readme",
"license": "MIT",
"maintainers": [
{
"email": "linus@folkdatorn.se",
"name": "linusu"
}
],
"name": "is-my-ip-valid",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/LinusU/is-my-ip-valid.git"
},
"scripts": {
"test": "standard && node test"
},
"version": "1.0.1"
}

42
node_modules/is-my-ip-valid/readme.md generated vendored Normal file
View File

@@ -0,0 +1,42 @@
# Is my IP valid
A small lib to validate IP addresses.
## Installation
```sh
npm install --save is-my-ip-valid
```
## Usage
```js
const validator = require('is-my-ip-valid')
const validate = validator()
const validate4 = validator({ version: 4 })
const validate6 = validator({ version: 6 })
console.log(validate('127.0.0.1'))
//=> true
console.log(validate4('127.0.0.1'))
//=> true
console.log(validate6('127.0.0.1'))
//=> false
console.log(validate('2001:0db8:85a3:0000:0000:8a2e:0370:7334'))
//=> true
console.log(validate4('2001:0db8:85a3:0000:0000:8a2e:0370:7334'))
//=> false
console.log(validate6('2001:0db8:85a3:0000:0000:8a2e:0370:7334'))
//=> true
```
## Acknowledgements
The code is mostly based on this wonderful library: [beaugunderson/ip-address](https://github.com/beaugunderson/ip-address)
All regexes used are audited for catastrophic backtracking by this module: [substack/safe-regex](https://github.com/substack/safe-regex)

26
node_modules/is-my-ip-valid/test.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
var assert = require('assert')
var safeRegex = require('safe-regex')
var validator = require('./')
var invalid4 = require('./fixtures/invalid-ipv4-addresses')
var invalid6 = require('./fixtures/invalid-ipv6-addresses')
var valid4 = require('./fixtures/valid-ipv4-addresses')
var valid6 = require('./fixtures/valid-ipv6-addresses')
var validate = validator()
var validate4 = validator({ version: 4 })
var validate6 = validator({ version: 6 })
var i
for (i = 0; i < validator.__all_regexes__.length; i++) assert.ok(safeRegex(validator.__all_regexes__[i]), validator.__all_regexes__[i] + ' should be safe regex')
for (i = 0; i < invalid4.length; i++) assert.strictEqual(validate4(invalid4[i]), false, invalid4[i] + ' should be invalid IPv4')
for (i = 0; i < invalid6.length; i++) assert.strictEqual(validate6(invalid6[i]), false, invalid6[i] + ' should be invalid IPv6')
for (i = 0; i < valid4.length; i++) assert.strictEqual(validate(valid4[i]), true, valid4[i] + ' should be valid IP')
for (i = 0; i < valid4.length; i++) assert.strictEqual(validate4(valid4[i]), true, valid4[i] + ' should be valid IPv4')
for (i = 0; i < valid6.length; i++) assert.strictEqual(validate(valid6[i]), true, valid6[i] + ' should be valid IP')
for (i = 0; i < valid6.length; i++) assert.strictEqual(validate6(valid6[i]), true, valid6[i] + ' should be valid IPv6')