feat(gemini): A whimsical Node.js utility to unearth and report forgotten files ('digital dust bunnies') in your file system.#5133
Conversation
…tten files ('digital dust bunnies') in your file system.
🤖 Review by GROQ Agent✅ What's solid
🧪 Tests
Suggested test snippet for symlink handling test('should skip symbolic links to avoid infinite recursion', () => {
const mockNow = new Date('2024-01-01T00:00:00Z');
const oldDate = new Date(mockNow.getTime() - 100 * 24 * 60 * 60 * 1000); // 100d
// Directory contains a symlink that points to its parent
fs.readdirSync.mockReturnValue([
{ name: 'link-to-parent', isDirectory: () => false, isFile: () => false, isSymbolicLink: () => true },
{ name: 'old.txt', isDirectory: () => false, isFile: () => true, isSymbolicLink: () => false },
]);
// lstat to detect symlink, stat for regular file
fs.lstatSync = jest.fn(p => {
if (p.endsWith('link-to-parent')) {
return { isSymbolicLink: () => true };
}
return { isSymbolicLink: () => false };
});
fs.statSync.mockReturnValue({ mtime: oldDate, size: 123 });
const result = findOldFiles('/test/symlink', 90);
expect(result).toHaveLength(1);
expect(result[0].path).toMatch(/old\.txt$/);
});🔒 Security
🧩 Docs / Developer Experience
🧱 Mocks / Fakes
TL;DR Action items
These tweaks will tighten security, improve developer ergonomics, and make the utility more robust for real‑world usage while preserving its whimsical charm. |
Implementation Summary
node-utils/nightly-nightly-digital-dust-bunny-4Rationale
Why safe to merge
node-utils/nightly-nightly-digital-dust-bunny-4.Test Plan
node-utils/nightly-nightly-digital-dust-bunny-4/README.mdnode-utils/nightly-nightly-digital-dust-bunny-4/tests/Links
Mock Justification