Skip to content

Commit dd0c5df

Browse files
authored
Merge pull request #1004 from postmanlabs/feature/drop-node-support
Drop support for Node < 16
2 parents cc0f575 + 573ff80 commit dd0c5df

File tree

12 files changed

+9860
-753
lines changed

12 files changed

+9860
-753
lines changed

.eslintrc

Lines changed: 149 additions & 144 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
schedule:
1111
- cron: '0 12 * * 0'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
lint:
1519
name: Lint
@@ -19,10 +23,10 @@ jobs:
1923
- name: Checkout repository
2024
uses: actions/checkout@v3
2125

22-
- name: Use Node.js 16.x
26+
- name: Use Node.js 18.x
2327
uses: actions/setup-node@v3
2428
with:
25-
node-version: 16.x
29+
node-version: 18.x
2630
cache: 'npm'
2731

2832
- name: Install
@@ -39,10 +43,10 @@ jobs:
3943
- name: Checkout repository
4044
uses: actions/checkout@v3
4145

42-
- name: Use Node.js 16.x
46+
- name: Use Node.js 18.x
4347
uses: actions/setup-node@v3
4448
with:
45-
node-version: 16.x
49+
node-version: 18.x
4650
cache: 'npm'
4751

4852
- name: Install
@@ -60,11 +64,11 @@ jobs:
6064
strategy:
6165
fail-fast: false
6266
matrix:
63-
node-version: [10, 12]
67+
node-version: [16, 18]
6468
os: [ubuntu-latest, windows-latest]
6569
include:
6670
- coverage: true
67-
node-version: 16
71+
node-version: 20
6872
os: ubuntu-latest
6973

7074
steps:

CHANGELOG.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
unreleased:
2+
breaking changes:
3+
- GH-1004 Dropped support for Node < v16
4+
chores:
5+
- GH-1004 Updated ESLint rules
6+
17
4.7.1:
28
date: 2024-04-03
39
fixed bugs:

lib/postman-sandbox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class PostmanSandbox extends UniversalVM {
5757
this.emit('console', cursor, level, ...teleportJS.parse(args));
5858
});
5959

60-
// eslint-disable-next-line callback-return
60+
// eslint-disable-next-line n/callback-return
6161
callback(err, context);
6262
context = null;
6363
});
@@ -130,7 +130,7 @@ class PostmanSandbox extends UniversalVM {
130130
// errors
131131
this.once(executionEventName, (err, result) => {
132132
waiting && (waiting = clearTimeout(waiting)); // clear timeout interrupt
133-
if (Object.hasOwnProperty.call(this._executing, id)) { // clear any pending timeouts
133+
if (Object.hasOwn(this._executing, id)) { // clear any pending timeouts
134134
this._executing[id] && clearTimeout(this._executing[id]);
135135
delete this._executing[id];
136136
}

lib/sandbox/cookie-jar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ class PostmanCookieJar {
247247

248248
options = {
249249
// return HttpOnly cookies by default
250-
http: Object.hasOwnProperty.call(options, 'http') ? Boolean(options.http) : true,
250+
http: Object.hasOwn(options, 'http') ? Boolean(options.http) : true,
251251
// if undefined, auto-detect from url
252-
secure: Object.hasOwnProperty.call(options, 'secure') ? Boolean(options.secure) : undefined
252+
secure: Object.hasOwn(options, 'secure') ? Boolean(options.secure) : undefined
253253
};
254254

255255
this.jar.getCookies(url.toString(true), options, function (err, cookies) {

lib/sandbox/pmapi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const _ = require('lodash'),
2626
for (prop in properties) {
2727
if (
2828
!_.includes(disabledProperties, prop) &&
29-
Object.hasOwnProperty.call(properties, prop) &&
29+
Object.hasOwn(properties, prop) &&
3030
(properties[prop] !== undefined)
3131
) {
3232
config.value = properties[prop];

lib/sandbox/postman-legacy-interface.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class PostmanLegacyInterface {
217217

218218
clearEnvironmentVariables () {
219219
for (var prop in this.__environment) {
220-
if (Object.hasOwnProperty.call(this.__environment, prop)) {
220+
if (Object.hasOwn(this.__environment, prop)) {
221221
delete this.__environment[prop];
222222
}
223223
}
@@ -246,7 +246,7 @@ class PostmanLegacyInterface {
246246

247247
clearGlobalVariables () {
248248
for (var prop in this.__globals) {
249-
if (Object.hasOwnProperty.call(this.__globals, prop)) {
249+
if (Object.hasOwn(this.__globals, prop)) {
250250
delete this.__globals[prop];
251251
}
252252
}

0 commit comments

Comments
 (0)