Skip to content

Commit 3f87102

Browse files
committed
feat(node)!: upgrade to v20
1 parent 94ec6ac commit 3f87102

File tree

4 files changed

+16
-42
lines changed

4 files changed

+16
-42
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest]
19-
node: [18]
19+
node: [20]
2020

2121
steps:
2222
- uses: actions/setup-node@v3

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"type": "module",
66
"engines": {
7-
"node": ">=18.0.0"
7+
"node": ">=20.0.0"
88
},
99
"homepage": "https://nuxt-security.vercel.app",
1010
"description": "🛡️ Security Module for Nuxt based on HTTP Headers and Middleware",
@@ -68,7 +68,7 @@
6868
"@nuxt/module-builder": "^0.8.3",
6969
"@nuxt/schema": "^3.11.2",
7070
"@nuxt/test-utils": "^3.12.0",
71-
"@types/node": "^18.18.1",
71+
"@types/node": "^20.14.8",
7272
"changelogen": "^0.5.7",
7373
"eslint": "^8.50.0",
7474
"nuxt": "^3.11.2",

src/utils/crypto.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
// These two lines are required only to maintain compatibility with Node 18
2-
// - In Node 19 and above, crypto is available in the global scope
3-
// - In Workers environments, crypto is available in the global scope
4-
import { webcrypto } from 'node:crypto'
5-
globalThis.crypto ??= webcrypto as Crypto
6-
71
export async function generateHash(content: Buffer | string, hashAlgorithm: 'SHA-256' | 'SHA-384' | 'SHA-512') {
82
let buffer: Uint8Array
93
if (typeof content === 'string') {

yarn.lock

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,12 +1936,12 @@
19361936
dependencies:
19371937
undici-types "~5.26.4"
19381938

1939-
"@types/node@^18.18.1":
1940-
version "18.19.29"
1941-
resolved "https://registry.npmjs.org/@types/node/-/node-18.19.29.tgz"
1942-
integrity sha512-5pAX7ggTmWZdhUrhRWLPf+5oM7F80bcKVCBbr0zwEkTNzTJL2CWQjznpFgHYy6GrzkYi2Yjy7DHKoynFxqPV8g==
1939+
"@types/node@^20.14.8":
1940+
version "20.19.2"
1941+
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.2.tgz#bdef79b0b5b16caa76ab1f7094183302423b94a1"
1942+
integrity sha512-9pLGGwdzOUBDYi0GNjM97FIA+f92fqSke6joWeBjWXllfNxZBs7qeMF7tvtOIsbY45xkWkxrdwUfUf3MnQa9gA==
19431943
dependencies:
1944-
undici-types "~5.26.4"
1944+
undici-types "~6.21.0"
19451945

19461946
"@types/normalize-package-data@^2.4.0":
19471947
version "2.4.4"
@@ -6933,16 +6933,7 @@ streamx@^2.15.0:
69336933
optionalDependencies:
69346934
bare-events "^2.2.0"
69356935

6936-
"string-width-cjs@npm:string-width@^4.2.0":
6937-
version "4.2.3"
6938-
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
6939-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
6940-
dependencies:
6941-
emoji-regex "^8.0.0"
6942-
is-fullwidth-code-point "^3.0.0"
6943-
strip-ansi "^6.0.1"
6944-
6945-
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
6936+
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
69466937
version "4.2.3"
69476938
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
69486939
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -6974,14 +6965,7 @@ string_decoder@~1.1.1:
69746965
dependencies:
69756966
safe-buffer "~5.1.0"
69766967

6977-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
6978-
version "6.0.1"
6979-
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
6980-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
6981-
dependencies:
6982-
ansi-regex "^5.0.1"
6983-
6984-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
6968+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
69856969
version "6.0.1"
69866970
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
69876971
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -7315,6 +7299,11 @@ undici-types@~5.26.4:
73157299
resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz"
73167300
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
73177301

7302+
undici-types@~6.21.0:
7303+
version "6.21.0"
7304+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
7305+
integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
7306+
73187307
undici@^5.28.2:
73197308
version "5.28.4"
73207309
resolved "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz"
@@ -7862,16 +7851,7 @@ wide-align@^1.1.2:
78627851
dependencies:
78637852
string-width "^1.0.2 || 2 || 3 || 4"
78647853

7865-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
7866-
version "7.0.0"
7867-
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
7868-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
7869-
dependencies:
7870-
ansi-styles "^4.0.0"
7871-
string-width "^4.1.0"
7872-
strip-ansi "^6.0.0"
7873-
7874-
wrap-ansi@^7.0.0:
7854+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
78757855
version "7.0.0"
78767856
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
78777857
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==

0 commit comments

Comments
 (0)