Validator

The @liskhq/lisk-validator package is a wrapper of validation packages. It includes custom validations utilities related to the Lisk Protocol.

Installation

npm install @liskhq/lisk-validator

Update

To perform an upgrade, execute the following command:

npm update @liskhq/lisk-validator

Usage

const validator = require('@liskhq/lisk-validator');

console.log(validator.MAX_SINT64) //9223372036854775807n

Constants

MAX_SINT32: 2147483647,
MIN_SINT32: -2147483647,
MAX_UINT32: 4294967295,
MAX_UINT64: 18446744073709551615n,
MAX_SINT64: 9223372036854775807n,
MIN_SINT64: -9223372036854775808n

Methods

isNumberString
isValidInteger
isHexString
isEncryptedPassphrase
isSemVer
isRangedSemVer
isLessThanRangedVersion
isGreaterThanRangedVersion
isProtocolString
isIPV4
isIPV6
isIP
isPort
isStringEndsWith
isVersionMatch
isCsv
isString
isBoolean
isSInt32
isUInt32
isSInt64
isUInt64
isBytes