UNPKG

@assert-equals/dappdriver

Version:

DappDriver is an e2e testing framework designed for testing decentralized applications (dApps) using MetaMask, Rainbow or Zerion

30 lines (29 loc) 754 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.strictEqual = exports.isAtLeast = exports.toRegExp = exports.escapeSpecialChars = void 0; /** * * * @export * @param {string} str * @return {*} {string} */ function escapeSpecialChars(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } exports.escapeSpecialChars = escapeSpecialChars; /** * * * @export * @param {(string | RegExp)} arg * @return {*} {RegExp} */ function toRegExp(arg) { return arg instanceof RegExp ? arg : new RegExp(escapeSpecialChars(arg), 'iu'); } exports.toRegExp = toRegExp; const isAtLeast = (a, b) => a >= b; exports.isAtLeast = isAtLeast; const strictEqual = (a, b) => a === b; exports.strictEqual = strictEqual;