MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / serializeBlock

Function serializeBlock

packages/extension/codegen/worker.ts:56–69  ·  view source on GitHub ↗
(
    blockOptions: TransformOptions | false | undefined,
    serializeOptions: WorkerSerializeOptions
  )

Source from the content-addressed store, hash-verified

54 let devComponent: DevComponent | null = null
55
56 const {
57 component: componentOptions,
58 css: cssOptions,
59 js: jsOptions,
60 ...rest
61 } = plugin?.code ?? {}
62 const usesVariableTransform = (blockOptions: TransformOptions | false | undefined) =>
63 !!blockOptions && typeof blockOptions.transformVariable === 'function'
64 const serializeBlock = (
65 blockOptions: TransformOptions | false | undefined,
66 serializeOptions: WorkerSerializeOptions
67 ) => {
68 const usePluginVariableStyle = usesVariableTransform(blockOptions)
69 const transformOptions = blockOptions || undefined
70 const blockStyle = usePluginVariableStyle ? (pluginVariableStyle ?? style) : style
71 const context = variableSyntax && !usePluginVariableStyle ? { variableSyntax } : undefined
72

Callers 1

worker.tsFile · 0.85

Calls 2

serializeCSSFunction · 0.90
usesVariableTransformFunction · 0.85

Tested by

no test coverage detected