Skip to content

Commit 7e6844c

Browse files
Drop support for node14 (#3855)
1 parent 8313944 commit 7e6844c

File tree

8 files changed

+14
-13649
lines changed

8 files changed

+14
-13649
lines changed

.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ module.exports = {
390390
'prefer-exponentiation-operator': 'error',
391391
'prefer-named-capture-group': 'off', // TODO: needs a better support in TS, see https://github.com/microsoft/TypeScript/issues/32098
392392
'prefer-numeric-literals': 'error',
393-
'prefer-object-has-own': 'off', // TODO: requires Node.js v16.9.0
393+
'prefer-object-has-own': 'error',
394394
'prefer-object-spread': 'error',
395395
'prefer-promise-reject-errors': 'error',
396396
'prefer-regex-literals': 'error',

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145
runs-on: ubuntu-latest
146146
strategy:
147147
matrix:
148-
node_version_to_setup: [14, 16, 18]
148+
node_version_to_setup: [16, 18, 19]
149149
permissions:
150150
contents: read # for actions/checkout
151151
steps:

package-lock.json

+5-13,636
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
@@ -26,7 +26,7 @@
2626
"graphql-js"
2727
],
2828
"engines": {
29-
"node": "^14.19.0 || ^16.10.0 || ^18.0.0 || >=19.0.0"
29+
"node": "^16.19.0 || ^18.14.0 || >=19.7.0"
3030
},
3131
"scripts": {
3232
"preversion": ". ./resources/checkgit.sh && npm ci --ignore-scripts",
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
33
"engines": {
4-
"node": ">= 14.0.0"
4+
"node": ">= 16.0.0"
55
}
66
}

src/execution/values.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function coerceVariableValues(
9292
continue;
9393
}
9494

95-
if (!hasOwnProperty(inputs, varName)) {
95+
if (!Object.hasOwn(inputs, varName)) {
9696
if (varDefNode.defaultValue) {
9797
coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);
9898
} else if (isNonNullType(varType)) {
@@ -186,7 +186,7 @@ export function getArgumentValues(
186186
const variableName = valueNode.name.value;
187187
if (
188188
variableValues == null ||
189-
!hasOwnProperty(variableValues, variableName)
189+
!Object.hasOwn(variableValues, variableName)
190190
) {
191191
if (argDef.defaultValue !== undefined) {
192192
coercedValues[name] = argDef.defaultValue;
@@ -249,7 +249,3 @@ export function getDirectiveValues(
249249
return getArgumentValues(directiveDef, directiveNode, variableValues);
250250
}
251251
}
252-
253-
function hasOwnProperty(obj: unknown, prop: string): boolean {
254-
return Object.prototype.hasOwnProperty.call(obj, prop);
255-
}

src/language/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ export class Parser {
14491449
parseDirectiveLocation(): NameNode {
14501450
const start = this._lexer.token;
14511451
const name = this.parseName();
1452-
if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) {
1452+
if (Object.hasOwn(DirectiveLocation, name.value)) {
14531453
return name;
14541454
}
14551455
throw this.unexpected(start);

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
],
88
"compilerOptions": {
99
"lib": [
10-
"es2020",
10+
"es2022",
1111
"dom" // Workaround for missing web-compatible globals in `@types/node`
1212
],
13-
"target": "es2020",
13+
"target": "es2021",
1414
"module": "es2022",
1515
"moduleResolution": "node",
1616
"noEmit": true,

0 commit comments

Comments
 (0)