Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:postmanlabs/postman-sandbox into…
Browse files Browse the repository at this point in the history
… feature/worker_threads
  • Loading branch information
appurva21 committed Jun 12, 2024
2 parents 9533bd0 + 5633762 commit 0a34593
Show file tree
Hide file tree
Showing 12 changed files with 9,864 additions and 760 deletions.
293 changes: 149 additions & 144 deletions .eslintrc

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
schedule:
- cron: '0 12 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
Expand All @@ -19,10 +23,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x
cache: 'npm'

- name: Install
Expand All @@ -39,10 +43,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 18.x
cache: 'npm'

- name: Install
Expand All @@ -60,11 +64,11 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10, 12]
node-version: [16, 18]
os: [ubuntu-latest, windows-latest]
include:
- coverage: true
node-version: 16
node-version: 20
os: ubuntu-latest

steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
unreleased:
new features:
- GH-999 Improved isolation for executing scripts
breaking changes:
- GH-1004 Dropped support for Node < v16
chores:
- GH-999 Bumped `uvm` dependency
- GH-1004 Updated ESLint rules

4.7.1:
date: 2024-04-03
Expand Down
4 changes: 2 additions & 2 deletions lib/postman-sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PostmanSandbox extends UniversalVM {
this.emit('console', cursor, level, ...teleportJS.parse(args));
});

// eslint-disable-next-line callback-return
// eslint-disable-next-line n/callback-return
callback(err, context);
context = null;
});
Expand Down Expand Up @@ -128,7 +128,7 @@ class PostmanSandbox extends UniversalVM {
// errors
this.once(executionEventName, (err, result) => {
waiting && (waiting = clearTimeout(waiting)); // clear timeout interrupt
if (Object.hasOwnProperty.call(this._executing, id)) { // clear any pending timeouts
if (Object.hasOwn(this._executing, id)) { // clear any pending timeouts
this._executing[id] && clearTimeout(this._executing[id]);
delete this._executing[id];
}
Expand Down
4 changes: 2 additions & 2 deletions lib/sandbox/cookie-jar.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ class PostmanCookieJar {

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

this.jar.getCookies(url.toString(true), options, function (err, cookies) {
Expand Down
2 changes: 1 addition & 1 deletion lib/sandbox/pmapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const _ = require('lodash'),
for (prop in properties) {
if (
!_.includes(disabledProperties, prop) &&
Object.hasOwnProperty.call(properties, prop) &&
Object.hasOwn(properties, prop) &&
(properties[prop] !== undefined)
) {
config.value = properties[prop];
Expand Down
4 changes: 2 additions & 2 deletions lib/sandbox/postman-legacy-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class PostmanLegacyInterface {

clearEnvironmentVariables () {
for (var prop in this.__environment) {
if (Object.hasOwnProperty.call(this.__environment, prop)) {
if (Object.hasOwn(this.__environment, prop)) {
delete this.__environment[prop];
}
}
Expand Down Expand Up @@ -246,7 +246,7 @@ class PostmanLegacyInterface {

clearGlobalVariables () {
for (var prop in this.__globals) {
if (Object.hasOwnProperty.call(this.__globals, prop)) {
if (Object.hasOwn(this.__globals, prop)) {
delete this.__globals[prop];
}
}
Expand Down
Loading

0 comments on commit 0a34593

Please sign in to comment.