How to use the @tinkoff/utils/is/undefined 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 / cache-utils / src / shouldCacheExecute.ts View on Github external
const isComplete = context.getStatus() === Status.COMPLETE;

    if (context.getStatus() === Status.INIT) {
        context.updateExternalMeta(CACHE, {
            forced,
            enabled: !disabled,
            [`${name}Enabled`]: enabledSpecific,
            [`${name}Force`]: forcedSpecific,
        });
    }

    if (forcedSpecific) {
        return isComplete;
    }

    if (isUndefined(forcedSpecific) && forced) {
        return isComplete && dflt;
    }

    return enabledSpecific;
};