MCPcopy
hub / github.com/massCodeIO/massCode / sanitizeCodeState

Function sanitizeCodeState

src/main/store/module/app.ts:154–169  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

152}
153
154function sanitizeCodeState(value: unknown): CodeState {
155 const source = asRecord(value)
156 const state: CodeState = {}
157
158 if (typeof source.snippetId === 'number')
159 state.snippetId = source.snippetId
160 if (typeof source.snippetContentIndex === 'number')
161 state.snippetContentIndex = source.snippetContentIndex
162 if (typeof source.folderId === 'number')
163 state.folderId = source.folderId
164 if (typeof source.tagId === 'number')
165 state.tagId = source.tagId
166 if (typeof source.libraryFilter === 'string')
167 state.libraryFilter = source.libraryFilter
168 return state
169}
170
171function sanitizeHttpState(value: unknown): HttpState {
172 const source = asRecord(value)

Callers 1

sanitizeAppStoreFunction · 0.85

Calls 1

asRecordFunction · 0.90

Tested by

no test coverage detected