refactor: init cypress-cucumber-preprocessor install.
This commit is contained in:
35
node_modules/cucumber-expressions/dist/src/regular_expression.js
generated
vendored
Normal file
35
node_modules/cucumber-expressions/dist/src/regular_expression.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
|
||||
const Argument = require('./argument');
|
||||
|
||||
const TreeRegexp = require('./tree_regexp');
|
||||
|
||||
const ParameterType = require('./parameter_type');
|
||||
|
||||
class RegularExpression {
|
||||
constructor(expressionRegexp, parameterTypeRegistry) {
|
||||
this._expressionRegexp = expressionRegexp;
|
||||
this._parameterTypeRegistry = parameterTypeRegistry;
|
||||
this._treeRegexp = new TreeRegexp(expressionRegexp);
|
||||
}
|
||||
|
||||
match(text) {
|
||||
const parameterTypes = this._treeRegexp.groupBuilder.children.map(groupBuilder => {
|
||||
const parameterTypeRegexp = groupBuilder.source;
|
||||
return this._parameterTypeRegistry.lookupByRegexp(parameterTypeRegexp, this._treeRegexp, text) || new ParameterType(null, parameterTypeRegexp, String, s => s, false, false);
|
||||
});
|
||||
|
||||
return Argument.build(this._treeRegexp, text, parameterTypes);
|
||||
}
|
||||
|
||||
get regexp() {
|
||||
return this._expressionRegexp;
|
||||
}
|
||||
|
||||
get source() {
|
||||
return this._expressionRegexp.source;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = RegularExpression;
|
Reference in New Issue
Block a user