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

teableio / teable / 8387093605

22 Mar 2024 07:48AM CUT coverage: 28.027% (-0.2%) from 28.222%
8387093605

Pull #484

github

web-flow
Merge 174ef76f7 into a06c6afb1
Pull Request #484: feat: support increment import

2099 of 3218 branches covered (65.23%)

24 of 703 new or added lines in 18 files covered. (3.41%)

49 existing lines in 6 files now uncovered.

25815 of 92109 relevant lines covered (28.03%)

5.52 hits per line

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

0.0
/apps/nestjs-backend/src/features/calculation/utils/name-console.ts
1
// eslint-disable-next-line @typescript-eslint/no-explicit-any, sonarjs/cognitive-complexity
×
2
function replaceFieldIdsWithNames(obj: any, fieldMap: { [fieldId: string]: { name: string } }) {
×
3
  if (typeof obj === 'object' && obj !== null) {
×
4
    for (const key in obj) {
×
5
      // eslint-disable-next-line no-prototype-builtins
×
6
      if (obj.hasOwnProperty(key)) {
×
7
        let newKey = key;
×
8
        if (key.startsWith('fld') && fieldMap[key]) {
×
9
          newKey = fieldMap[key].name;
×
10
        }
×
11
        obj[newKey] = replaceFieldIdsWithNames(obj[key], fieldMap);
×
12
        if (newKey !== key) delete obj[key];
×
13
      }
×
14
    }
×
15
  } else if (typeof obj === 'string' && obj.startsWith('fld') && fieldMap[obj]) {
×
16
    obj = fieldMap[obj].name;
×
17
  }
×
18
  return obj;
×
19
}
×
20

×
21
export function nameConsole(
×
22
  key: string,
×
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
×
24
  obj: any,
×
25
  fieldMap: { [fieldId: string]: { name: string } }
×
26
) {
×
27
  obj = JSON.parse(JSON.stringify(obj));
×
28
  console.log(key, JSON.stringify(replaceFieldIdsWithNames(obj, fieldMap), null, 2));
×
29
}
×
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