Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/utils"

Index

Variables

Const validPathDomains

validPathDomains: RegExp = /^https?:\/\/(youtu\.be\/|(www\.)?youtube\.com\/(embed|v|shorts)\/)/

Const validQueryDomains

validQueryDomains: Set<string> = new Set(['youtube.com','www.youtube.com','m.youtube.com','music.youtube.com','gaming.youtube.com'])

Functions

filterFlatMap

  • filterFlatMap<T, R>(collection: T[], f: (item: T) => R[] | undefined | null): R[]
  • Type parameters

    • T

    • R

    Parameters

    • collection: T[]
    • f: (item: T) => R[] | undefined | null
        • (item: T): R[] | undefined | null
        • Parameters

          • item: T

          Returns R[] | undefined | null

    Returns R[]

filterMap

  • filterMap<T, R>(collection: T[], f: (item: T) => R | undefined | null): R[]
  • Type parameters

    • T

    • R

    Parameters

    • collection: T[]
    • f: (item: T) => R | undefined | null
        • (item: T): R | undefined | null
        • Parameters

          • item: T

          Returns R | undefined | null

    Returns R[]

Const getURLVideoID

  • getURLVideoID(link: string): string

parser

  • parser<T, R>(f: (...input: T) => R): (...input: T) => R
  • Wraps a function that accepts input T and parses it into output R. In the normal case, this is a no-op; if the function throws, however, we will augment the thrown Error with context bout what was being parsed.

    Type parameters

    • T: any[]

    • R

    Parameters

    • f: (...input: T) => R
        • (...input: T): R
        • Parameters

          • Rest ...input: T

          Returns R

    Returns (...input: T) => R

      • (...input: T): R
      • Parameters

        • Rest ...input: T

        Returns R

Generated using TypeDoc