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

teableio / teable / 8468158184

28 Mar 2024 01:35PM CUT coverage: 82.464% (+60.6%) from 21.828%
8468158184

Pull #484

github

web-flow
Merge c20c5dad5 into 53432a5aa
Pull Request #484: feat: support increment import

3938 of 4143 branches covered (95.05%)

65 of 69 new or added lines in 3 files covered. (94.2%)

26137 of 31695 relevant lines covered (82.46%)

1210.61 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