forked from karma-runner/karma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.js
34 lines (25 loc) · 754 Bytes
/
file.js
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
'use strict'
/**
* File object used for tracking files in `file-list.js`.
*/
class File {
constructor (path, mtime, doNotCache, type) {
// used for serving (processed path, eg some/file.coffee -> some/file.coffee.js)
this.path = path
// original absolute path, id of the file
this.originalPath = path
// where the content is stored (processed)
this.contentPath = path
// encodings format {[encodingType]: encodedContent}
// example: {gzip: <Buffer 1f 8b 08...>}
this.encodings = Object.create(null)
this.mtime = mtime
this.isUrl = false
this.doNotCache = doNotCache === undefined ? false : doNotCache
this.type = type
}
toString () {
return this.path
}
}
module.exports = File