( sourceText: string, destination: TypedSelection )
| 13 | |
| 14 | /** Possibly add delimiter for positions before/after */ |
| 15 | export function maybeAddDelimiter( |
| 16 | sourceText: string, |
| 17 | destination: TypedSelection |
| 18 | ) { |
| 19 | const { insideOutsideType, position } = destination; |
| 20 | const containingListDelimiter = |
| 21 | destination.selectionContext.containingListDelimiter; |
| 22 | return containingListDelimiter == null || |
| 23 | position === "contents" || |
| 24 | insideOutsideType === "inside" |
| 25 | ? sourceText |
| 26 | : destination.position === "after" |
| 27 | ? containingListDelimiter + sourceText |
| 28 | : sourceText + containingListDelimiter; |
| 29 | } |
no outgoing calls
no test coverage detected