UNPKG

@antv/t8

Version:

T8 is a text visualization solution for unstructured data within the AntV technology stack, and it is a declarative JSON Schema syntax that can be used to describe the content of data interpretation reports.

23 lines (20 loc) 1.08 kB
import { __assign } from 'tslib'; /** * Helper function to merge default and custom descriptor properties. * * Creates a new descriptor that combines properties from both input descriptors, * with special handling for the encoding object to ensure deep merging. * * @param defaultDescriptor - The base descriptor with default properties * @param customDescriptor - The custom descriptor with overriding properties * @returns A merged descriptor combining both inputs */ function getMergedDescriptor(defaultDescriptor, customDescriptor) { // Shallow merge of top-level properties var result = __assign(__assign({}, defaultDescriptor), customDescriptor); // Deep merge of encoding objects from both descriptors result.style = __assign(__assign({}, ((defaultDescriptor === null || defaultDescriptor === void 0 ? void 0 : defaultDescriptor.style) || {})), ((customDescriptor === null || customDescriptor === void 0 ? void 0 : customDescriptor.style) || {})); return result; } export { getMergedDescriptor }; //# sourceMappingURL=getMergedDescriptor.js.map