Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/util/mod.ts>isIp

Package publishing for deno.land/x/polkadot
Go to Latest
function isIp
import { isIp } from "https://deno.land/x/polkadot@0.2.14/util/mod.ts";

Examples

import { isIp } from 'https://deno.land/x/polkadot@0.2.14/util/mod.ts';

isIp('192.168.0.1')); // => true
isIp('1:2:3:4:5:6:7:8'); // => true
isIp('192.168.0.1', 'v6')); // => false
isIp('1:2:3:4:5:6:7:8', 'v4'); // => false

Parameters

value: string
optional
type: "v4" | "v6"

Returns

boolean