GGD/node_modules/prettier-plugin-java/dist/printers/comments/comments-utils.js

30 lines
1.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasComments = exports.hasTrailingLineComments = exports.hasLeadingLineComments = exports.hasTrailingComments = exports.hasLeadingComments = void 0;
function hasLeadingComments(token) {
return token.leadingComments !== undefined;
}
exports.hasLeadingComments = hasLeadingComments;
function hasTrailingComments(token) {
return token.trailingComments !== undefined;
}
exports.hasTrailingComments = hasTrailingComments;
function hasLeadingLineComments(token) {
return (token.leadingComments !== undefined &&
token.leadingComments.length !== 0 &&
token.leadingComments[token.leadingComments.length - 1].tokenType.name ===
"LineComment");
}
exports.hasLeadingLineComments = hasLeadingLineComments;
function hasTrailingLineComments(token) {
return (token.trailingComments !== undefined &&
token.trailingComments.length !== 0 &&
token.trailingComments[token.trailingComments.length - 1].tokenType.name ===
"LineComment");
}
exports.hasTrailingLineComments = hasTrailingLineComments;
function hasComments(token) {
return hasLeadingComments(token) || hasTrailingComments(token);
}
exports.hasComments = hasComments;