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

Method constructor

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

* @param {Iterable<readonly [K, V]> | null | undefined} [value]

(value)

Source from the content-addressed store, hash-verified

61 * @param {Iterable<readonly [K, V]> | null | undefined} [value]
62 */
63 constructor(value) {
64 super();
65
66 if (DEV) {
67 // If the value is invalid then the native exception will fire here
68 value = new Map(value);
69
70 tag(this.#version, 'SvelteMap version');
71 tag(this.#size, 'SvelteMap.size');
72 }
73
74 if (value) {
75 for (var [key, v] of value) {
76 super.set(key, v);
77 }
78 this.#size.v = super.size;
79 }
80 }
81
82 /**
83 * If the source is being created inside the same reaction as the SvelteMap instance,

Callers

nothing calls this directly

Calls 2

tagFunction · 0.90
setMethod · 0.65

Tested by

no test coverage detected