Skip to content

Commit

Permalink
dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
farskipper committed Nov 11, 2023
1 parent 17544a3 commit 2a29aeb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
matrix:
node-version:
- lts/*
- latest
- *
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,27 @@
"scripts": {
"prepublish": "npm run build",
"build": "rm -rf dist && tsc",
"test": "ava --reset-cache && ava"
"test": "ava reset-cache && ava"
},
"devDependencies": {
"@types/lodash": "^4.14.136",
"ava": "^2.2.0",
"ts-node": "^8.3.0",
"typescript": "^3.5.2"
"ava": "^5.3.1",
"ts-node": "^10.4.0",
"typescript": "^5.2.2"
},
"dependencies": {
"lodash": "^4.17.11"
},
"ava": {
"compileEnhancements": false,
"extensions": [
"ts"
],
"require": [
"ts-node/register"
],
"files": [
"test/**/*",
"!test/helpers/**/*"
]
}
}
9 changes: 4 additions & 5 deletions src/StateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import {
TransitionCompact,
TransitionEvent_event,
TransitionEvent,
Saliance,
StateShape
Saliance
} from "./types";

function genState() {
Expand Down Expand Up @@ -268,13 +267,13 @@ export class StateMachine<DataT, StateT> {
}
}

async function stmMatcher<DataT, StateT extends StateShape>(
async function stmMatcher<DataT, StateT>(
stm: CompiledStateMachine,
event: Event<DataT>,
state: StateT | null | undefined
): Promise<MatcherRet<StateT>> {
let stateStates: string[] =
state && _.isArray(state.states) ? state.states : [];
state && _.isArray((state as any).states) ? (state as any).states : [];
let stmStates = stateStates.filter(st => _.has(stm, st));

if (stmStates.length === 0) {
Expand Down Expand Up @@ -313,7 +312,7 @@ async function stmMatcher<DataT, StateT extends StateShape>(
};
}

async function evalExpr<DataT, StateT extends StateShape>(
async function evalExpr<DataT, StateT>(
expr: TransitionEvent<DataT, StateT>,
event: Event<DataT>,
state: StateT | null | undefined
Expand Down
2 changes: 1 addition & 1 deletion src/expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export function within<DataT, StateT extends WithinStateShape>(
let tlimit = await tlimitFn(event, state);

let stmStates = _.filter(
_.flattenDeep([state && state.states]),
_.flattenDeep<string | null | undefined>([state && state.states]),
_.isString
);
if (timeSinceLast > tlimit) {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"outDir": "dist",
"strict": true
},
"include": ["src"]
"include": ["src/**/*", "test/**/*"],
"exclude": ["node_modules", "**/node_modules/*"]
}

0 comments on commit 2a29aeb

Please sign in to comment.