Skip to content

Commit

Permalink
clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
divporter committed Aug 22, 2024
1 parent e4973ec commit e214d56
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions src/conditionalLogicService/evaluateConditionalOptionsPredicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,34 @@ export default function evaluateConditionalOptionsPredicate({
*
* Eg
*
* { options: [ { id: 'abc123', label: 'German Shephard',
* value:'germanShepherd', attributes: [{ elementId: 'xyz456', optionIds:
* ['aaa111']}]}] }
* const element = {
* ...elementProps,
* options: [
* {
* id: 'abc123',
* label: 'German Shepherd',
* value: 'germanShepherd',
* attributes: [{ elementId: 'xyz456', optionIds: ['aaa111'] }],
* },
* ],
* }
*
* If a predicate option is not found the optionIds property of the predicate
* argument will contain the dynamic list option's attribute value.
*
* Eg
*
* { options: [ { id: 'abc123', label: 'German Shephard',
* value:'germanShepherd', attributes: [{ elementId: 'xyz456', optionIds:
* ['dog']}]}] }
* const element = {
* ...elementProps,
* options: [
* {
* id: 'abc123',
* label: 'German Shepherd',
* value: 'germanShepherd',
* attributes: [{ elementId: 'xyz456', optionIds: ['dog'] }],
* },
* ],
* }
*/
return predicate.optionIds.some((optionId) => {
const option = predicateElement.options?.find((o) => o.id === optionId)
Expand Down

0 comments on commit e214d56

Please sign in to comment.