| 12345678910111213141516171819202122232425262728293031323334353637 |
- import { Container } from '../utils/container';
- export function effectTiming(defaults, value, options) {
- return Container.of({})
- .call(assignDefined, defaults)
- .call(assignDefined, value)
- .call(assignDefined, options)
- .value();
- }
- function assignDefined(target, source) {
- for (const [key, value] of Object.entries(source)) {
- if (value !== undefined) {
- target[key] = source[key];
- }
- }
- return target;
- }
- // TODO: Add more attributes need to be transform.
- // TODO: Opacity transform unexpectedly.
- export function attributeOf(shape, keys) {
- const attribute = {};
- for (const key of keys) {
- const value = shape.style[key];
- if (value) {
- attribute[key] = value;
- }
- }
- return attribute;
- }
- export const attributeKeys = [
- 'fill',
- 'stroke',
- 'fillOpacity',
- 'strokeOpacity',
- 'opacity',
- 'lineWidth',
- ];
- //# sourceMappingURL=utils.js.map
|