Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma

Package Overview
Dependencies
Maintainers
5
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma - npm Package Compare versions

Comparing version 5.0.6 to 5.0.7

10

lib/file.js
'use strict'
const path = require('path')
/**

@@ -32,2 +34,10 @@ * File object used for tracking files in `file-list.js`.

/**
* Detect type from the file extension.
* @returns {string} detected file type or empty string
*/
detectType () {
return path.extname(this.path).substring(1)
}
toString () {

@@ -34,0 +44,0 @@ return this.path

16

lib/middleware/karma.js

@@ -14,5 +14,3 @@ /**

const path = require('path')
const url = require('url')
const helper = require('../helper')

@@ -168,6 +166,14 @@ const log = require('../logger').create('middleware:karma')

let filePath = file.path
const fileType = file.type || path.extname(filePath).substring(1)
const fileType = file.type || file.detectType()
if (helper.isDefined(fileType) && !FILE_TYPES.includes(fileType)) {
log.warn(`Invalid file type (${fileType}), defaulting to js.`)
if (!FILE_TYPES.includes(fileType)) {
if (file.type == null) {
log.warn(
`Unable to determine file type from the file extension, defaulting to js.\n` +
` To silence the warning specify a valid type for ${file.originalPath} in the configuration file.\n` +
` See http://karma-runner.github.io/latest/config/files.html`
)
} else {
log.warn(`Invalid file type (${file.type || 'empty string'}), defaulting to js.`)
}
}

@@ -174,0 +180,0 @@

'use strict'
const path = require('path')
const { URL } = require('url')
/**

@@ -9,2 +12,3 @@ * Url object used for tracking files in `file-list.js`.

this.path = path
this.originalPath = path
this.type = type

@@ -14,2 +18,10 @@ this.isUrl = true

/**
* Detect type from the file extension in the path part of the URL.
* @returns {string} detected file type or empty string
*/
detectType () {
return path.extname(new URL(this.path).pathname).substring(1)
}
toString () {

@@ -16,0 +28,0 @@ return this.path

@@ -480,3 +480,3 @@ {

},
"version": "5.0.6",
"version": "5.0.7",
"license": "MIT",

@@ -483,0 +483,0 @@ "husky": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc