MCPcopy Create free account
hub / github.com/error311/FileRise / normalizeItem

Function normalizeItem

public/js/folderManager.js:365–380  ·  view source on GitHub ↗
(it)

Source from the content-addressed store, hash-verified

363}
364
365function normalizeItem(it) {
366 if (it == null) return null;
367 if (typeof it === 'string') return { name: it, locked: false, hasSubfolders: undefined, nonEmpty: undefined };
368 if (typeof it === 'object') {
369 const nm = String(it.name ?? '').trim();
370 if (!nm) return null;
371 return {
372 name: nm,
373 locked: !!it.locked,
374 hasSubfolders: (typeof it.hasSubfolders === 'boolean') ? it.hasSubfolders : undefined,
375 nonEmpty: (typeof it.nonEmpty === 'boolean') ? it.nonEmpty : undefined,
376 encrypted: (typeof it.encrypted === 'boolean') ? it.encrypted : undefined,
377 };
378 }
379 return null;
380}
381
382/* ----------------------
383 Folder Tree State (Save/Load)

Callers 1

makeChildLiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected