UNPKG

680 BJavaScriptView Raw
1// File
2// ====
3//
4// File object used for tracking files in `file-list.js`
5
6// Dependencies
7// ------------
8
9var _ = require('lodash')
10
11// Constructor
12var File = function (path, mtime, doNotCache, type) {
13 // used for serving (processed path, eg some/file.coffee -> some/file.coffee.js)
14 this.path = path
15
16 // original absolute path, id of the file
17 this.originalPath = path
18
19 // where the content is stored (processed)
20 this.contentPath = path
21
22 this.mtime = mtime
23 this.isUrl = false
24
25 this.doNotCache = _.isUndefined(doNotCache) ? false : doNotCache
26
27 this.type = type
28}
29
30File.prototype.toString = function () {
31 return this.path
32}
33
34// PUBLIC
35module.exports = File