UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

21 lines (20 loc) 560 B
import { cloneDeepWith, isElement } from "lodash-es"; import objectInspect from "object-inspect"; const FUNCTION_PREFIX = "_function:"; const ELEMENT_PREFIX = "_element:"; const sanitizeMessage = (message) => { return cloneDeepWith(message, (value) => { if (isElement(value)) { return ELEMENT_PREFIX + objectInspect(value); } if (typeof value === "function") { return FUNCTION_PREFIX + objectInspect(value); } }); }; export { ELEMENT_PREFIX, FUNCTION_PREFIX, sanitizeMessage }; //# sourceMappingURL=sanitizeMessage.js.map