UNPKG

tsx-schema-markup

Version:

A package for adding schema markup to your tsx page

12 lines (11 loc) 468 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StructuredData = StructuredData; const jsx_runtime_1 = require("react/jsx-runtime"); function StructuredData({ thing }) { let data = thing; if (thing && typeof thing === "object") { data = Object.assign({ "@context": "https://schema.org" }, thing); } return (0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", children: JSON.stringify(data) }); }