Skip to content

Commit

Permalink
Remove support for EOL Node versions <14 (#376)
Browse files Browse the repository at this point in the history
* Remove support for EOL Node versions <14

* Add GitHub Actions test workflow, remove Travis CI references

* Upgrade tap-spec to prevent throwing exit code on npm test
  • Loading branch information
joeykilpatrick authored Dec 27, 2022
1 parent 1cbdffc commit 7c16709
Showing 7 changed files with 880 additions and 5,348 deletions.
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

15 changes: 1 addition & 14 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
function isNodeLT(tar) {
tar = (Array.isArray(tar) ? tar : tar.split('.')).map(Number);
let i=0, src=process.versions.node.split('.').map(Number);
for (; i < tar.length; i++) {
if (src[i] > tar[i]) return false;
if (tar[i] > src[i]) return true;
}
return false;
}

module.exports =
isNodeLT('8.6.0')
? require('./dist/index.js')
: require('./lib/index.js');
module.exports = require('./lib/index.js');
Loading

0 comments on commit 7c16709

Please sign in to comment.