UNPKG

@sudoo/marked

Version:

JavaScript & TypeScript code runner in JavaScript, safe with marked territory, asynchronous

37 lines (36 loc) 955 B
"use strict"; /** * @author WMXPY * @namespace Debug_Snapshot * @description Node */ Object.defineProperty(exports, "__esModule", { value: true }); exports.MarkedDebugSnapshotNode = void 0; class MarkedDebugSnapshotNode { static fromNode(node) { return new MarkedDebugSnapshotNode(node); } constructor(node) { this._node = node; } get type() { return this._node.type; } getLeadComments() { if (typeof this._node.leadingComments === "undefined") { return []; } return this._node.leadingComments.map((comment) => { return comment.value; }); } getTailComments() { if (typeof this._node.trailingComments === "undefined") { return []; } return this._node.trailingComments.map((comment) => { return comment.value; }); } } exports.MarkedDebugSnapshotNode = MarkedDebugSnapshotNode;