Module: curious

Curious JavaScript client and query construction
Source:

Classes

CuriousClient
CuriousQuery

Namespaces

CuriousObjects

Members

(inner) queryUrl

The URL to query
Source:

Methods

(inner) _convertResultsToOutput(relationships, objects, camelCaseopt) → {Object.<string, Array>}

Rearrange the results from an array of arrays of objects to an object, where each array of objects is named by its appropriate relationship name.
Parameters:
Name Type Attributes Description
relationships Array.<string> The relationship names
objects Array.<Array.<Object>> The objects from each relationship
camelCase boolean <optional>
Whether or not to camel-case the relationship names
Source:
Returns:
The rearranged results
Type
Object.<string, Array>

(inner) _getArgs(queryArgsopt, nullable, clientDefaultArgsopt, nullable) → {Object}

Get the final args to send to the Curious server, after filtering down through all of the defaults.
Parameters:
Name Type Attributes Description
queryArgs Object <optional>
<nullable>
Query-specific args
clientDefaultArgs Object <optional>
<nullable>
Client-specific args
Source:
Returns:
The args, with all defaults filled in hierarchially
Type
Object

(inner) _getQueryUrl(url) → {string}

Determine the query endpoint URL from the base URL: add in the query endpoint '/q/' if the URL does not already include it, and make sure the URL ends in a '/'.
Parameters:
Name Type Description
url string The base URL, maybe also including the query endpoint
Source:
Returns:
The fully formed query URL, ending in a '/'.
Type
string

(inner) _groupArraysOfObjectsByID(arrayOfArraysOfObjects) → {Array.<Object>}

Given an array of array of objects, group each of the arrays of objects by ID
Parameters:
Name Type Description
arrayOfArraysOfObjects Aray.<Array.<Object>> An array of arrays of objects to group
Source:
Returns:
Each object corresponds to its array above, but now grouped by ID
Type
Array.<Object>

(inner) term() → {string}

The term contents
Source:
Returns:
The term contents
Type
string