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) 736 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.strictEqual = exports.isAtMost = exports.isAtLeast = exports.toRegExp = void 0; /** * * * @param {string} str * @return {*} {string} */ function escapeRegExp(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } /** * * * @export * @param {(string | RegExp)} arg * @return {*} {RegExp} */ function toRegExp(arg) { return arg instanceof RegExp ? arg : new RegExp(escapeRegExp(arg), 'iu'); } exports.toRegExp = toRegExp; const isAtLeast = (a, b) => a >= b; exports.isAtLeast = isAtLeast; const isAtMost = (a, b) => a <= b; exports.isAtMost = isAtMost; const strictEqual = (a, b) => a === b; exports.strictEqual = strictEqual;