map-transform
Version:
Map and transform objects with mapping definitions
21 lines • 633 B
JavaScript
import { isObject } from '../utils/is.js';
import { defToDataMapper } from '../utils/definitionHelpers.js';
function dataMapperFromProps(props, options) {
if (typeof props === 'function') {
return props(options);
}
else if (isObject(props)) {
return defToDataMapper(props.path, options);
}
else {
return (value) => value;
}
}
const transformer = function not(props) {
return (options) => {
const fn = dataMapperFromProps(props, options);
return async (value, state) => !(await fn(value, state));
};
};
export default transformer;
//# sourceMappingURL=not.js.map