Skip to content

Commit ad5af7f

Browse files
committed
refactor: fix that strings starting with a digit were considered a valid AQL identifier
This should not have an effect we only used bare identifiers to access properties, and properties are either built-in names or graphql field names which cannot start with a digit.
1 parent aa137d5 commit ad5af7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/database/arangodb/aql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ export namespace aql {
412412
* Caution: should only use in .identifier() and NOT .code() because it does not account for keywords
413413
*/
414414
export function isSafeIdentifier(str: string) {
415-
return typeof str == 'string' && str.match(/^[a-zA-Z0-9_]+$/);
415+
return typeof str == 'string' && str.match(/^[a-zA-Z][a-zA-Z0-9_]*$/);
416416
}
417417
}
418418

0 commit comments

Comments
 (0)