@nxtedition/lib 15.0.1 → 15.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/mime.js +3 -3
  2. package/package.json +1 -1
package/mime.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const mime = require('mime')
2
2
 
3
3
  function lookup(name) {
4
- if (!name) {
4
+ if (typeof name !== 'string' || name.length === 0) {
5
5
  return null
6
6
  }
7
7
  if (/\.nut$/.test(name)) {
@@ -30,7 +30,7 @@ function lookup(name) {
30
30
  }
31
31
 
32
32
  function extension(type, name) {
33
- if (!type) {
33
+ if (typeof type !== 'string' || type.length === 0) {
34
34
  return null
35
35
  }
36
36
  if (/video\/(x-)?nut/.test(type)) {
@@ -51,7 +51,7 @@ function extension(type, name) {
51
51
 
52
52
  const extension = mime.getExtension(type) || (type || '').split('/').pop()
53
53
 
54
- if (extension === 'qt' && name?.endsWith('mov')) {
54
+ if (extension === 'qt' && typeof name === 'string' && name.endsWith('mov')) {
55
55
  return 'mov'
56
56
  }
57
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "15.0.1",
3
+ "version": "15.0.2",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "files": [