regexper-static/src/js/parser/javascript/root.js
2014-11-26 18:24:40 -05:00

26 lines
372 B
JavaScript

export default {
flags() {
var flags;
if (this.fl) {
flags = this.fl.textValue;
} else {
flags = '';
}
return {
global: /g/.test(flags),
ignore_case: /i/.test(flags),
multiline: /m/.test(flags)
};
},
expression() {
if (this.regexp) {
return this.regexp;
} else {
return this;
}
}
};