Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ export function isKeyword(str) {
}

export function isFunction(str) {
return /\w+\([^)]*\)$/.test(str);
if (typeof str !== "string") return false;

// Anchored at BOTH ends. End-anchored only, a plain-text default that
// merely ends in a parenthesised word -- "Call now(free)", "see item(s)"
// -- looked like a function call and was emitted into the SQL unquoted.
// The dot keeps qualified names such as pg_catalog.now() matching.
return /^[\w.]+\([^)]*\)$/.test(str);
}

export function areFieldsCompatible(db, field1Type, field2Type) {
Expand Down
Loading