mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-22 21:38:05 -05:00
cleanup comments
This commit is contained in:
@@ -65,19 +65,14 @@ function isPathInOutputSchema(
|
||||
continue
|
||||
}
|
||||
|
||||
// Handle array index access (e.g., [0])
|
||||
if (/^\d+$/.test(part)) {
|
||||
// If current is file[] type, next part should be a file property
|
||||
if (isFileArrayType(current)) {
|
||||
// Check if next part is a valid file property
|
||||
if (i + 1 < pathParts.length) {
|
||||
const nextPart = pathParts[i + 1]
|
||||
return USER_FILE_ACCESSIBLE_PROPERTIES.includes(nextPart as any)
|
||||
}
|
||||
// If no next part, array index access is valid
|
||||
return true
|
||||
}
|
||||
// For other array types, continue to next iteration
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -85,13 +80,10 @@ function isPathInOutputSchema(
|
||||
return false
|
||||
}
|
||||
|
||||
// Check if part exists in current
|
||||
if (part in current) {
|
||||
const nextCurrent = current[part]
|
||||
// If next field is file[] type and we have more parts, check if next part is numeric
|
||||
if (nextCurrent?.type === 'file[]' && i + 1 < pathParts.length) {
|
||||
const nextPart = pathParts[i + 1]
|
||||
// If next part is numeric (array index), allow it and check the part after
|
||||
if (/^\d+$/.test(nextPart) && i + 2 < pathParts.length) {
|
||||
const propertyPart = pathParts[i + 2]
|
||||
return USER_FILE_ACCESSIBLE_PROPERTIES.includes(propertyPart as any)
|
||||
@@ -117,9 +109,7 @@ function isPathInOutputSchema(
|
||||
}
|
||||
}
|
||||
|
||||
// Handle file[] type - allow access to file properties after array index
|
||||
if (isFileArrayType(current) && USER_FILE_ACCESSIBLE_PROPERTIES.includes(part as any)) {
|
||||
// Valid file property access
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user