MCPcopy Create free account
hub / github.com/decaporg/decap-cms / minMaxError

Function minMaxError

packages/decap-cms-lib-widgets/src/validations.ts:12–22  ·  view source on GitHub ↗
(messageKey: string)

Source from the content-addressed store, hash-verified

10 max?: number,
11) {
12 function minMaxError(messageKey: string) {
13 return {
14 type: 'RANGE',
15 message: t(`editor.editorControlPane.widget.${messageKey}`, {
16 fieldLabel,
17 minCount: min,
18 maxCount: max,
19 count: min,
20 }),
21 };
22 }
23
24 if ([min, max, value?.size].every(isNumber) && (value!.size < min! || value!.size > max!)) {
25 return minMaxError(min === max ? 'rangeCountExact' : 'rangeCount');

Callers 1

validateMinMaxFunction · 0.85

Calls 1

tFunction · 0.85

Tested by

no test coverage detected