UNPKG

@nimpl/ab-tests

Version:

A package for conducting A/B tests on a website using middleware

13 lines (12 loc) 408 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkHost = void 0; const checkHost = (url, rule) => { if (!rule.value) return { match: true, groups: {} }; const match = url.host.match(`^${rule.value}$`); if (match) return { match: true, groups: match.groups || {} }; return { match: false, groups: {} }; }; exports.checkHost = checkHost;