11import React from "react" ;
22
3- import {
4- ContentBlobToggler ,
5- ContentBlobTogglerProps ,
6- Markdown ,
7- utils ,
8- InlineText ,
9- } from "./../../../index" ;
3+ import { ContentBlobToggler , ContentBlobTogglerProps , InlineText , Markdown , utils } from "./../../../index" ;
104
115export interface StringPreviewContentBlobTogglerProps
126 extends Omit < ContentBlobTogglerProps , "previewContent" | "enableToggler" > {
@@ -62,7 +56,9 @@ export function StringPreviewContentBlobToggler({
6256 firstNonEmptyLineOnly,
6357} : StringPreviewContentBlobTogglerProps ) {
6458 // need to test `firstNonEmptyLineOnly` until property is removed
65- const useOnlyTest : StringPreviewContentBlobTogglerProps [ "useOnly" ] = firstNonEmptyLineOnly ? "firstNonEmptyLine" : useOnly ;
59+ const useOnlyTest : StringPreviewContentBlobTogglerProps [ "useOnly" ] = firstNonEmptyLineOnly
60+ ? "firstNonEmptyLine"
61+ : useOnly ;
6662
6763 let previewString = content ;
6864 switch ( useOnlyTest ) {
@@ -120,7 +116,7 @@ const regexFirstMarkdownSection = new RegExp("\r\n\r\n|\n\n"); // eslint-disable
120116 * Takes the first non-empty line from a preview string.
121117 */
122118function firstNonEmptyLine ( preview : string ) {
123- return useOnlyPart ( preview , regexFirstNonEmptyLine )
119+ return useOnlyPart ( preview , regexFirstNonEmptyLine ) ;
124120}
125121
126122/**
@@ -133,7 +129,6 @@ function useOnlyPart(preview: string, regexTest: RegExp): string {
133129 return result !== null ? result . input . slice ( 0 , result . index ) : previewString ;
134130}
135131
136-
137132export const stringPreviewContentBlobTogglerUtils = {
138133 firstNonEmptyLine,
139134} ;
0 commit comments