@wmfs/tymly
Version:
A framework for building and sharing workflows in Node.js
17 lines (13 loc) • 336 B
JavaScript
function canResolve (refs) {
return refs.length >= 2 &&
refs[0] === 'function'
} // canResolve
function resolver (refParts, services) {
const [, funcName, ...args] = refParts
const fn = services.functions.functions[funcName]
return fn ? fn.func(...args) : null
} // resolver
module.exports = {
canResolve,
resolver
}