Options
All
  • Public
  • Public/Protected
  • All
Menu

@unifed/shared

This package is a collection of functions used across the frontend and backend. Primarily, these are validation functions, however any code intended for use across the whole platform should be included here.

Index

Functions

Const validateCommunityDescription

  • validateCommunityDescription(description: string): boolean
  • Validates that the given description for a community meets the validation requirements:

    • At least 1 character.
    • No more than 128 characters.
    • Any type of character.

    Parameters

    • description: string

      The community's description.

    Returns boolean

Const validateEmail

  • validateEmail(email: string): boolean

Const validateName

  • validateName(name: string): boolean
  • Validates that the given name meets the validation requirements:

    • At least 1 character.
    • No more than 64 characters.
    • Any type of character.

    This function is used for names belonging to both users and communities.

    Parameters

    • name: string

      A name to validate.

    Returns boolean

Const validatePassword

Const validateUsername

  • validateUsername(username: string): boolean
  • Validates that the given username/ID meets the validation requirements:

    • At least 1 character.
    • No more than 24 characters.
    • Only contains alphanumeric characters, dashes and underscores.

    This function is used for usernames/IDs belonging to both users and communities.

    Parameters

    • username: string

      A username/ID to validate.

    Returns boolean

Generated using TypeDoc