Namespace: QueryStringMachine

QueryStringMachine

Phet's query string manipulation type, useful for accessing and validating specific query parameters. Available in the main PhET-iO js import.

Methods

(static) get(key, schema) → {*}

Gets the value for a single query parameter.
Parameters:
Name Type Description
key string the query parameter name
schema Object
Returns:
query parameter value, converted to the proper type
Type
*

(static) getAll(schemaMap) → {Object}

Gets values for every query parameter, using the specified schema map.
Parameters:
Name Type Description
schemaMap Object see QueryStringMachine.getAllForString
Returns:
- see QueryStringMachine.getAllForString
Type
Object

(static) getAllForString(schemaMap, string) → {Object}

Like `getAll` but for an arbitrary parameters string.
Parameters:
Name Type Description
schemaMap Object key/value pairs, key is query parameter name and value is a schema
string string the parameters string
Returns:
- key/value pairs holding the parsed results
Type
Object

(static) getForString(string, key, schema) → {*}

Like `get` but for an arbitrary parameter string.
Parameters:
Name Type Description
string string the parameters string
key string the query parameter name
schema Object see QueryStringMachine.get
Returns:
query parameter value, converted to the proper type
Type
*