mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
simplify _composeOp
This commit is contained in:
parent
4f55144232
commit
bf343eb499
@ -896,16 +896,15 @@ addToPrototype('weaveWith', function (t, ...funcs) {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// compose matrix functions
|
||||
|
||||
// TODO - adopt value.mjs fully..
|
||||
function _nonArrayObject(x) {
|
||||
return !Array.isArray(x) && typeof x === 'object';
|
||||
}
|
||||
function _composeOp(a, b, func) {
|
||||
function _nonFunctionObject(x) {
|
||||
return x instanceof Object && !(x instanceof Function);
|
||||
}
|
||||
if (_nonFunctionObject(a) || _nonFunctionObject(b)) {
|
||||
if (!_nonFunctionObject(a)) {
|
||||
if (_nonArrayObject(a) || _nonArrayObject(b)) {
|
||||
if (!_nonArrayObject(a)) {
|
||||
a = { value: a };
|
||||
}
|
||||
if (!_nonFunctionObject(b)) {
|
||||
if (!_nonArrayObject(b)) {
|
||||
b = { value: b };
|
||||
}
|
||||
return unionWithObj(a, b, func);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user