express-user-agent-blocker
Version:
Express middleware for blocking access based on User Agent
9 lines (8 loc) • 327 B
TypeScript
/**
* Tests the user agent against the block regex
* @param {RegExp} blockRegex - the regex to test against
* @param {string} userAgent - the value to test
* @return {boolean} true, if UA needs to be blocked, else false
*/
declare const isBlockUa: (blockRegex: RegExp, userAgent: string) => boolean;
export { isBlockUa };