All files / src/filesystem stats.js

71.43% Statements 10/14
100% Branches 0/0
50% Functions 4/8
71.43% Lines 10/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42        21x 21x 21x 21x 21x 21x 21x       2x       1x       1x                                      
import MODE from './mode'
 
export default class Stats {
  constructor (node, devName) {
    this.node = node
    this.dev = devName
    this.size = node.size
    this.atime = node.atime
    this.ctime = node.ctime
    this.mtime = node.mtime
    this.type = node.mode
  }
 
  isFile () {
    return (this.type === MODE.FILE)
  }
 
  isDirectory () {
    return (this.type === MODE.DIR)
  }
 
  isSymbolicLink () {
    return (this.type === MODE.SYMBOLIC_LINK)
  }
 
  isSocket () {
    return false
  }
 
  isFIFO () {
    return false
  }
 
  isCharacterDevice () {
    return false
  }
 
  isBlockDevice () {
    return false
  }
}