Skip to content

Commit 8c94224

Browse files
committed
modernize (ESM, native tests, GH Actions, no build)
1 parent 1f551a4 commit 8c94224

File tree

9 files changed

+1225
-71
lines changed

9 files changed

+1225
-71
lines changed

Diff for: .github/workflows/node.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Node
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v4
9+
10+
- name: Setup Node
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: 20
14+
15+
- name: Install dependencies
16+
run: npm ci
17+
18+
- name: Run tests
19+
run: npm test

Diff for: .gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
node_modules
22
*.log
3-
yarn.lock
4-
tinyqueue.js
5-
tinyqueue.min.js

Diff for: .travis.yml

-4
This file was deleted.

Diff for: eslint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {default} from 'eslint-config-mourner';

Diff for: index.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
export default class TinyQueue {
3-
constructor(data = [], compare = defaultCompare) {
3+
constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {
44
this.data = data;
55
this.length = this.data.length;
66
this.compare = compare;
@@ -69,7 +69,3 @@ export default class TinyQueue {
6969
data[pos] = item;
7070
}
7171
}
72-
73-
function defaultCompare(a, b) {
74-
return a < b ? -1 : a > b ? 1 : 0;
75-
}

0 commit comments

Comments
 (0)