How to use the @tinkoff/utils/object/each function in @tinkoff/utils

To help you get started, we’ve selected a few @tinkoff/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TinkoffCreditSystems / tinkoff-request / packages / plugin-protocol-http / src / url.ts View on Github external
export const serialize = (obj: Record, init = '') => {
    const searchParams = new URLSearchParams(init);

    eachObj((v, k) => {
        if (!isNil(v)) {
            searchParams.set(k, v);
        }
    }, obj);

    return searchParams.toString();
};