letmecook 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/src/sessions.ts +6 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "letmecook",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/rustydotwtf/letmecook.git"
@@ -20,12 +20,13 @@
20
20
  },
21
21
  "scripts": {
22
22
  "prepare": "husky",
23
+ "typecheck": "tsc --noEmit",
23
24
  "lint": "oxlint",
24
25
  "lint:fix": "oxlint --fix",
25
26
  "lint:ci": "oxlint --deny-warnings",
26
27
  "format": "oxfmt --write .",
27
28
  "format:check": "oxfmt --check .",
28
- "check": "bun run lint && bun run format:check",
29
+ "check": "bun run typecheck && bun run lint && bun run format:check",
29
30
  "fix": "bun run lint:fix && bun run format",
30
31
  "docs": "cd docs && bun start",
31
32
  "docs:build": "cd docs && bun run build",
package/src/sessions.ts CHANGED
@@ -188,15 +188,14 @@ export async function deleteSession(name: string): Promise<boolean> {
188
188
 
189
189
  export async function deleteAllSessions(): Promise<number> {
190
190
  const sessions = await listSessions();
191
- let deleted = 0;
191
+ const count = sessions.length;
192
192
 
193
- for (const session of sessions) {
194
- if (await deleteSession(session.name)) {
195
- deleted++;
196
- }
193
+ try {
194
+ await rm(SESSIONS_DIR, { recursive: true, force: true });
195
+ return count;
196
+ } catch {
197
+ return 0;
197
198
  }
198
-
199
- return deleted;
200
199
  }
201
200
 
202
201
  export async function sessionExists(name: string): Promise<boolean> {