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

Function stringifyValue

packages/extension/utils/css.ts:851–872  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

849 }
850
851 function stringifyValue(value: string) {
852 if (value.includes('\0')) {
853 if (
854 value.startsWith('\0') &&
855 value.endsWith('\0') &&
856 value.indexOf('\0', 1) === value.length - 1
857 ) {
858 return value.substring(1, value.length - 1)
859 }
860
861 const parts = value.split('\0')
862 const template = parts
863 .map((part, index) =>
864 index % 2 === 0 ? escapeJsTemplateLiteralText(part) : '${' + part + '}'
865 )
866 .join('')
867
868 return '`' + template + '`'
869 }
870
871 return `'${escapeJsSingleQuotedString(value)}'`
872 }
873
874 const processedStyle = Object.fromEntries(
875 Object.entries(style)

Callers 1

serializeCSSFunction · 0.85

Calls 2

Tested by

no test coverage detected