-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
Related to #94. The example given does not work for me:
const rangeList = {
documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ],
tunnelProviders: [
[ ipaddr.parse('2001:470::'), 32 ], // he.net
[ ipaddr.parse('2001:5c0::'), 32 ] // freenet6
]
};
ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders"But.. This works:
const rangeList: {
documentationOnly: [ipaddr.IPv6|ipaddr.IPv4, number];
tunnelProviders: [ipaddr.IPv6|ipaddr.IPv4, number][];
} = {
documentationOnly: [ipaddr.parse('2001:db8::'), 32],
tunnelProviders: [
[ipaddr.parse('2001:470::'), 32], // he.net
[ipaddr.parse('2001:5c0::'), 32] // freenet6
]
};
ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders" I'm not really sure if this is the cleanest solution. Also, it isn't copy/pastable for those using JavaScript instead of TypeScript.
Metadata
Metadata
Assignees
Labels
No labels