Skip to content

Commit c21fb5d

Browse files
authored
Dependency Updates (#1)
* dependency updates * use github actions for tests
1 parent 6f99310 commit c21fb5d

File tree

7 files changed

+37
-17
lines changed

7 files changed

+37
-17
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Test
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: ${{ matrix.os }}
6+
strategy:
7+
fail-fast: true
8+
matrix:
9+
node:
10+
- lts/*
11+
- current
12+
os: [ubuntu-latest, macOS-latest, windows-latest]
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Node ${{ matrix.node }}
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node }}
20+
- run: npm install
21+
- run: npm test

.travis.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# select-when
22

3-
[![Build Status](https://travis-ci.org/Picolab/select-when.svg)](https://travis-ci.org/Picolab/select-when)
3+
[![Build Status](https://github.com/Picolab/select-when/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/Picolab/select-when/actions/workflows/test.yml)
44

55
This javascript library makes it _easy_ to create rules that **pattern match** on event streams.
66

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,27 @@
2929
"scripts": {
3030
"prepublish": "npm run build",
3131
"build": "rm -rf dist && tsc",
32-
"test": "ava --reset-cache && ava"
32+
"test": "ava reset-cache && ava"
3333
},
3434
"devDependencies": {
3535
"@types/lodash": "^4.14.136",
36-
"ava": "^2.2.0",
37-
"ts-node": "^8.3.0",
38-
"typescript": "^3.5.2"
36+
"ava": "^5.3.1",
37+
"ts-node": "^10.4.0",
38+
"typescript": "^5.2.2"
3939
},
4040
"dependencies": {
4141
"lodash": "^4.17.11"
4242
},
4343
"ava": {
44-
"compileEnhancements": false,
4544
"extensions": [
4645
"ts"
4746
],
4847
"require": [
4948
"ts-node/register"
49+
],
50+
"files": [
51+
"test/**/*",
52+
"!test/helpers/**/*"
5053
]
5154
}
5255
}

src/StateMachine.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import {
77
TransitionCompact,
88
TransitionEvent_event,
99
TransitionEvent,
10-
Saliance,
11-
StateShape
10+
Saliance
1211
} from "./types";
1312

1413
function genState() {
@@ -268,13 +267,13 @@ export class StateMachine<DataT, StateT> {
268267
}
269268
}
270269

271-
async function stmMatcher<DataT, StateT extends StateShape>(
270+
async function stmMatcher<DataT, StateT>(
272271
stm: CompiledStateMachine,
273272
event: Event<DataT>,
274273
state: StateT | null | undefined
275274
): Promise<MatcherRet<StateT>> {
276275
let stateStates: string[] =
277-
state && _.isArray(state.states) ? state.states : [];
276+
state && _.isArray((state as any).states) ? (state as any).states : [];
278277
let stmStates = stateStates.filter(st => _.has(stm, st));
279278

280279
if (stmStates.length === 0) {
@@ -313,7 +312,7 @@ async function stmMatcher<DataT, StateT extends StateShape>(
313312
};
314313
}
315314

316-
async function evalExpr<DataT, StateT extends StateShape>(
315+
async function evalExpr<DataT, StateT>(
317316
expr: TransitionEvent<DataT, StateT>,
318317
event: Event<DataT>,
319318
state: StateT | null | undefined

src/expressions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ export function within<DataT, StateT extends WithinStateShape>(
366366
let tlimit = await tlimitFn(event, state);
367367

368368
let stmStates = _.filter(
369-
_.flattenDeep([state && state.states]),
369+
_.flattenDeep<string | null | undefined>([state && state.states]),
370370
_.isString
371371
);
372372
if (timeSinceLast > tlimit) {

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"outDir": "dist",
88
"strict": true
99
},
10-
"include": ["src"]
10+
"include": ["src/**/*", "test/**/*"],
11+
"exclude": ["node_modules", "**/node_modules/*"]
1112
}

0 commit comments

Comments
 (0)