* Checks if stats have changed. * @param {Stats|null} oldStats Previous stats * @param {Stats|null} newStats Current stats * @returns {boolean} True if stats changed
(oldStats, newStats)
| 295 | * @returns {boolean} True if stats changed |
| 296 | */ |
| 297 | #statsChanged(oldStats, newStats) { |
| 298 | // File created or deleted |
| 299 | if ((oldStats === null) !== (newStats === null)) { |
| 300 | return true; |
| 301 | } |
| 302 | |
| 303 | // Both null - no change |
| 304 | if (oldStats === null && newStats === null) { |
| 305 | return false; |
| 306 | } |
| 307 | |
| 308 | // Compare mtime and size |
| 309 | if (oldStats.mtimeMs !== newStats.mtimeMs) { |
| 310 | return true; |
| 311 | } |
| 312 | if (oldStats.size !== newStats.size) { |
| 313 | return true; |
| 314 | } |
| 315 | |
| 316 | return false; |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * Determines the event type based on stats change. |
no outgoing calls
no test coverage detected