@depup/type-is 2.0.1-depup.0 → 2.1.0-depup.53
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.
- package/README.md +4 -3
- package/changes.json +6 -2
- package/index.js +8 -18
- package/package.json +17 -9
package/README.md
CHANGED
|
@@ -13,15 +13,16 @@ npm install @depup/type-is
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [type-is](https://www.npmjs.com/package/type-is) @ 2.0
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [type-is](https://www.npmjs.com/package/type-is) @ 2.1.0 |
|
|
17
|
+
| Processed | 2026-07-26 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 2 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
+
| media-typer | ^1.1.0 | ^2.0.0 |
|
|
25
26
|
| mime-types | ^3.0.0 | ^3.0.2 |
|
|
26
27
|
|
|
27
28
|
---
|
package/changes.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bumped": {
|
|
3
|
+
"media-typer": {
|
|
4
|
+
"from": "^1.1.0",
|
|
5
|
+
"to": "^2.0.0"
|
|
6
|
+
},
|
|
3
7
|
"mime-types": {
|
|
4
8
|
"from": "^3.0.0",
|
|
5
9
|
"to": "^3.0.2"
|
|
6
10
|
}
|
|
7
11
|
},
|
|
8
|
-
"timestamp": "2026-
|
|
9
|
-
"totalUpdated":
|
|
12
|
+
"timestamp": "2026-07-26T00:59:41.969Z",
|
|
13
|
+
"totalUpdated": 2
|
|
10
14
|
}
|
package/index.js
CHANGED
|
@@ -42,11 +42,16 @@ module.exports.match = mimeMatch
|
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
44
|
function typeis (value, types_) {
|
|
45
|
+
// Backward compatibility. TODO: Remove.
|
|
46
|
+
if (value && typeof value === 'object') {
|
|
47
|
+
value = value.headers['content-type']
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
var i
|
|
46
51
|
var types = types_
|
|
47
52
|
|
|
48
53
|
// remove parameters and normalize
|
|
49
|
-
var val =
|
|
54
|
+
var val = normalizeType(value)
|
|
50
55
|
|
|
51
56
|
// no type or invalid
|
|
52
57
|
if (!val) {
|
|
@@ -228,23 +233,8 @@ function mimeMatch (expected, actual) {
|
|
|
228
233
|
* @private
|
|
229
234
|
*/
|
|
230
235
|
function normalizeType (value) {
|
|
231
|
-
|
|
232
|
-
var type = contentType.parse(value).type
|
|
236
|
+
if (!value) return null
|
|
237
|
+
var type = contentType.parse(value, { parameters: false }).type
|
|
233
238
|
|
|
234
239
|
return typer.test(type) ? type : null
|
|
235
240
|
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Try to normalize a type and remove parameters.
|
|
239
|
-
*
|
|
240
|
-
* @param {string} value
|
|
241
|
-
* @return {(string|null)}
|
|
242
|
-
* @private
|
|
243
|
-
*/
|
|
244
|
-
function tryNormalizeType (value) {
|
|
245
|
-
try {
|
|
246
|
-
return value ? normalizeType(value) : null
|
|
247
|
-
} catch (err) {
|
|
248
|
-
return null
|
|
249
|
-
}
|
|
250
|
-
}
|
package/package.json
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/type-is",
|
|
3
3
|
"description": "Infer the content-type of a request. (with updated dependencies)",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0-depup.53",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
7
|
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
8
8
|
],
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": "jshttp/type-is",
|
|
11
|
+
"funding": {
|
|
12
|
+
"type": "opencollective",
|
|
13
|
+
"url": "https://opencollective.com/express"
|
|
14
|
+
},
|
|
11
15
|
"dependencies": {
|
|
12
|
-
"content-type": "^
|
|
13
|
-
"media-typer": "^
|
|
16
|
+
"content-type": "^2.0.0",
|
|
17
|
+
"media-typer": "^2.0.0",
|
|
14
18
|
"mime-types": "^3.0.2"
|
|
15
19
|
},
|
|
16
20
|
"devDependencies": {
|
|
17
21
|
"eslint": "7.32.0",
|
|
18
22
|
"eslint-config-standard": "14.1.1",
|
|
19
|
-
"eslint-plugin-import": "2.
|
|
23
|
+
"eslint-plugin-import": "2.31.0",
|
|
20
24
|
"eslint-plugin-markdown": "2.2.1",
|
|
21
25
|
"eslint-plugin-node": "11.1.0",
|
|
22
26
|
"eslint-plugin-promise": "5.2.0",
|
|
23
27
|
"eslint-plugin-standard": "4.1.0",
|
|
24
|
-
"mocha": "9.2.
|
|
28
|
+
"mocha": "9.2.2",
|
|
25
29
|
"nyc": "15.1.0"
|
|
26
30
|
},
|
|
27
31
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
32
|
+
"node": ">= 18"
|
|
29
33
|
},
|
|
30
34
|
"files": [
|
|
31
35
|
"LICENSE",
|
|
@@ -54,15 +58,19 @@
|
|
|
54
58
|
],
|
|
55
59
|
"depup": {
|
|
56
60
|
"changes": {
|
|
61
|
+
"media-typer": {
|
|
62
|
+
"from": "^1.1.0",
|
|
63
|
+
"to": "^2.0.0"
|
|
64
|
+
},
|
|
57
65
|
"mime-types": {
|
|
58
66
|
"from": "^3.0.0",
|
|
59
67
|
"to": "^3.0.2"
|
|
60
68
|
}
|
|
61
69
|
},
|
|
62
|
-
"depsUpdated":
|
|
70
|
+
"depsUpdated": 2,
|
|
63
71
|
"originalPackage": "type-is",
|
|
64
|
-
"originalVersion": "2.0
|
|
65
|
-
"processedAt": "2026-
|
|
72
|
+
"originalVersion": "2.1.0",
|
|
73
|
+
"processedAt": "2026-07-26T00:59:44.235Z",
|
|
66
74
|
"smokeTest": "passed"
|
|
67
75
|
}
|
|
68
76
|
}
|