MCPcopy Index your code
hub / github.com/nodejs/node / #determineEventType

Method #determineEventType

lib/internal/vfs/watcher.js:325–332  ·  view source on GitHub ↗

* Determines the event type based on stats change. * @param {Stats|null} oldStats Previous stats * @param {Stats|null} newStats Current stats * @returns {string} 'rename' or 'change'

(oldStats, newStats)

Source from the content-addressed store, hash-verified

323 * @returns {string} 'rename' or 'change'
324 */
325 #determineEventType(oldStats, newStats) {
326 // File was created or deleted
327 if ((oldStats === null) !== (newStats === null)) {
328 return 'rename';
329 }
330 // Content changed
331 return 'change';
332 }
333
334 /**
335 * Closes the watcher and stops polling.

Callers 2

#pollMethod · 0.95
#pollDirectoryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected