fix typo in utils/index.ts

occurence -> occurrence
This commit is contained in:
Ikko Eltociear Ashimine 2023-05-01 09:23:13 +09:00 committed by GitHub
parent e333db8245
commit a97da78ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -284,7 +284,7 @@ export const getVariableValue = (paramValue: string, reactFlowNodes: IReactFlowN
variableDict[`{{${variableFullPath}}}`] = question variableDict[`{{${variableFullPath}}}`] = question
} }
// Split by first occurence of '.' to get just nodeId // Split by first occurrence of '.' to get just nodeId
const [variableNodeId, _] = variableFullPath.split('.') const [variableNodeId, _] = variableFullPath.split('.')
const executedNode = reactFlowNodes.find((nd) => nd.id === variableNodeId) const executedNode = reactFlowNodes.find((nd) => nd.id === variableNodeId)
if (executedNode) { if (executedNode) {
@ -305,7 +305,7 @@ export const getVariableValue = (paramValue: string, reactFlowNodes: IReactFlowN
variablePaths.sort() // Sort by length of variable path because longer path could possibly contains nested variable variablePaths.sort() // Sort by length of variable path because longer path could possibly contains nested variable
variablePaths.forEach((path) => { variablePaths.forEach((path) => {
const variableValue = variableDict[path] const variableValue = variableDict[path]
// Replace all occurence // Replace all occurrence
returnVal = returnVal.split(path).join(variableValue) returnVal = returnVal.split(path).join(variableValue)
}) })
return returnVal return returnVal