UNPKG

@microsoft/signalr

Version:
24 lines 971 B
"use strict"; // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. Object.defineProperty(exports, "__esModule", { value: true }); exports.TextMessageFormat = void 0; // Not exported from index /** @private */ class TextMessageFormat { static write(output) { return `${output}${TextMessageFormat.RecordSeparator}`; } static parse(input) { if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) { throw new Error("Message is incomplete."); } const messages = input.split(TextMessageFormat.RecordSeparator); messages.pop(); return messages; } } exports.TextMessageFormat = TextMessageFormat; TextMessageFormat.RecordSeparatorCode = 0x1e; TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode); //# sourceMappingURL=TextMessageFormat.js.map