map-transform-cjs
Version:
MapTransform with CJS support
25 lines (23 loc) • 729 B
JavaScript
// src/utils/escape.ts
var unescapeValue = (value3) => value3 === "**undefined**" ? void 0 : value3;
// src/utils/is.ts
var isObject = (value3) => Object.prototype.toString.call(value3) === "[object Object]";
// src/transformers/value.ts
var extractValue = (value3) => {
const val = isObject(value3) ? value3.value : value3;
return unescapeValue(typeof val === "function" ? val() : val);
};
var value = function value2(props) {
const value3 = extractValue(props);
return () => (_data, state) => state.noDefaults ? void 0 : value3;
};
var fixed = function fixed2(props) {
const value3 = extractValue(props);
return () => () => value3;
};
export {
extractValue,
fixed,
value
};
//# sourceMappingURL=value.js.map