UNPKG

354 BJavaScriptView Raw
1var toData = require('./toData')
2
3/**
4 * Get an operator that coerces arguments to data.
5 *
6 * @api private
7 *
8 * @param {Function} operator
9 *
10 * @returns {Function} anonymous coerced operator
11 */
12
13function coerced (operator) {
14 return function () {
15 return operator.apply(null, [].slice.call(arguments).map(toData))
16 }
17}
18
19module.exports = coerced