mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-28 21:24:26 +08:00
No changes in the changelog (https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) to concern ourselves about, but one useful change is they upgraded the log4js dependency which was spitting out console messages on each test run. This is fixed with this version of Karma. Bug: none Change-Id: Ic49618cbda7a079cacb9813f5129692a83508a92 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3745621 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
'use strict'
|
|
|
|
const path = require('path')
|
|
|
|
/**
|
|
* File object used for tracking files in `file-list.js`.
|
|
*/
|
|
class File {
|
|
constructor (path, mtime, doNotCache, type, isBinary, integrity) {
|
|
// 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
|
|
|
|
// Tri state: null means probe file for binary.
|
|
this.isBinary = isBinary === undefined ? null : isBinary
|
|
|
|
this.integrity = integrity
|
|
}
|
|
|
|
/**
|
|
* Detect type from the file extension.
|
|
* @returns {string} detected file type or empty string
|
|
*/
|
|
detectType () {
|
|
return path.extname(this.path).slice(1)
|
|
}
|
|
|
|
toString () {
|
|
return this.path
|
|
}
|
|
}
|
|
|
|
module.exports = File
|