File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 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 [ ] => {
2
8
// A regular expression pattern to match parameter names following '$'
3
9
const pattern = / \$ ( [ A - Z a - z _ ] \w * ) / g;
4
10
@@ -12,7 +18,14 @@ export const extractAllParameterNames = (cypherQuery) => {
12
18
return parameterNames ;
13
19
}
14
20
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 => {
16
29
for ( const key of parameterNames ) {
17
30
if ( ! globalParameterNames [ key ] || ( Array . isArray ( globalParameterNames [ key ] ) && globalParameterNames [ key ] . length === 0 ) || globalParameterNames [ key ] === '' ) {
18
31
return true ;
You can’t perform that action at this time.
0 commit comments