Skip to content

Commit 0432950

Browse files
committed
feat: Updated JSDoc
1 parent fccafaf commit 0432950

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/utils/parameterUtils.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
export const extractAllParameterNames = (cypherQuery) => {
1+
/**
2+
* Extracts all parameter names from a given Cypher query string.
3+
*
4+
* @param {string} cypherQuery The Cypher query string to extract parameter names from.
5+
* @returns {string[]} An array containing all extracted parameter names.
6+
*/
7+
export const extractAllParameterNames = (cypherQuery: string): string[] => {
28
// A regular expression pattern to match parameter names following '$'
39
const pattern = /\$([A-Za-z_]\w*)/g;
410

@@ -12,7 +18,14 @@ export const extractAllParameterNames = (cypherQuery) => {
1218
return parameterNames;
1319
}
1420

15-
export const checkParametersNameInGlobalParameter = (parameterNames: string[], globalParameterNames: any) => {
21+
/**
22+
* Checks if all parameter names are present in the global parameter names.
23+
*
24+
* @param {string[]} parameterNames An array of parameter names to be checked.
25+
* @param {object} globalParameterNames The object containing global parameter names to compare against.
26+
* @returns {boolean} A boolean indicating whether all parameters are present in the global parameters.
27+
*/
28+
export const checkParametersNameInGlobalParameter = (parameterNames: string[], globalParameterNames: any): boolean => {
1629
for (const key of parameterNames) {
1730
if (!globalParameterNames[key] || (Array.isArray(globalParameterNames[key]) && globalParameterNames[key].length === 0) || globalParameterNames[key] === '') {
1831
return true;

0 commit comments

Comments
 (0)