Files
react-native-devtools-frontend/node_modules/karma/lib/file.js
T
Tim van der Lippe 5226a88fe0 Update karma-related packages
This updates karma to 5.2.3, karma-coverage to the officially
published version 2.0.3 (we were previously relying on a git
commit) and karma-sourcemap-loader to 0.3.8.

DISABLE_THIRD_PARTY_CHECK=Update Karma

R=aerotwist@chromium.org

Change-Id: Iaa365379d7c2c6eb9145b1507be1a0a3ae812359
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2527043
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-09 17:42:16 +00:00

48 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) {
// 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
}
/**
* Detect type from the file extension.
* @returns {string} detected file type or empty string
*/
detectType () {
return path.extname(this.path).substring(1)
}
toString () {
return this.path
}
}
module.exports = File