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

teableio / teable / 8421654220

25 Mar 2024 02:22PM CUT coverage: 79.934% (+53.8%) from 26.087%
8421654220

Pull #495

github

web-flow
Merge 4faeebea5 into 1869c986d
Pull Request #495: chore: add licenses for non-NPM packages

3256 of 3853 branches covered (84.51%)

25152 of 31466 relevant lines covered (79.93%)

1188.29 hits per line

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

65.22
/apps/nestjs-backend/src/features/base/utils.ts
1
export function replaceExpressionFieldIds(
2✔
2
  expression: string,
×
3
  fieldIdMap: { [oldFieldId: string]: string }
×
4
): string {
×
5
  const regex = /\{([a-z][a-z\d]*)\}/gi;
×
6
  return expression.replace(regex, (match, fieldId) => {
×
7
    return fieldIdMap[fieldId] ? `{${fieldIdMap[fieldId]}}` : match;
×
8
  });
×
9
}
×
10

2✔
11
export function replaceJsonStringFieldIds(
2✔
12
  jsonString: string | null,
30✔
13
  old2NewFieldMap: { [key: string]: string }
30✔
14
): string | null {
30✔
15
  const regex = /"fld[A-Za-z\d]{16}"/g;
30✔
16
  if (!jsonString) return jsonString;
30✔
17

6✔
18
  return jsonString.replace(regex, (match) => {
6✔
19
    const fieldId = match.slice(1, -1);
21✔
20
    const newFieldId = old2NewFieldMap[fieldId];
21✔
21
    return newFieldId ? `"${newFieldId}"` : match;
21!
22
  });
21✔
23
}
6✔
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