The sources of the project follows this structure:
/src
/app
/{domain}
/actions.ts
/actions.spec.ts
| %dw 2.0 | |
| output application/json | |
| fun while<T>(a, b: (T) -> Boolean) = do { | |
| var r = a() | |
| fun innerWhile(x) = do { | |
| var r = a(x) | |
| --- | |
| b(r) match { | |
| case true -> [r ~ innerWhile(r)] |
| %dw 2.0 | |
| output application/dw | |
| import mergeWith from dw::core::Objects | |
| type Stream<T> = {| | |
| data: Array<T>, | |
| position: Number | |
| |} | |
| type Machine = {| |
| { | |
| "message": "Hello world!" | |
| } |
| { | |
| "message": "Hello world!" | |
| } |
| { | |
| "message": "Hello world!" | |
| } |
| { | |
| "message": "Hello world!" | |
| } |
| fun generator(start: Number = 0): Array<Number> = [start ~ generator(start + 1)] | |
| --- | |
| // This script will pick 100 numbers from | |
| // the generator, that is also being filtered | |
| (generator(1000) filter isEven($))[0 to 99] |
| { | |
| "message": "Hello world!" | |
| } |
| {"lastUpload":"2019-08-06T13:27:47.425Z","extensionVersion":"v3.4.1"} |