UNPKG

438 BJavaScriptView Raw
1/**
2 @function constant
3 @desc Wraps non-function variables in a simple return function.
4 @param {Array|Number|Object|String} value The value to be returned from the function.
5 @example <caption>this</caption>
6constant(42);
7 @example <caption>returns this</caption>
8function() {
9 return 42;
10}
11*/
12export default function(value) {
13 return function constant() {
14 return value;
15 };
16}
17
18//# sourceMappingURL=constant.js.map
\No newline at end of file