How to use @commercial/hoek - 1 common examples

To help you get started, we’ve selected a few @commercial/hoek 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 hapijs / hapi / lib / security.js View on Github external
exports.route = function (settings) {

    if (!settings) {
        return null;
    }

    const security = Hoek.applyToDefaults(Defaults.security, settings);
    if (security.hsts) {
        if (security.hsts === true) {
            security._hsts = 'max-age=15768000';
        }
        else if (typeof security.hsts === 'number') {
            security._hsts = 'max-age=' + security.hsts;
        }
        else {
            security._hsts = 'max-age=' + (security.hsts.maxAge || 15768000);
            if (security.hsts.includeSubdomains || security.hsts.includeSubDomains) {
                security._hsts = security._hsts + '; includeSubDomains';
            }
            if (security.hsts.preload) {
                security._hsts = security._hsts + '; preload';
            }
        }

@commercial/hoek

General purpose node utilities

SEE LICENSE IN LICENSE.md
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Popular @commercial/hoek functions