Global

Members

EventEmitter

This is a simple wrapper to unify EventEmitter implementations across platforms.

(constant) config

Based on https://github.com/react-native-async-storage/async-storage/blob/main/packages/default-storage-backend/src/types.ts

Methods

nestedSet(obj, key, value)

Allows setting properties/variables deep in an object. Converts a.b into { a: { b: value } } for dot notation on Objects Converts a.0.b into { a: [{ b: value }] } for dot notation on Arrays

Parameters:
Name Type Description
obj

The object to assign the value to

key

The key to assign. If it's in a deeper path, then use dot notation (prop1.prop2.prop3) Note that intermediate object(s) in the nested path are automatically created if they don't exist.

value

The value to assign. If it's an undefined then the key is deleted.

relativeTimeToDate(text, nowopt) → {RelativeTimeToDateResult}

Converts human readable relative date string, for example, 'in 10 days' to a date relative to now.

Parameters:
Name Type Attributes Description
text string

The text to convert.

now Date <optional>

The date from which add or subtract. Default is now.

Returns:
Type:
RelativeTimeToDateResult

Type Definitions

RelativeTimeToDateResult

Properties:
Name Type Description
status string

The conversion status, error if conversion failed or success if conversion succeeded.

info string

The error message if conversion failed, or the relative time indication (past, present, future) if conversion succeeded.

result Date | undefined

The converted date, or undefined if conversion failed.