query-string#ParsedQuery TypeScript Examples

The following examples show how to use query-string#ParsedQuery. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: storage-utils.tsx    From anthem with Apache License 2.0 7 votes vote down vote up
/**
   * Default to the address derived from the routing params, if it exists,
   * to allow deep links to work correctly. Otherwise, use the stored
   * address.
   */
  getAddress = (params: ParsedQuery<string>): string => {
    const { address } = params;
    if (address && typeof address === "string") {
      return address;
    } else {
      const storedAddress = this.getItem(KEYS.ADDRESS_KEY);
      if (storedAddress) {
        if (typeof storedAddress === "string") {
          return storedAddress;
        }
      }
    }

    return "";
  };