maybeFunctionAttribute.js 602 B

12345678910111213141516171819
  1. import { deepMix } from '@antv/util';
  2. /**
  3. * Mark functional attribute constant.
  4. */
  5. export const MaybeFunctionAttribute = () => {
  6. return (I, mark) => {
  7. const { style = {} } = mark;
  8. return [
  9. I,
  10. deepMix({}, mark, {
  11. style: Object.assign(Object.assign({}, style), Object.fromEntries(Object.entries(style)
  12. .filter(([, v]) => typeof v === 'function')
  13. .map(([k, v]) => [k, () => v]))),
  14. }),
  15. ];
  16. };
  17. };
  18. MaybeFunctionAttribute.props = {};
  19. //# sourceMappingURL=maybeFunctionAttribute.js.map