Options
All
  • Public
  • Public/Protected
  • All
Menu

Package common

@typed/common

A package for distributing common functionality to other @typed libraries.

This package isn't necessary meant to be consumed externally, but is meant to serve as a place to de-duplicate common dependencies.

Index

Type aliases

Compact

Compact<A>: {}

Type parameters

  • A

Type declaration

DropKeys

DropKeys<A, Keys>: Exclude<keyof A, Keys> extends never ? {} : {}

Type parameters

  • A

  • Keys: PropertyKey

Flatten

Flatten<A, S>: A extends [infer H] ? S & H : A extends [infer H, infer T] ? [Flatten<T, S & H>] : S

Type parameters

  • A

  • S

Json

JsonArray

JsonArray: keyof Json[]

JsonPrimitive

JsonPrimitive: string | number | boolean | null

UnNest

UnNest<T, Fallback>: T extends any[] ? {}[number] : Fallback

Type parameters

  • T

  • Fallback

Variables

Const VOID

VOID: undefined = void 0

Const isBrowser

isBrowser: boolean = typeof window !== 'undefined' && typeof document !== 'undefined'

Functions

addQueryParameters

  • addQueryParameters(url: string, queryParams: Record<string, string | undefined>): string
  • addQueryParameters(url: string): (queryParams: Record<string, string | undefined>) => string

clone

  • clone(value: any, refFrom: any[], refTo: any[], deep: boolean): any

equals

  • equals(a: any, b: any, stackA?: any[], stackB?: any[]): boolean

functionName

  • functionName(fn: Function): string

includesWith

  • includesWith<A, B>(pred: (value: A, item: B, index: number) => boolean, x: A, list: B[]): boolean
  • Type parameters

    • A

    • B

    Parameters

    • pred: (value: A, item: B, index: number) => boolean
        • (value: A, item: B, index: number): boolean
        • Parameters

          • value: A
          • item: B
          • index: number

          Returns boolean

    • x: A
    • list: B[]

    Returns boolean

indexOf

  • indexOf(list: any, a: any, idx?: number): number

isFunction

  • isFunction(x: any): x is Function

isMap

  • isMap<A, B>(x: any): x is Map<A, B>

isSet

  • isSet<A>(x: any): x is Set<A>

mapArrayLike

  • mapArrayLike<A, B>(fn: (value: A) => B, functor: ArrayLike<A>): B[]

mapObj

  • mapObj<A, B, C>(fn: <K>(key: K, value: C[K]) => B, obj: C): {}
  • Type parameters

    • A

    • B

    • C: Record<PropertyKey, A>

    Parameters

    • fn: <K>(key: K, value: C[K]) => B
        • <K>(key: K, value: C[K]): B
        • Type parameters

          • K: keyof C

          Parameters

          • key: K
          • value: C[K]

          Returns B

    • obj: C

    Returns {}

pathJoin

  • pathJoin(paths: ReadonlyArray<string | undefined | null | void | boolean>, trailingSlash?: boolean): string
  • Parameters

    • paths: ReadonlyArray<string | undefined | null | void | boolean>

      :: string[] A list of paths to join together

    • Default value trailingSlash: boolean = false

      :: boolean whether or not to append a trailing slash

    Returns string

quote

  • quote(s: string): string

Const toString

  • toString(x: any): string

typeOf

  • typeOf(value: string): "String"
  • typeOf(value: number): "Number"
  • typeOf(value: null): "Null"
  • typeOf(value: undefined): "Undefined"
  • typeOf(value: undefined): "Undefined"
  • typeOf(value: any): string

Generated using TypeDoc