UNPKG

@mcm4iob/testing

Version:

Shared utilities for adapter and module testing in ioBroker

12 lines (11 loc) 404 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.str2regex = void 0; function str2regex(pattern) { return new RegExp(pattern .replace(/\\/g, "\\\\") // Backslashes escapen .replace(/\./g, "\\.") // Punkte als solche matchen .replace(/\*/g, ".*") // Wildcard in Regex umsetzen .replace(/!/g, "?!")); } exports.str2regex = str2regex;