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

Haixing-Hu / vue3-class-component / 7c8a3f3e-046f-4ced-b630-a0c6636a0ccb

09 Jun 2025 08:22AM UTC coverage: 100.0%. Remained the same
7c8a3f3e-046f-4ced-b630-a0c6636a0ccb

push

circleci

Haixing-Hu
chore: update yarn.lock after dependency changes

151 of 151 branches covered (100.0%)

Branch coverage included in aggregate %.

222 of 222 relevant lines covered (100.0%)

19.39 hits per line

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

100.0
/src/impl/check-options.js
1
////////////////////////////////////////////////////////////////////////////////
2
//
3
//    Copyright (c) 2022 - 2024.
4
//    Haixing Hu, Qubit Co. Ltd.
5
//
6
//    All rights reserved.
7
//
8
////////////////////////////////////////////////////////////////////////////////
9
import { VUE_KEYWORDS } from './vue-options-api';
10

11
/**
12
 * Checks the validity of the options of the `@Component` decorator.
13
 *
14
 * @param {Object} options
15
 *     the options to be checked.
16
 * @throws Error
17
 *     if the options contains invalid properties.
18
 * @private
19
 * @author Haixing Hu
20
 */
21
function checkOptions(options) {
22
  Object.keys(options).forEach((key) => {
49✔
23
    const keyword = VUE_KEYWORDS.find((item) => (item.name === key));
386✔
24
    if (!keyword) {
19✔
25
      throw new Error(`The option "${key}" in the argument of @Component is not supported.`);
1✔
26
    }
27
    if (keyword.declared !== 'options') {
18✔
28
      let msg = `The option "${key}" in the argument of @Component should be declared as the class ${keyword.declared}`;
5✔
29
      if (keyword.decorated) {
5✔
30
        msg += ` and decorated by ${keyword.decorated}`;
2✔
31
      }
32
      msg += '.';
5✔
33
      throw new Error(msg);
5✔
34
    }
35
  });
36
}
37

38
export default checkOptions;
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