Namespace: Util

ProtoBuf. Util

ProtoBuf utilities.

Members

<static, constant> IS_NODE :boolean

Flag if running in node or not.

Methods

<static> fetch(path, callback) → {string|undefined}

Fetches a resource.

Parameters:
Name Type Argument Description
path string

Resource path

callback function(?string) <optional>

Callback receiving the resource's contents. If omitted the resource will be fetched synchronously. If the request failed, contents will be null.

Returns:

Resource contents if callback is omitted (null if the request failed), else undefined.

Type
string | undefined

<static> isArray(obj) → {boolean}

Tests if an object is an array.

Parameters:
Name Type Description
obj *

Object to test

Returns:

true if it is an array, else false

Type
boolean

<static> XHR() → {XMLHttpRequest}

Constructs a XMLHttpRequest object.

Throws:
If XMLHttpRequest is not supported
Type
Error
Returns:
Type
XMLHttpRequest