You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
635 B
JavaScript
19 lines
635 B
JavaScript
"use strict";
|
|
|
|
const { validateArguments } = require("@validatem/core");
|
|
const required = require("@validatem/required");
|
|
const isFunction = require("@validatem/is-function");
|
|
|
|
const node = require("../ast-node");
|
|
|
|
module.exports = function (_operations) {
|
|
return function postProcess(_handler) {
|
|
let [ handler ] = validateArguments(arguments, {
|
|
handler: [ required, isFunction ]
|
|
});
|
|
|
|
// FIXME: Allow specifying before/after options? That tell it to place itself before or after a particular other postprocessing operation. With a special $begin and $end for the edges
|
|
return node({ type: "postProcess", handler });
|
|
};
|
|
};
|