Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "generateId"

Index

Interfaces

Type aliases

Variables

Type aliases

IGenId

IGenId: function

Type for a function that generates ids.

Type declaration

    • (): string
    • Returns string

Variables

generateId

generateId: function = generateIdWith(shortid.generate)

Generate Id if .id and ._id are null or undefined.

Type declaration

    • (t2: T2): R
    • Parameters

      • t2: T2

      Returns R

generateIdWith

generateIdWith: CurriedFunction2<function, any, IId> = R.curry((genId: IGenId, o: any): IId => {if (!o)return { id: genId() };if (P.isNotNilOrEmpty(o.id))return o;const id = P.isNotNilOrEmpty(o._id) ? o._id : genId();return R.assoc('id', id, o);})

Generate Id with custom function.

Generated using TypeDoc