Class Utils

Utility functions for JSON-LD

Hierarchy

  • Utils

Constructors

Methods

  • Add a property to an item

    Parameters

    • item: any
    • prop: any
    • value: any

    Returns void

  • Add a type to a JSON-LD item

    Parameters

    • item: any
    • type: any

    Returns void

  • Normalise a value to be an array. Always return a new instance of the array to maintain consistency

    Parameters

    • value: any

    Returns any[]

  • Return the current value if it is already an array, else return a new array

    Parameters

    • value: any

    Returns any[]

  • Type Parameters

    • T

    Parameters

    • data: T

    Returns T

  • Count the number of properties in an object

    Parameters

    • obj: any

    Returns number

  • Find if a value (can be primitives, object, or an entity) exists in a list of values

    Parameters

    • values: any[]
    • val: any

    Returns boolean

  • Parameters

    • item: any
    • prop: string
    • val: any

    Returns boolean

  • Parameters

    • item: any
    • type: string

    Returns boolean

  • Deep comparison for JSON-serializable plain object

    Parameters

    • a: any
    • b: any
    • equalFn: any

    Returns any

  • Parameters

    • a: any
    • b: any

    Returns any

  • Parameters

    • Rest ...subgraphs: any[]

    Returns any[]

Generated using TypeDoc