Skip to content

checkNetworkPrefix

function checkNetworkPrefix(prefix: string): prefix is NetworkPrefix;

Defined in: packages/iso-filecoin/src/utils.js:141

Checks if the prefix is a valid network prefix

Parameters

ParameterType
prefixstring

Returns

prefix is NetworkPrefix

Example

import {
function checkNetworkPrefix(prefix: string): prefix is NetworkPrefix

Checks if the prefix is a valid network prefix

@paramprefix

@returns

@example

import { checkNetworkPrefix } from 'iso-filecoin/utils'
checkNetworkPrefix('f') // true
checkNetworkPrefix('t') // true
checkNetworkPrefix('x') // false

checkNetworkPrefix
} from 'iso-filecoin/utils'
function checkNetworkPrefix(prefix: string): prefix is NetworkPrefix

Checks if the prefix is a valid network prefix

@paramprefix

@returns

@example

import { checkNetworkPrefix } from 'iso-filecoin/utils'
checkNetworkPrefix('f') // true
checkNetworkPrefix('t') // true
checkNetworkPrefix('x') // false

checkNetworkPrefix
('f') // true
function checkNetworkPrefix(prefix: string): prefix is NetworkPrefix

Checks if the prefix is a valid network prefix

@paramprefix

@returns

@example

import { checkNetworkPrefix } from 'iso-filecoin/utils'
checkNetworkPrefix('f') // true
checkNetworkPrefix('t') // true
checkNetworkPrefix('x') // false

checkNetworkPrefix
('t') // true
function checkNetworkPrefix(prefix: string): prefix is NetworkPrefix

Checks if the prefix is a valid network prefix

@paramprefix

@returns

@example

import { checkNetworkPrefix } from 'iso-filecoin/utils'
checkNetworkPrefix('f') // true
checkNetworkPrefix('t') // true
checkNetworkPrefix('x') // false

checkNetworkPrefix
('x') // false