MCPcopy
hub / github.com/vercel/satori / buildXMLString

Function buildXMLString

src/utils.ts:243–260  ·  view source on GitHub ↗
(
  type: string,
  attrs: Record<string, string | number>,
  children?: string
)

Source from the content-addressed store, hash-verified

241}
242
243export function buildXMLString(
244 type: string,
245 attrs: Record<string, string | number>,
246 children?: string
247) {
248 let attrString = ''
249
250 for (const [k, _v] of Object.entries(attrs)) {
251 if (typeof _v !== 'undefined') {
252 attrString += ` ${k}="${_v}"`
253 }
254 }
255
256 if (children) {
257 return `<${type}${attrString}>${children}</${type}>`
258 }
259 return `<${type}${attrString}/>`
260}
261
262export function createLRU<T>(max = 20) {
263 const store: Map<string, T> = new Map()

Callers 15

layoutFunction · 0.85
buildTextFunction · 0.85
svgFunction · 0.85
backgroundImageFunction · 0.85
buildMaskImageFunction · 0.85
buildDropShadowFunction · 0.85
boxShadowFunction · 0.85
buildDecorationFunction · 0.85
getBorderRadiusClipPathFunction · 0.85
contentMaskFunction · 0.85
overflowFunction · 0.85
rectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…