- Fixed an issue where if the first value of a
$eqoperation was null or undefined it did not always return false.
- Added support for arrays of objects in array operations.
- Fixed an issue where trying to run actions in an invalid way would cause errors. They now no-op.
- Fixed an issue where when a timer performs a state transition, events were still ran with the old state.
- Timers are now properly returned and saved when
doEventHandlersis called.
- Timers are now cleared using pop to ensure they're garbage collected.
- Timers are now properly cleared on state transition.
- Timers are now handled first before anything else.
- Context is only read from if a reference is prepended with a
$. - Switch statements are now used when handling ops, this means ordering is now respected.
- Added support for 2 operand
$mulactions.
- Fixed values not being properly deleted if they were truthy.
- Fixed actions not getting constants from the definition.
- Added support for the
$resetoperator using the original context from the definition. - Added
originalContextoption toHandleActionsOptions.
- Fixed irregular events not being handled correctly.
- Fixed contract IDs not being passed to conditions and transitions.
- Added support for long arrays to the
$eqoperator.
- Added support for contract IDs in
$pushunique.
- Fixed a bug which would cause timers to be persisted, preventing them from starting again.
NOTE: This release contains 2 potentially breaking changes. They are in a semver-minor release because both align the parser more with the IOI behavior.
- Added prepack script so building from source works properly.
- Breaking: Fixed handleEvent resetting the context when an event is disregarded.
- Breaking: Removed support for
$div, as it never actually existed in the game. - Updated build dependencies.
- Require a timestamp on all events (for timers). This is breaking, but needed to be done.
- Removed debug in favor of a user-provided logging function.
- Reworked timers to use a better system that is controlled by the library consumer.
- Fixed the
$leimplementation. - Refactored type definitions a bit.
- Fixed inconsistent getting and setting behavior as a result of the last patch.
- Added new documentation, and improved existing documentation.
- Renamed
$gteand$lteto$geand$leto be consistent with the usage of the game.
$pushuniquecan now be used as a condition.(,), and leading$(and$.) are now automatically removed from strings if resolved.
- Added
Countproperty to arrays. - Removed support for comparing arrays with
$eq.
- Added tracing functionality to assist with finding bugs.
- Support
$removeaction. - Synchronized copyright headers.
handleEventnow automatically handles the immediately invoked event upon transitions.
- Moved the build setup to esbuild.
- Proper ES modules are now published that can be loaded by Node.js and the browser.
- Added code coverage.
- Handle nested array nodes.
- Fixed a crash that could be caused by handling actions in
handleEvent. - Added some new tests.
- Fixed the actions not being executed correctly in
handleEvent. - Fixed some outstanding issues with timers.
- Remove
lodash'ssetimplementation in favor of a smaller one. - Better handling in
handleEventfor falsy values.
- Handle immediately executing event handlers.
- Enable enhanced tree shaking.
- Basically rewrote the whole thing to be faster and smaller, and have fewer issues.
- Handling side effect state machines and conditional state machines are now separate functions.
- Many other improvements, such as properly shipped ES modules, less file duplication, and more.
$pushuniqueand$pushnodes now use the same implementation.- Added tests for
$incand$dec(+ fixed associated bugs). - Excluded TypeScript build info files from release files.
- Replaced our implementation of
setObjectChildwith Lodash's version. - Updated dependencies.
- The statemachine conditions can no longer be null or undefined.
- The globals can no longer be null or undefined.
- Support side effect nodes (
$set,$mul,$inc,$dec,$divall work properly now). - The
checkmethod now returns an object in the format of{ bool: boolean, globals: any }, because side effect nodes can modify the globals object. findObjectChild(formerly$referenceToData) andsetObjectChildare now exported.- Added inline JSDoc.
- Same as v1.0.0 but re-published due to a bug.
- First release.