Skip to content

Commit

Permalink
Release 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Jun 8, 2024
1 parent 716532a commit 7ed679b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Status: early stages

## Changes

* 0.2.1 (2024-06-08)
- Added an `All` component for checking that all input values are truthy
* 0.2.0 (2023-01-12)
- Fixed main graph detection
- Now using the community version of NoFlo UI
26 changes: 26 additions & 0 deletions components/All.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const noflo = require('noflo');

exports.getComponent = () => {
const c = new noflo.Component();
c.description = 'Checks values of all connected inputs and sends whether they\'re all truthy or falsy';
c.icon = 'search';
c.inPorts.add('in', {
datatype: 'boolean',
addressable: true,
});
c.outPorts.add('out', {
datatype: 'boolean',
});
c.process((input, output) => {
const indexesWithData = input.attached('in').filter((idx) => input.hasData(['in', idx]));
if (indexesWithData.length !== input.attached('in').length) {
return;
}
const values = indexesWithData.map((idx) => input.getData(['in', idx]));
output.sendDone({
// eslint-disable-next-line eqeqeq
out: values.every((v) => v != false),
});
});
return c;
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "noflo-signalk",
"version": "0.2.0",
"version": "0.2.1",
"description": "Signal K automation with the NoFlo visual programming framework",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 7ed679b

Please sign in to comment.