deep_read() — svelte Function Reference
Architecture documentation for the deep_read() function in runtime.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD 6df34f9a_c0f2_3a71_c389_07a149b321f6["deep_read()"] bde4209f_8ffc_1594_4024_b1835a44bcf6["runtime.js"] 6df34f9a_c0f2_3a71_c389_07a149b321f6 -->|defined in| bde4209f_8ffc_1594_4024_b1835a44bcf6 14da5ffa_bc19_aee6_36b3_bbba24db7f02["deep_read_state()"] 14da5ffa_bc19_aee6_36b3_bbba24db7f02 -->|calls| 6df34f9a_c0f2_3a71_c389_07a149b321f6 style 6df34f9a_c0f2_3a71_c389_07a149b321f6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/internal/client/runtime.js lines 801–843
export function deep_read(value, visited = new Set()) {
if (
typeof value === 'object' &&
value !== null &&
// We don't want to traverse DOM elements
!(value instanceof EventTarget) &&
!visited.has(value)
) {
visited.add(value);
// When working with a possible SvelteDate, this
// will ensure we capture changes to it.
if (value instanceof Date) {
value.getTime();
}
for (let key in value) {
try {
deep_read(value[key], visited);
} catch (e) {
// continue
}
}
const proto = get_prototype_of(value);
if (
proto !== Object.prototype &&
proto !== Array.prototype &&
proto !== Map.prototype &&
proto !== Set.prototype &&
proto !== Date.prototype
) {
const descriptors = get_descriptors(proto);
for (let key in descriptors) {
const get = descriptors[key].get;
if (get) {
try {
get.call(value);
} catch (e) {
// continue
}
}
}
}
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does deep_read() do?
deep_read() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/runtime.js.
Where is deep_read() defined?
deep_read() is defined in packages/svelte/src/internal/client/runtime.js at line 801.
What calls deep_read()?
deep_read() is called by 1 function(s): deep_read_state.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free