Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace NNI

Index

Functions

constrain

  • constrain(n: number, typeName: string): number
  • constrain(n: number, typeName: string, max: number): number
  • constrain(n: number, typeName: string, min: number, max?: number): number
  • Error if n exceeds [0,MAX_SAFE_INTEGER] range.

    Parameters

    • n: number
    • typeName: string

    Returns number

  • Error if n exceeds [0,max] range.

    Parameters

    • n: number
    • typeName: string
    • max: number

    Returns number

  • Error if n exceeds [min,max] range.

    Parameters

    • n: number
    • typeName: string
    • min: number
    • Optional max: number

    Returns number

decode

  • decode(value: Uint8Array, opts?: Options & { big?: false }): number
  • decode(value: Uint8Array, opts: Options & { big: true }): bigint
  • Decode non-negative integer as number.

    Parameters

    • value: Uint8Array
    • Optional opts: Options & { big?: false }

    Returns number

  • Decode non-negative integer as bigint.

    Parameters

    • value: Uint8Array
    • opts: Options & { big: true }

    Returns bigint

isValidLength

  • isValidLength(len: number): boolean

Generated using TypeDoc