MCPcopy
hub / github.com/sveltejs/svelte / get

Method get

packages/svelte/src/reactivity/map.js:131–154  ·  view source on GitHub ↗

@param {K} key

(key)

Source from the content-addressed store, hash-verified

129
130 /** @param {K} key */
131 get(key) {
132 var sources = this.#sources;
133 var s = sources.get(key);
134
135 if (s === undefined) {
136 if (super.has(key)) {
137 s = this.#source(0);
138
139 if (DEV) {
140 tag(s, `SvelteMap get(${label(key)})`);
141 }
142
143 sources.set(key, s);
144 } else {
145 // We should always track the version in case
146 // the Set ever gets this value in the future.
147 get(this.#version);
148 return undefined;
149 }
150 }
151
152 get(s);
153 return super.get(key);
154 }
155
156 /**
157 * @param {K} key

Callers 15

map.test.tsFile · 0.45
hasMethod · 0.45
setMethod · 0.45
deleteMethod · 0.45
#initMethod · 0.45
url.test.tsFile · 0.45
hasMethod · 0.45
deleteMethod · 0.45
getContextFunction · 0.45
apply_adjustmentsFunction · 0.45
getFunction · 0.45

Calls 6

#sourceMethod · 0.95
tagFunction · 0.90
labelFunction · 0.90
getFunction · 0.90
setMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected