1
0
Fork 0
mirror of synced 2024-09-08 05:31:47 +12:00
budibase/packages/datastores/tests/helpers.js

14 lines
308 B
JavaScript
Raw Normal View History

import { map } from "lodash"
2019-06-08 01:18:10 +12:00
export const action = (name, run, iterator = iterateActionTimes(1)) => ({
name,
run,
iterator,
})
2019-06-08 01:18:10 +12:00
export const iterateActionTimes = times => run =>
map([...Array(times).keys()], run)
2019-06-08 01:18:10 +12:00
export const iterateCollection = getCollection => run =>
map(getCollection(), run)