refactor code

This commit is contained in:
Andre Staltz 2023-12-20 09:34:42 +02:00
parent 62c321a1b8
commit b0cfedbb00
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
3 changed files with 19 additions and 8 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ pnpm-lock.yaml
package-lock.json
coverage
*~
lib/*.d.ts

View File

@ -130,8 +130,15 @@ function initGC(peer, config) {
: kbRemaining > 0
? `${kbRemaining}KB`
: `${bytesRemaining}B`
if (bytesRemaining > 0) {
// prettier-ignore
debug('Log is %s% full (only %s of free space), needs cleanup', percentUsed.toFixed(0), remaining)
} else if (bytesRemaining === 0) {
debug('Log is full, needs cleanup')
} else {
// prettier-ignore
debug('Log is %s% full (%s beyond limit), needs cleanup', percentUsed.toFixed(0), remaining.slice(1))
}
}
/**

View File

@ -11,8 +11,7 @@
},
"main": "index.js",
"files": [
"*.js",
"lib/*.js"
"lib/**"
],
"exports": {
".": {
@ -42,10 +41,14 @@
"rimraf": "^4.4.0",
"secret-handshake-ext": "^0.0.8",
"secret-stack": "~7.1.0",
"ssb-box": "^1.0.1"
"ssb-box": "^1.0.1",
"typescript": "^5.1.3"
},
"scripts": {
"test": "node --test",
"clean-check": "tsc --build --clean",
"prepublishOnly": "npm run clean-check && tsc --build",
"postpublish": "npm run clean-check",
"test": "npm run clean-check && node --test",
"format-code": "prettier --write \"(lib|test)/**/*.js\"",
"format-code-staged": "pretty-quick --staged --pattern \"(lib|test)/**/*.js\"",
"coverage": "c8 --reporter=lcov npm run test"