Skip to content

Commit

Permalink
data-lake: Add utility function for finding all variable IDs in a giv…
Browse files Browse the repository at this point in the history
…en string
  • Loading branch information
rafaellehmkuhl committed Feb 19, 2025
1 parent 90face8 commit e2045c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libs/utils-data-lake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ export const replaceDataLakeInputsInString = (input: string, replaceFunction?: (
return input.toString().replace(dataLakeInputRegex, (match) => replaceFunctionToUse(match))
}

/**
* Find all data lake variable ids in a string.
* @param {string} input The string to search for data lake variable ids
* @returns {string[]} An array of data lake variable ids
*/
export const findDataLakeVariablesIdsInString = (input: string): string[] => {
const inputs = findDataLakeInputsInString(input)
return inputs.map((i) => getDataLakeVariableIdFromInput(i)).filter((id) => id !== null)
}

export const replaceDataLakeInputsInJsonString = (jsonString: string): string => {
let parsedJson = jsonString

Expand Down

0 comments on commit e2045c4

Please sign in to comment.