packages/karbon/src/runtime/routes/snapshot-handler.ts
Function defineSnapshotHandler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function defineSnapshotHandler(input: DefineSnapshotHandlerInput | Handler): any {
const { handler, fixedName } = normalizeDefineSnapshotHandlerInput(input)
return async (event: any) => {
const _name = fixedName ? extractName(event.path) : event.context.params.name
const parsedName = parseName(_name)
Avoid too many return
statements within this function. Open
Open
return renderAsJavascript(result)