Options
All
  • Public
  • Public/Protected
  • All
Menu

Module JSONExt

The namespace for JSON-specific functions.

Index

Variables

Const emptyArray

emptyArray: ReadonlyJSONArray = Object.freeze([]) as ReadonlyJSONArray

A shared frozen empty JSONArray

Const emptyObject

emptyObject: ReadonlyJSONObject = Object.freeze({}) as ReadonlyJSONObject

A shared frozen empty JSONObject

Functions

deepCopy

  • deepCopy<T>(value: T): T
  • Create a deep copy of a JSON value.

    Type parameters

    Parameters

    • value: T

      The JSON value to copy.

    Returns T

    A deep copy of the given JSON value.

deepEqual

  • Compare two JSON values for deep equality.

    Parameters

    Returns boolean

    true if the values are equivalent, false otherwise.

isArray

  • Test whether a JSON value is an array.

    Parameters

    • value: JSONValue

      The JSON value of interest.

    Returns boolean

    true if the value is a an array, false otherwise.

  • Parameters

    Returns boolean

isObject

  • Test whether a JSON value is an object.

    Parameters

    • value: JSONValue

      The JSON value of interest.

    Returns boolean

    true if the value is a an object, false otherwise.

  • Parameters

    Returns boolean

isPrimitive

  • Test whether a JSON value is a primitive.

    Parameters

    Returns boolean

    true if the value is a primitive,false otherwise.

Generated using TypeDoc