@marktiderman/genesis-forms 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -164,8 +164,18 @@ The formula language is small and is parsed and evaluated by this package, never
164
164
  An unanswered question is blank, and arithmetic with a blank is blank, so a total stays empty until
165
165
  its answers are in; dividing by zero is blank too. The functions skip blanks (`sum` of nothing is
166
166
  `0`). Text holding a number (`"12"`, `"1,200"`) counts as that number, and yes / no as 1 / 0.
167
- A list or table of more than `MAX_FORMULA_ITEMS` (10,000) items reads as blank. A formula is at
168
- most `MAX_FORMULA_LENGTH` characters and 64 levels of parentheses, calls, signs and `? :` deep.
167
+
168
+ Limits, so a large submission can't make the server slow:
169
+
170
+ - A calculated field that reads a list or table of more than `MAX_FORMULA_ITEMS` (10,000) items
171
+ has no value: it is blank, never `0` or a partial total. The same goes for one that reads an
172
+ answer past `MAX_SETTLE_ITEMS` (50,000) items read by all of a form's formulas together (each
173
+ answer and column counted once, in form order; an answer over 10,000 items counts for none).
174
+ Nothing else reports this, so give a table a `maxRows` well under these if its total matters.
175
+ - A formula is at most `MAX_FORMULA_LENGTH` characters and 64 levels of parentheses, calls, signs
176
+ and `? :` deep, and all of a form's formulas together at most `MAX_FORM_FORMULA_LENGTH` (20,000).
177
+ - Lists are read once per answer, so treat answers as immutable: pass `setValue` a new array, never
178
+ one changed in place (the engine and the built-in renderers never change one).
169
179
 
170
180
  The engine works the values out from the answers on the path (an answer hidden by logic reads as
171
181
  blank), again whenever an answer it reads changes, and stores them with the answers, so `engine.answers()` and a