MCPcopy Create free account
hub / github.com/outerbase/studio / extractInputValue

Function extractInputValue

src/drivers/sqlite/sql-helper.ts:37–52  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

35}
36
37export function extractInputValue(input: string): string | number {
38 const trimmedInput = input.trim();
39 if (
40 (trimmedInput.startsWith('"') && trimmedInput.endsWith('"')) ||
41 (trimmedInput.startsWith("'") && trimmedInput.endsWith("'"))
42 ) {
43 return trimmedInput.slice(1, -1).toString();
44 }
45
46 const parsedNumber = parseFloat(trimmedInput);
47 if (!isNaN(parsedNumber)) {
48 return parsedNumber;
49 }
50
51 return trimmedInput.toString();
52}
53
54export function convertSqliteType(
55 type: string | undefined

Callers 1

onRunClickedFunction · 0.90

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected