MCPcopy Create free account
hub / github.com/BuilderIO/framework-benchmarks / get

Function get

frameworks/lit/docs-src/api.11ty.cjs:81–91  ·  view source on GitHub ↗
(obj, path)

Source from the content-addressed store, hash-verified

79 * Reads a (possibly deep) path off of an object.
80 */
81const get = (obj, path) => {
82 let fallback = '';
83 if (Array.isArray(path)) {
84 [path, fallback] = path;
85 }
86 const parts = path.split('.');
87 while (obj && parts.length) {
88 obj = obj[parts.shift()];
89 }
90 return obj == null || obj === '' ? fallback : obj;
91};
92
93/**
94 * Renders a table of data, plucking the given properties from each item in

Callers 1

renderTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected