UNPKG

@tapjs/node-serialize

Version:

Stream TAP test data as a serialized node:test stream

22 lines 701 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.commentMethod = void 0; const util_1 = require("util"); const loc_from_at_js_1 = require("./loc-from-at.js"); const commentMethod = (stream, diagsMap) => { return function comment(...args) { const message = (0, util_1.format)(...args); const diags = diagsMap.get(this); const m = { ...(0, loc_from_at_js_1.locFromAt)(comment), nesting: this.nestingLevel, message, }; if (diags) diags.push(m); else stream.diagnostic(m); }; }; exports.commentMethod = commentMethod; //# sourceMappingURL=comment.js.map