KV-store backed Express 5 app for tracking electronic components, their arbitrary fields, and inventory locations (physical, BOM, digital). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
537 B
JavaScript
17 lines
537 B
JavaScript
export function qs(scope, selector) {
|
|
if (typeof scope === 'string') return document.querySelector(scope);
|
|
return scope.querySelector(selector);
|
|
}
|
|
|
|
export function clone(template_id) {
|
|
return document.getElementById(template_id).content.cloneNode(true).firstElementChild;
|
|
}
|
|
|
|
export function set_text(el, selector, text) {
|
|
const target = typeof selector === 'string' ? el.querySelector(selector) : selector;
|
|
target.textContent = text;
|
|
}
|
|
|
|
export function show(el) { el.hidden = false; }
|
|
export function hide(el) { el.hidden = true; }
|