UNPKG

@iobroker/testing

Version:

Shared utilities for adapter and module testing in ioBroker

11 lines (10 loc) 376 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.str2regex = str2regex; 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, '?!')); }