UNPKG

@lcap/nasl

Version:

NetEase Application Specific Language

24 lines 825 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("./utils"); class TransformHandler { constructor() { this.transforms = []; this.transformCallExpressions = []; } registerTransform(type, transform) { this.transforms.push([type, transform]); } registerTransformCallExpression(type, transform) { this.transformCallExpressions.push([type, transform]); } handleTransforms(node, options) { for (const [type, transform] of this.transforms) { if (typeof type === 'function' ? type(node) : node.type === type) { return transform(node, options); } } (0, utils_1.throwError)(`Unhandled node ${node.type}`); } } //# sourceMappingURL=registerTransform.js.map