UNPKG

ts-cast

Version:
10 lines (9 loc) 395 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.matching = void 0; var names_1 = require("../helpers/names"); var matching = function (pattern) { var re = pattern instanceof RegExp ? pattern : new RegExp(pattern); return (0, names_1.withName)(function (value) { return re.test(value); }, "matching ".concat(pattern)); }; exports.matching = matching;