@microsoft/api-extractor
Version:
Validate, document, and review the exported API for a TypeScript library
23 lines • 982 B
JavaScript
;
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
class TypeScriptMessageFormatter {
/**
* Format a TypeScript diagnostic message or message chain.
*/
static format(messageText) {
const formattedErrors = [];
for (let wrappedMessageText = messageText; wrappedMessageText !== undefined; wrappedMessageText = wrappedMessageText.next) {
if (typeof wrappedMessageText === 'string') {
formattedErrors.push(wrappedMessageText);
}
else {
formattedErrors.push(wrappedMessageText.messageText);
}
}
return formattedErrors.join('; ');
}
}
exports.TypeScriptMessageFormatter = TypeScriptMessageFormatter;
//# sourceMappingURL=TypeScriptMessageFormatter.js.map