function v(a) {
  return function(t) {
    var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.match(a.matchPattern);
    if (!n) return null;
    var r = n[0], l = t.match(a.parsePattern);
    if (!l) return null;
    var e = a.valueCallback ? a.valueCallback(l[0]) : l[0];
    e = u.valueCallback ? u.valueCallback(e) : e;
    var c = t.slice(r.length);
    return {
      value: e,
      rest: c
    };
  };
}
export {
  v as default
};
