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

rsuite / schema-typed / 8632715695

10 Apr 2024 02:11PM UTC coverage: 94.836% (-0.8%) from 95.618%
8632715695

Pull #78

github

web-flow
Merge e7b94ea96 into 9ff16c346
Pull Request #78: feat: add support for `equalTo` and `proxy`

331 of 367 branches covered (90.19%)

Branch coverage included in aggregate %.

138 of 140 new or added lines in 9 files covered. (98.57%)

3 existing lines in 2 files now uncovered.

477 of 485 relevant lines covered (98.35%)

186.14 hits per line

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

88.89
/src/utils/formatErrorMessage.ts
1
import isEmpty from './isEmpty';
3✔
2

3
/**
4
 * formatErrorMessage('${name} is a required field', {name: 'email'});
5
 * output: 'email is a required field'
6
 */
7
export default function formatErrorMessage<E>(errorMessage?: string | E, params?: any) {
3✔
8
  if (typeof errorMessage === 'string') {
894✔
9
    return errorMessage.replace(/\$\{\s*(\w+)\s*\}/g, (_, key) => {
891✔
10
      return isEmpty(params?.[key]) ? `$\{${key}\}` : params?.[key];
906!
11
    });
12
  }
13

14
  return errorMessage;
3✔
15
}
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

© 2025 Coveralls, Inc