MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / parsePositiveInt

Function parsePositiveInt

tooling/scripts/sidebar-vim-smoke.mjs:47–50  ·  view source on GitHub ↗
(raw, fallback)

Source from the content-addressed store, hash-verified

45const skipBuild = process.env.ZEN_SIDEBAR_VIM_SKIP_BUILD === '1'
46
47function parsePositiveInt(raw, fallback) {
48 const n = Number.parseInt(raw ?? '', 10)
49 return Number.isFinite(n) && n > 0 ? n : fallback
50}
51const sleep = (ms) => new Promise((r) => setTimeout(r, ms))
52const pad = (n) => String(n).padStart(5, '0')
53const lastNoteFile = `${pad(NOTE_COUNT - 1)} - note.md`

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected