@bothub-chat/ui
Version:
Bothub UI Components
2 lines (1 loc) • 730 B
JavaScript
import"react";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import{hasSubstring as l}from"../../../utils/hasSubstring/index.js";import"../../../utils/colors/calculateGrayScale.js";import"../../../utils/colors/calculateAccentColors.js";import"tslib";const t=(t,e)=>t.map(t=>{if("string"==typeof t)return l(t,e)?t:null;if("collapse"===t.type&&t.data){const r=t.data.map(t=>"string"==typeof t?l(t,e)?t:null:"string"==typeof t.label&&t.label&&t.label.length?l(t.label,e)?t:null:t).filter(l=>null!==l);return r.length>0?Object.assign(Object.assign({},t),{data:r}):null}return"string"==typeof t.label&&t.label&&t.label.length?l(t.label,e)?t:null:t}).filter(l=>null!==l);export{t as filterData};