1
0
Fork 0
mirror of synced 2024-07-06 23:10:57 +12:00
budibase/packages/datastores/tests/helpers.js
michael shanks 2fc0bc7156 mono repo
2019-06-07 14:18:10 +01:00

9 lines
303 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);