Module: misc

A set of miscellaneous helper functions.

Some of these are HACKs that should be moved to another module or removed entirely.

Source:

Methods


<static> extractValuesFromQueryResults()

queryResults: value returned from llpl.query() predicateName: name of the predicate that was used for the query

Source:
Returns:

{parameterName1: parameterValues1, ...}

Type
object

<static> mapDeep(x, fn)

Recurses into object properties and maps them to the result of fn.

Parameters:
Name Type Description
x Any

Any value.

fn function

A function (x, key, path) that returns a mapped value.

Source:
Returns:

Return the deeply mapped object.

Type
Any

<static> mutateDeep(x, fn)

Recurses into object properties and replaces them with the result of fn. 'x' will be mutated.

Parameters:
Name Type Description
x Any

Any value.

fn function

A function that returns a transformed value.

Source:
Returns:

nothing


<inner> handleDirective(spec, data)

If spec is a directive, process it and return the result.

Parameters:
Name Type Description
spec Any

Any value. If this is a directive, it will be an object with a single key that starts with '#'.

data Object

An object with properties: directiveHandlers, objects, events.

Source:
Returns:

Return the object, or if it was a directive, the results of the directive handler.

Type
Any

<inner> handleDirectiveDeep(spec, data)

Recurses into object properties and replaces them with the result of handleDirective. It will, however, skip properties named 'steps'.

Parameters:
Name Type Description
spec Any

Any value. If this is a directive, it will be an object with a single key that starts with '#'.

data Object

An object with properties: directiveHandlers, objects, events.

Source:
Returns:

Return the object, or if it was a directive, the results of the directive handler.

Type
Any