file.js 608 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict'
  2. /**
  3. * File object used for tracking files in `file-list.js`.
  4. */
  5. class File {
  6. constructor (path, mtime, doNotCache, type) {
  7. // used for serving (processed path, eg some/file.coffee -> some/file.coffee.js)
  8. this.path = path
  9. // original absolute path, id of the file
  10. this.originalPath = path
  11. // where the content is stored (processed)
  12. this.contentPath = path
  13. this.mtime = mtime
  14. this.isUrl = false
  15. this.doNotCache = doNotCache === undefined ? false : doNotCache
  16. this.type = type
  17. }
  18. toString () {
  19. return this.path
  20. }
  21. }
  22. module.exports = File