UNPKG

1.01 kBJavaScriptView Raw
1import { __extends } from "tslib";
2import NodePatcher from './NodePatcher';
3var PassthroughPatcher = /** @class */ (function (_super) {
4 __extends(PassthroughPatcher, _super);
5 function PassthroughPatcher(patcherContext) {
6 var children = [];
7 for (var _i = 1; _i < arguments.length; _i++) {
8 children[_i - 1] = arguments[_i];
9 }
10 var _this = _super.call(this, patcherContext) || this;
11 _this.children = children;
12 return _this;
13 }
14 PassthroughPatcher.prototype.patchAsExpression = function () {
15 this.children.forEach(function (child) {
16 if (Array.isArray(child)) {
17 child.forEach(function (child) { return child && child.patch(); });
18 }
19 else if (child) {
20 child.patch();
21 }
22 });
23 };
24 PassthroughPatcher.prototype.isRepeatable = function () {
25 return true;
26 };
27 return PassthroughPatcher;
28}(NodePatcher));
29export default PassthroughPatcher;