Skip to content

Commit 0aa0544

Browse files
renovate[bot]mrstorkkodiakhq[bot]
authoredMay 16, 2024··
fix(deps): update dependency jwt-decode to v4 (#6617)
* fix(deps): update dependency jwt-decode to v4 * chore: fix import syntax --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Mateusz Bocian <mateusz.bocian@netlify.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 14ec696 commit 0aa0544

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed
 

‎package-lock.json

+10-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"isexe": "2.0.0",
138138
"js-yaml": "4.1.0",
139139
"jsonwebtoken": "9.0.2",
140-
"jwt-decode": "3.1.2",
140+
"jwt-decode": "4.0.0",
141141
"lambda-local": "2.2.0",
142142
"listr2": "7.0.2",
143143
"locate-path": "7.2.0",

‎src/lib/functions/server.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path'
55
import express, { type RequestHandler } from 'express'
66
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'expr... Remove this comment to see the full error message
77
import expressLogging from 'express-logging'
8-
import jwtDecode from 'jwt-decode'
8+
import { jwtDecode } from 'jwt-decode'
99

1010
import type BaseCommand from '../../commands/base-command.js'
1111
import type { $TSFixMe } from '../../commands/types.js'
@@ -22,13 +22,13 @@ import type { BlobsContext } from '../blobs/blobs.js'
2222
import { headers as efHeaders } from '../edge-functions/headers.js'
2323
import { getGeoLocation } from '../geo-location.js'
2424

25+
import { UNLINKED_SITE_MOCK_ID } from '../../utils/dev.js'
2526
import { handleBackgroundFunction, handleBackgroundFunctionResult } from './background.js'
2627
import { createFormSubmissionHandler } from './form-submissions-handler.js'
2728
import { FunctionsRegistry } from './registry.js'
2829
import { handleScheduledFunction } from './scheduled.js'
2930
import { handleSynchronousFunction } from './synchronous.js'
3031
import { shouldBase64Encode } from './utils.js'
31-
import { UNLINKED_SITE_MOCK_ID } from '../../utils/dev.js'
3232

3333
// @ts-expect-error TS(7006) FIXME: Parameter 'headers' implicitly has an 'any' type.
3434
const buildClientContext = function (headers) {
@@ -53,7 +53,6 @@ const buildClientContext = function (headers) {
5353
try {
5454
// This data is available on both the context root and under custom.netlify for retro-compatibility.
5555
// In the future it will only be available in custom.netlify.
56-
// @ts-expect-error
5756
const user = jwtDecode(parts[1])
5857

5958
const netlifyContext = JSON.stringify({

‎src/utils/proxy.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import generateETag from 'etag'
1919
import getAvailablePort from 'get-port'
2020
import httpProxy from 'http-proxy'
2121
import { createProxyMiddleware } from 'http-proxy-middleware'
22-
import jwtDecode from 'jwt-decode'
22+
import { jwtDecode } from 'jwt-decode'
2323
import { locatePath } from 'locate-path'
2424
import { Match } from 'netlify-redirector'
2525
import pFilter from 'p-filter'
@@ -38,13 +38,13 @@ import { DEFAULT_FUNCTION_URL_EXPRESSION } from '../lib/functions/registry.js'
3838
import { initializeProxy as initializeImageProxy, isImageRequest } from '../lib/images/proxy.js'
3939
import renderErrorTemplate from '../lib/render-error-template.js'
4040

41-
import { NETLIFYDEVLOG, NETLIFYDEVWARN, log, chalk } from './command-helpers.js'
41+
import { NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, log } from './command-helpers.js'
4242
import createStreamPromise from './create-stream-promise.js'
43-
import { headersForPath, parseHeaders, NFFunctionName, NFRequestID, NFFunctionRoute } from './headers.js'
43+
import { NFFunctionName, NFFunctionRoute, NFRequestID, headersForPath, parseHeaders } from './headers.js'
4444
import { generateRequestID } from './request-id.js'
4545
import { createRewriter, onChanges } from './rules-proxy.js'
4646
import { signRedirect } from './sign-redirect.js'
47-
import { Rewriter, Request, ServerSettings } from './types.js'
47+
import { Request, Rewriter, ServerSettings } from './types.js'
4848

4949
const gunzip = util.promisify(zlib.gunzip)
5050
const brotliDecompress = util.promisify(zlib.brotliDecompress)
@@ -264,7 +264,6 @@ const serveRedirect = async function ({
264264
if (token) {
265265
let jwtValue = {}
266266
try {
267-
// @ts-expect-error TS(2349) This expression is not callable
268267
jwtValue = jwtDecode(token) || {}
269268
} catch (error) {
270269
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.

1 commit comments

Comments
 (1)

github-actions[bot] commented on May 16, 2024

@github-actions[bot]

📊 Benchmark results

  • Dependency count: 1,343
  • Package size: 313 MB
  • Number of ts-expect-error directives: 983
Please sign in to comment.