@remix-run/server-runtime
Version:
Server runtime for Remix
21 lines (18 loc) • 628 B
JavaScript
/**
* @remix-run/server-runtime v2.17.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import { escapeHtml } from './markup.js';
// TODO: Remove Promises from serialization
function createServerHandoffString(serverHandoff) {
// Uses faster alternative of jsesc to escape data returned from the loaders.
// This string is inserted directly into the HTML in the `<Scripts>` element.
return escapeHtml(JSON.stringify(serverHandoff));
}
export { createServerHandoffString };