MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / getSelectedText

Function getSelectedText

packages/utilities/src/document.ts:1–8  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1export function getSelectedText(): string {
2 if (typeof document.getSelection === 'function') {
3 const selection = document.getSelection();
4 return selection?.toString() || '';
5 } else {
6 return '';
7 }
8}

Callers 3

selectThreadFunction · 0.90
selectThreadFunction · 0.90
selectThreadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected