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

Method has

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

@param {K} key

(key)

Source from the content-addressed store, hash-verified

94
95 /** @param {K} key */
96 has(key) {
97 var sources = this.#sources;
98 var s = sources.get(key);
99
100 if (s === undefined) {
101 if (super.has(key)) {
102 s = this.#source(0);
103
104 if (DEV) {
105 tag(s, `SvelteMap get(${label(key)})`);
106 }
107
108 sources.set(key, s);
109 } else {
110 // We should always track the version in case
111 // the Set ever gets this value in the future.
112 get(this.#version);
113 return false;
114 }
115 }
116
117 get(s);
118 return true;
119 }
120
121 /**
122 * @param {(value: V, key: K, map: Map<K, V>) => void} callbackfn

Callers 15

map.test.tsFile · 0.45
set.test.tsFile · 0.45
getMethod · 0.45
setMethod · 0.45
#read_allMethod · 0.45
constructorMethod · 0.45
url.test.tsFile · 0.45
warn_onceFunction · 0.45
wFunction · 0.45
is_ignoredFunction · 0.45
LabeledStatementFunction · 0.45
SvelteComponentFunction · 0.45

Calls 6

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

Tested by 1

testFunction · 0.36