2019-05-09 23:46:35 UTC - Alexander Klimetschek: how is it possible to include 
javascript functions in composer?

I have this and it fails with `ReferenceError: resolve is not defined`:

```
function resolve(obj, path) {
    return path.split('.').reduce((o, key) => o && o[key], obj);
}

function dynamicInvoke(objectPath) {
    return composer.sequence(
        args => ({
            type: "action",
            name: resolve(args, objectPath),
            params: args
        }),
        composer.dynamic()
    );
}

module.exports = composer.sequence(
    composer.finally(
        dynamicInvoke("job.action.name"),
        // ...
    )
)
```

built-in javascript functions seem to be ok like `Object.assign()`. this isn’t 
really a function that I want to move to its own action, since it’s a simple 
helper and needs to run within the composer. and I don’t want to inline it as 
that prevents reuse.
https://openwhisk-team.slack.com/archives/C7DJNS37W/p1557445595003100
----

Reply via email to