Back to Firebase Js Sdk

Value interface

docs-devsite/remote-config.value.md

12.12.11.9 KB
Original Source

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.

<b>Signature:</b>

typescript
export interface Value 

Methods

MethodDescription
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 <code>Number(value) || 0</code>.
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.

<b>Signature:</b>

typescript
asBoolean(): boolean;

<b>Returns:</b>

boolean

Value.asNumber()

Gets the value as a number. Comparable to calling <code>Number(value) || 0</code>.

<b>Signature:</b>

typescript
asNumber(): number;

<b>Returns:</b>

number

Value.asString()

Gets the value as a string.

<b>Signature:</b>

typescript
asString(): string;

<b>Returns:</b>

string

Value.getSource()

Gets the ValueSource for the given key.

<b>Signature:</b>

typescript
getSource(): ValueSource;

<b>Returns:</b>

ValueSource