This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/regexp-tree/dist/compat-transpiler/transforms/compat-x-flag-transform.js

23 lines
478 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
/**
* The MIT License (MIT)
* Copyright (c) 2017-present Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
'use strict';
/**
* A regexp-tree plugin to remove `x` flag `/foo/x` to `/foo/`.
*
* Note: other features of `x` flags (whitespace, comments) are
* already removed at parsing stage.
*/
module.exports = {
RegExp: function RegExp(_ref) {
var node = _ref.node;
if (node.flags.includes('x')) {
node.flags = node.flags.replace('x', '');
}
}
};