Skip to content

Commit d24df7a

Browse files
authored
fix(api): bumping the node support to 18 for v4 functions (#564)
1 parent 1fec77e commit d24df7a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/core/func-core-tools.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ describe("funcCoreTools", () => {
6666
expect(isCoreToolsVersionCompatible(4, 16)).toBe(true);
6767
expect(isCoreToolsVersionCompatible(3, 16)).toBe(false);
6868
expect(isCoreToolsVersionCompatible(2, 16)).toBe(false);
69-
expect(isCoreToolsVersionCompatible(4, 17)).toBe(false);
69+
expect(isCoreToolsVersionCompatible(4, 17)).toBe(true);
7070
expect(isCoreToolsVersionCompatible(3, 17)).toBe(false);
7171
expect(isCoreToolsVersionCompatible(2, 17)).toBe(false);
72+
expect(isCoreToolsVersionCompatible(4, 18)).toBe(true);
73+
expect(isCoreToolsVersionCompatible(3, 18)).toBe(false);
74+
expect(isCoreToolsVersionCompatible(2, 18)).toBe(false);
7275
});
7376
});
7477

src/core/func-core-tools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function isCoreToolsVersionCompatible(coreToolsVersion: number, nodeVersi
4242
// Runtime support reference: https://docs.microsoft.com/azure/azure-functions/functions-versions?pivots=programming-language-javascript#languages
4343
switch (coreToolsVersion) {
4444
case 4:
45-
return nodeVersion >= 14 && nodeVersion <= 16;
45+
return nodeVersion >= 14 && nodeVersion <= 18;
4646
case 3:
4747
return nodeVersion >= 10 && nodeVersion <= 14;
4848
case 2:
@@ -54,7 +54,7 @@ export function isCoreToolsVersionCompatible(coreToolsVersion: number, nodeVersi
5454

5555
export function detectTargetCoreToolsVersion(nodeVersion: number): number {
5656
// Pick the highest version that is compatible with the specified Node version
57-
if (nodeVersion >= 14 && nodeVersion <= 16) return 4;
57+
if (nodeVersion >= 14 && nodeVersion <= 18) return 4;
5858
if (nodeVersion >= 10 && nodeVersion < 14) return 3;
5959
if (nodeVersion >= 8 && nodeVersion < 10) return 2;
6060

0 commit comments

Comments
 (0)