"use strict"; var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; var escapeRegexp_1 = require("../escapeRegexp"); exports.__esModule = true; exports["default"] = function (pattern) { var regexp = new RegExp("^" + escapeRegexp_1["default"](pattern) + "\\.(.+)"); return function (action) { if (action.type === pattern) { return action; } else { var match = action.type.match(regexp); if (match) { return __assign({}, action, { type: match[1] }); } else { return null; } } }; };