Class: shaka.util.ObjectUtils

Constructor

new ObjectUtils()

Source:

Methods

alphabeticalKeyOrderStringify(value) → {string}

Constructs a string out of a value, similar to the JSON.stringify method. Unlike that method, this guarantees that the order of the keys in an object is alphabetical, so it can be used as a way to reliably compare two objects.
Parameters:
Name Type Description
value ?
Source:
Returns:
Type
string

arrayStringify_(arrnon-null) → {string}

Helper for alphabeticalKeyOrderStringify for arrays. This could itself be JSON.stringify, except we want objects within the array to go through our own stringifiers.
Parameters:
Name Type Description
arr Array
Source:
Returns:
Type
string

cloneObject(arg) → {T}

Performs a deep clone of the given simple object. This does not copy prototypes, custom properties (e.g. read-only), or multiple references to the same object. If the caller needs these fields, it will need to set them after this returns.
Parameters:
Name Type Description
arg T
Source:
Returns:
Type
T

objectStringify_(objnon-null) → {string}

Helper for alphabeticalKeyOrderStringify for objects.
Parameters:
Name Type Description
obj Object
Source:
Returns:
Type
string

shallowCloneObject(original) → {T}

Performs a shallow clone of the given simple object. This does not copy prototypes or custom properties (e.g. read-only).
Parameters:
Name Type Description
original T
Source:
Returns:
Type
T