50; /** * Renders a symbol. */ SymbolRep.propTypes = { object: PropTypes.object.isRequired, shouldRenderTooltip: PropTypes.bool, }; function SymbolRep(props) { const { className = "objectBox objectBox-symbol", object, shouldRenderTooltip, } = props; const { name } = object; let symbolText = name || ""; if (name && name !== "Symbol.iterator" && name !== "Symbol.asyncIterator") { symbolText = StringRep({ object: symbolText, shouldCrop: true, cropLimit: MAX_STRING_LENGTH, useQuotes: true, }); } const config = getElementConfig( { shouldRenderTooltip, className, name, }, object ); return span(config, "Symbol(", symbolText, ")"); } function getElementConfig(opts, object) { const { shouldRenderTooltip, className, name } = opts; return { "data-link-actor-id": object.actor, className, title: shouldRenderTooltip ? `Symbol(${name})` : null, }; } function supportsObject(object, noGrip = false) { return getGripType(object, noGrip) == "symbol"; } const rep = wrapRender(SymbolRep); // Exports from this module export { rep, supportsObject }; PK