MCPcopy
hub / github.com/livebud/bud / get_value

Method get_value

package/svelte/compiler.js:16159–16172  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

16157 return Array.from(dependencies);
16158 }
16159 get_value(block) {
16160 if (this.is_true)
16161 return x`true`;
16162 if (this.chunks.length === 0)
16163 return x`""`;
16164 if (this.chunks.length === 1) {
16165 return this.chunks[0].type === "Text" ? string_literal(this.chunks[0].data) : this.chunks[0].manipulate(block);
16166 }
16167 let expression2 = this.chunks.map((chunk) => chunk.type === "Text" ? string_literal(chunk.data) : chunk.manipulate(block)).reduce((lhs, rhs) => x`${lhs} + ${rhs}`);
16168 if (this.chunks[0].type !== "Text") {
16169 expression2 = x`"" + ${expression2}`;
16170 }
16171 return expression2;
16172 }
16173 get_static_value() {
16174 if (!this.is_static)
16175 return null;

Callers 3

renderMethod · 0.80
add_spread_attributesMethod · 0.80

Calls 6

xFunction · 0.85
string_literalFunction · 0.85
manipulateMethod · 0.80
hasMethod · 0.80
get_class_name_textMethod · 0.80
render_chunksMethod · 0.80

Tested by

no test coverage detected