Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/core/url/convert

Index

References

Re-exports FromQueryStringOptions
Re-exports ToQueryStringOptions

Functions

  • Creates a dictionary from the specified querystring and returns it

    example
    // {a: 1}
    fromQueryString('?a=1');

    Parameters

    • query: string
    • Optional decode: boolean

    Returns Dictionary

  • Creates a dictionary from the specified querystring and returns it

    example
    // {a: [1, 2]}
    fromQueryString('?a[]=1&a[]=2', {arraySyntax: true});

    Parameters

    Returns Dictionary

  • Creates a dictionary from the specified querystring and returns it. This overload doesn't convert key values from a string.

    example
    // {a: '1'}
    fromQueryString('?a=1', {convert: false});

    Parameters

    Returns Dictionary<string | null>

  • toQueryString(data: unknown, encode?: boolean): string
  • toQueryString(data: unknown, opts: ToQueryStringOptions): string
  • Creates a querystring from the specified data and returns it

    example
    // '?a=1'
    toQueryString({a: 1});

    Parameters

    • data: unknown
    • Optional encode: boolean

    Returns string

  • Creates a querystring from the specified data and returns it

    example
    // '?a[]=1&a[]=2'
    toQueryString({a: [1, 2]}, {arraySyntax: true});

    Parameters

    Returns string