MCPcopy
hub / github.com/tinyhttp/tinyhttp / shouldSave

Function shouldSave

packages/session/src/index.ts:351–356  ·  view source on GitHub ↗
(id?: string, session?: Session)

Source from the content-addressed store, hash-verified

349
350 // determine if session should be saved to store
351 function shouldSave(id?: string, session?: Session) {
352 // cannot set cookie without a session ID
353 if (typeof id !== 'string' || !session) return false
354
355 return !saveUninitialized && cookieId !== id ? isModified(session) : !isSaved(session)
356 }
357
358 // determine if session should be touched
359 const shouldTouch = (id?: string, session?: Session) =>

Callers 2

shouldTouchFunction · 0.85
SessionManagerFunction · 0.85

Calls 2

isModifiedFunction · 0.85
isSavedFunction · 0.85

Tested by

no test coverage detected