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 [ ] => {
28 // A regular expression pattern to match parameter names following '$'
39 const pattern = / \$ ( [ A - Z a - 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 ;
You can’t perform that action at this time.
0 commit comments