MCPcopy
hub / github.com/electerm/electerm / needsEnc

Function needsEnc

src/app/lib/nedb.js:81–85  ·  view source on GitHub ↗

* Returns true when a specific document in a specific table should be * encrypted. The 'data' table is selective: only _id === 'userConfig'.

(dbName, id)

Source from the content-addressed store, hash-verified

79 * encrypted. The 'data' table is selective: only _id === 'userConfig'.
80 */
81 function needsEnc (dbName, id) {
82 if (!enc) return false
83 if (dbName === 'data') return id === DATA_ENC_ID
84 return ENC_TABLES.has(dbName)
85 }
86
87 /**
88 * Wrap a result document by decrypting its `data` field when needed.

Callers 3

decryptDocFunction · 0.85
encryptDocFunction · 0.85
dbActionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected