Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (appMemberArr && appMemberArr.length) {
// lineage.push(get('state.configuration.applicationMember', plugin))
lineage = [...lineage, ...appMemberArr];
appPlugin = true;
}
// This is everything but application Plugins
// let r = Right(plugin.state).map((v) => {
//
// v.parents = lineage
// v.moduleSrc = moduleSrc
// v.namespace = ns
// v.loadSrc = loadSrc
// v.application = appPlugin
// return v
// })
let r = monet_1.Right(plugin).map((p) => {
p.loadMetadata = {
parents: lineage,
moduleSrc: moduleSrc,
namespace: ns,
loadSrc: loadSrc,
application: appPlugin
};
return p;
})
.cata(fail => {
throw fail;
}, fp_1.identity);
return [r];
});
})();
const eitherUnwrapOrFail = (o, filename) => {
return (fp_1.isFunction(fp_1.get('Plugin.getPlugin', o)))
? monet_1.Right(o.Plugin)
: monet_1.Left(new Error(`${filename} failed to unwrap.`));
};
const eitherObjArrayOrErr = (o, filename) => {
public static right(val: T): Either {
return Right(val);
}
}
export const foldEitherArray = (arr: Array>) => {
const result: K[] = [];
for (const x of arr) {
if (x.isLeft()) {
return Left(x.left());
}
result.push(x.right());
}
return Right(result);
};
export const foldEitherArray = (arr: Array>) => {
const result: K[] = [];
for (const x of arr) {
if (x.isLeft()) {
return Left(x.left());
}
result.push(x.right());
}
return Right(result);
};