1.9 KiB
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Value interface
Wraps a value with metadata and type-safe getters.
Signature:
export interface Value
Methods
| Method | Description |
|---|---|
| asBoolean() | Gets the value as a boolean.The following values (case-insensitive) are interpreted as true: "1", "true", "t", "yes", "y", "on". Other values are interpreted as false. |
| asNumber() | Gets the value as a number. Comparable to calling Number(value) || 0. |
| asString() | Gets the value as a string. |
| getSource() | Gets the ValueSource for the given key. |
Value.asBoolean()
Gets the value as a boolean.
The following values (case-insensitive) are interpreted as true: "1", "true", "t", "yes", "y", "on". Other values are interpreted as false.
Signature:
asBoolean(): boolean;
Returns:
boolean
Value.asNumber()
Gets the value as a number. Comparable to calling Number(value) || 0.
Signature:
asNumber(): number;
Returns:
number
Value.asString()
Gets the value as a string.
Signature:
asString(): string;
Returns:
string
Value.getSource()
Gets the ValueSource for the given key.
Signature:
getSource(): ValueSource;
Returns: