UNPKG

map-transform

Version:

Map and transform objects with mapping definitions

16 lines 582 B
import { unescapeValue } from '../utils/escape.js'; import { isObject } from '../utils/is.js'; export const extractValue = (value) => { const val = isObject(value) ? value.value : value; return unescapeValue(typeof val === 'function' ? val() : val); }; const value = function value(props) { const value = extractValue(props); return () => (_data, state) => state.noDefaults ? undefined : value; }; const fixed = function fixed(props) { const value = extractValue(props); return () => () => value; }; export { value, fixed }; //# sourceMappingURL=value.js.map