From 72d44fc7e1bcfcf178b1d4e3ba685e7c09586918 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 23 Mar 2021 11:45:39 -0700 Subject: [PATCH 1/5] Check if startsWith exists before setting it --- index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 2e2a92e..999d542 100644 --- a/index.js +++ b/index.js @@ -9,11 +9,13 @@ function pify(fn, arg1, arg2) { }); } -// The method startsWith is not defined on string objects in node 0.10 -// eslint-disable-next-line no-extend-native -String.prototype.startsWith = function(suffix) { - return this.substring(0, suffix.length) === suffix; -}; +if (!String.prototype.startsWith){ + // The method startsWith is not defined on string objects in node 0.10 + // eslint-disable-next-line no-extend-native + String.prototype.startsWith = function(suffix) { + return this.substring(0, suffix.length) === suffix; + }; +} var pidtree = require('./lib/pidtree'); From 0e2884133ff92bcd5db63882d4efbe96374cff43 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Tue, 23 Mar 2021 11:57:32 -0700 Subject: [PATCH 2/5] fix linting issue --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 999d542..affb007 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ function pify(fn, arg1, arg2) { }); } -if (!String.prototype.startsWith){ +if (!String.prototype.startsWith) { // The method startsWith is not defined on string objects in node 0.10 // eslint-disable-next-line no-extend-native String.prototype.startsWith = function(suffix) { From 770715b4c85c78388a84c1dd8c7b67d0d938ad26 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 24 Mar 2021 11:37:25 -0700 Subject: [PATCH 3/5] Try updating nyc --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2f12f3d..c132e1d 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "mockery": "^2.1.0", "np": "^2.20.1", "npm-check": "^5.9.2", - "nyc": "^11.6.0", + "nyc": "^15.1.0", "pify": "^3.0.0", "string-to-stream": "^1.1.0", "through": "^2.3.8", From 92faa194e8231f57c05dcefa75559bad31198c24 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 24 Mar 2021 11:41:50 -0700 Subject: [PATCH 4/5] Remove node 4 and node 6 from CI --- .github/workflows/test-macos.yml | 2 +- .github/workflows/test-ubuntu.yml | 2 +- .github/workflows/test-windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 61f60ab..b3ad871 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - node: [12, 10, 8, 6, 4] + node: [12, 10, 8] steps: - name: Setup repo uses: actions/checkout@v2 diff --git a/.github/workflows/test-ubuntu.yml b/.github/workflows/test-ubuntu.yml index e3fcfe1..7a4a9a9 100644 --- a/.github/workflows/test-ubuntu.yml +++ b/.github/workflows/test-ubuntu.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - node: [12, 10, 8, 6, 4] + node: [12, 10, 8] steps: - name: Setup repo uses: actions/checkout@v2 diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 19e0a7a..6fdbaad 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - node: [12, 10, 8, 6, 4] + node: [12, 10, 8] steps: - name: Setup repo uses: actions/checkout@v2 From 0738de12376bf77fc77e61c7aa2a24d6a9b01b87 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Wed, 24 Mar 2021 11:54:02 -0700 Subject: [PATCH 5/5] Ignore outdated bits from coverage --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index affb007..b21ecea 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,7 @@ function pify(fn, arg1, arg2) { }); } +/* istanbul ignore next */ if (!String.prototype.startsWith) { // The method startsWith is not defined on string objects in node 0.10 // eslint-disable-next-line no-extend-native