1
0
Fork 0
mirror of synced 2024-09-09 06:01:08 +12:00
budibase/datastores/tests/helpers.js
2019-03-19 21:45:21 +00:00

9 lines
No EOL
311 B
JavaScript

import {map} from "lodash";
export const action = (name, run, iterator=iterateActionTimes(1)) => ({name, run, iterator});
export const iterateActionTimes = times => run =>
map([...Array(times).keys()], run);
export const iterateCollection = getCollection => run =>
map(getCollection(), run);