• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vhoyer / vue-prop-validation-helper / ebdc5aa1-2a58-4a8a-af77-09560db4f3bd

pending completion
ebdc5aa1-2a58-4a8a-af77-09560db4f3bd

Pull #42

circleci

GitHub
:arrow_up: Bump minimist and mkdirp in /playground
Pull Request #42: ⬆️ Bump minimist and mkdirp in /playground

8 of 8 branches covered (100.0%)

Branch coverage included in aggregate %.

39 of 39 relevant lines covered (100.0%)

5.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/validators/everyItemOfArrayShouldHave.ts
1
import listMissingPropertiesFrom from '../helper/listMissingProperties';
3✔
2

3
function everyItemOfArrayShouldHave(requiredProperties: string[]) {
4
  // return the vue validator function
5
  return (array: object[]) => scanArray(
6✔
6
    array,
7
    requiredProperties,
8
  );
9
}
10

11
function scanArray(array: object[], requiredProperties: string[]) {
12
  const missingPropertiesInEachItem = array.map((item) => {
5✔
13
    return listMissingPropertiesFrom(item, { requiredProperties });
8✔
14
  });
15

16
  const hasAnyInvalidItemInArray = missingPropertiesInEachItem.some((item) => {
5✔
17
    // if any item of this array has a length greater than zero it means
18
    // this property has an item with at least one property missing
19
    return item.length;
5✔
20
  });
21

22
  if (!hasAnyInvalidItemInArray) {
5✔
23
    return true;
2✔
24
  } else {
25
    console.error('Array (', array, ') has invalid items, see table below for missing itens:');
3✔
26

27
    console.table(missingPropertiesInEachItem);
3✔
28

29
    return false;
3✔
30
  }
31
}
32

33
export default everyItemOfArrayShouldHave;
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc