Initial commit, 90% there

This commit is contained in:
mdares
2025-12-02 16:27:21 +00:00
commit 755028af7e
7353 changed files with 1759505 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
// Is not being mantained anymore
var pipe = function() {
return Array.prototype.slice.call(arguments).reduce(function(v, f, i) {
if (i === 1 && v && v.constructor === Function) {
let exec = v();
if (exec && exec.then) {
return exec.then(v => f(v));
} else {
return f(exec);
}
} else if (v && v.then) {
return v.then(v => f(v));
} else {
return f(v);
}
});
};

18
.node-red/node_modules/pipe-functions/lib/pipe.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
const pipe = (...fns) => fns.length === 1 ? fns[0].constructor === Function ? fns[0]() : fns[0] : fns.reduce((v, f, i) => {
if (i === 1 && v && v.constructor === Function) {
let exec = v();
if (exec && exec.then) {
return exec.then(v => f(v));
} else {
return f(exec);
}
} else if (v && v.then) {
return v.then(v => f(v));
} else {
return f(v);
}
});
module.exports = pipe;