ProtoBuf utilities.
- Source:
Members
-
(static, constant) IS_NODE :boolean
-
Flag if running in node (fs is available) or not.
Type:
- boolean
- Source:
Methods
-
(static) fetch(path, callbackopt) → {string|undefined}
-
Fetches a resource.
Parameters:
Name Type Attributes Description path
string Resource path
callback
function <optional>
Callback receiving the resource's contents. If omitted the resource will be fetched synchronously. If the request failed, contents will be null.
- Source:
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
- Source:
Returns:
true if it is an array, else false
- Type
- boolean
-
(static) XHR() → {XMLHttpRequest}
-
Constructs a XMLHttpRequest object.
- Source:
Throws:
-
If XMLHttpRequest is not supported
- Type
- Error
Returns:
- Type
- XMLHttpRequest