Class Object

Index

Methods

Methods

public static chain(object?: any)

[Method] Returns a new object with the given object as the prototype chain

Parameters

  • object?: any optional

    Object The prototype chain for the new object.

public static each(object?: any, fn?: any, scope?: any)

[Method] Iterate through an object and invoke the given callback function for each iteration

Parameters

  • object?: any optional

    Object The object to iterate

  • fn?: any optional

    Function The callback function.

  • scope?: any optional

    Object The execution scope (this) of the callback function

public static fromQueryString(queryString?: string, recursive?: boolean): any

[Method] Converts a query string back into an object

Parameters

  • queryString?: string optional

    String The query string to decode.

  • recursive?: boolean optional

    Boolean Whether or not to recursively decode the string. This format is supported by PHP / Ruby on Rails servers and similar.

Returns

any

Object

public static getKey(object?: any, value?: any)

[Method] Returns the first matching key corresponding to the given value

Parameters

  • object?: any optional

    Object

  • value?: any optional

    Object The value to find

public static getKeys(object?: any): Array<string>

[Method] Gets all keys of the given object as an array

Parameters

  • object?: any optional

    Object

Returns

Array<string>

String[] An array of keys from the object.

public static getSize(object?: any): number

[Method] Gets the total number of this object s own properties

Parameters

  • object?: any optional

    Object

Returns

number

Number size

public static getValues(object?: any): Array<any>

[Method] Gets all values of the given object as an array

Parameters

  • object?: any optional

    Object

Returns

Array<any>

Array An array of values from the object.

public static merge(source: any, objs?: Array<any>): any

[Method] Merges any number of objects recursively without referencing them or their children

Parameters

  • source: any

    Object The first object into which to merge the others.

  • objs?: Array<any> optional

    Object... One or more objects to be merged into the first.

Returns

any

Object The object that is created as a result of merging all the objects passed in.

public static toQueryObjects(name?: string, value?: any, recursive?: boolean): Array<any>

[Method] Convert a name value pair to an array of objects with support for nested structures useful to construct query stri

Parameters

  • name?: string optional

    String

  • value?: any optional

    Object

  • recursive?: boolean optional

    Boolean true to recursively encode any sub-objects.

Returns

Array<any>

Object[] Array of objects with name and value fields.

public static toQueryString(object?: any, recursive?: boolean): string

[Method] Takes an object and converts it to an encoded query string

Parameters

  • object?: any optional

    Object The object to encode.

  • recursive?: boolean optional

    Boolean Whether or not to interpret the object in recursive format. (PHP / Ruby on Rails servers and similar).

Returns

string

String queryString