Home / Function/ querystringSingleKey() — typescript-sdk Function Reference

querystringSingleKey() — typescript-sdk Function Reference

Architecture documentation for the querystringSingleKey() function in runtime.ts from the typescript-sdk codebase.

Entity Profile

Dependency Diagram

graph TD
  3bb330c2_4483_297c_e101_313e6379634b["querystringSingleKey()"]
  41b6b5c2_aa5b_90b9_c373_84e0a8cd9918["runtime.ts"]
  3bb330c2_4483_297c_e101_313e6379634b -->|defined in| 41b6b5c2_aa5b_90b9_c373_84e0a8cd9918
  f6cb21d6_0a55_74ae_65f3_771862310c42["querystring()"]
  f6cb21d6_0a55_74ae_65f3_771862310c42 -->|calls| 3bb330c2_4483_297c_e101_313e6379634b
  f6cb21d6_0a55_74ae_65f3_771862310c42["querystring()"]
  3bb330c2_4483_297c_e101_313e6379634b -->|calls| f6cb21d6_0a55_74ae_65f3_771862310c42
  style 3bb330c2_4483_297c_e101_313e6379634b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/runtime.ts lines 320–338

function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
    const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
    if (value instanceof Array) {
        const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
            .join(`&${encodeURIComponent(fullKey)}=`);
        return `${encodeURIComponent(fullKey)}=${multiValue}`;
    }
    if (value instanceof Set) {
        const valueAsArray = Array.from(value);
        return querystringSingleKey(key, valueAsArray, keyPrefix);
    }
    if (value instanceof Date) {
        return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
    }
    if (value instanceof Object) {
        return querystring(value as HTTPQuery, fullKey);
    }
    return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}

Domain

Defined In

Called By

Frequently Asked Questions

What does querystringSingleKey() do?
querystringSingleKey() is a function in the typescript-sdk codebase, defined in src/runtime.ts.
Where is querystringSingleKey() defined?
querystringSingleKey() is defined in src/runtime.ts at line 320.
What does querystringSingleKey() call?
querystringSingleKey() calls 1 function(s): querystring.
What calls querystringSingleKey()?
querystringSingleKey() is called by 1 function(s): querystring.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free