MCPcopy Create free account
hub / github.com/Forward-Future/loopy / stringArray

Function stringArray

loop-library/worker/src/loop-schema.js:203–209  ·  view source on GitHub ↗
(value, field, { min, max, itemMax })

Source from the content-addressed store, hash-verified

201}
202
203function stringArray(value, field, { min, max, itemMax }) {
204 if (!Array.isArray(value) || value.length < min || value.length > max) {
205 throw new LoopValidationError(`${field} must contain between ${min} and ${max} items.`);
206 }
207
208 return value.map((item, index) => requiredString(item, `${field}[${index}]`, itemMax));
209}
210
211function validateDate(value, field) {
212 if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) {

Callers 1

normalizeLoopDocumentFunction · 0.85

Calls 1

requiredStringFunction · 0.85

Tested by

no test coverage detected