express-user-agent-blocker
Version:
Express middleware for blocking access based on User Agent
10 lines (9 loc) • 490 B
TypeScript
import { Options } from '../definitions/options';
/**
* Builds the regex to test UAs against
* @param {string[]} userAgentToBlock - one or more (partial) User Agent strings to block
* @param {Options} [options] - optional options which may contain custom log function
* @return {RegExp|null} the regex to test against, or null if invalid input provided
*/
declare const buildUaBlockRegex: (userAgentToBlock: string[], options?: Options) => RegExp | null;
export { buildUaBlockRegex };