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

teableio / teable / 8421671885

25 Mar 2024 02:23PM CUT coverage: 79.959% (+53.9%) from 26.087%
8421671885

Pull #496

github

web-flow
Merge f587f00fb into 9313e45fb
Pull Request #496: fix: unexpected link convert

3265 of 3865 branches covered (84.48%)

63 of 63 new or added lines in 4 files covered. (100.0%)

762 existing lines in 27 files now uncovered.

25183 of 31495 relevant lines covered (79.96%)

1188.33 hits per line

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

77.14
/apps/nestjs-backend/src/share-db/utils.ts
1
import { ActionPrefix, IdPrefix } from '@teable/core';
2✔
2
import type { CreateOp, DeleteOp, EditOp } from 'sharedb';
2✔
3

2✔
4
export const getPrefixAction = (docType: IdPrefix) => {
2✔
5
  switch (docType) {
96✔
6
    case IdPrefix.View:
96✔
7
      return ActionPrefix.View;
2✔
8
    case IdPrefix.Table:
96!
9
      return ActionPrefix.Table;
×
10
    case IdPrefix.Record:
96✔
11
      return ActionPrefix.Record;
92✔
12
    case IdPrefix.Field:
96✔
13
      return ActionPrefix.Field;
2✔
14
    default:
96!
UNCOV
15
      return null;
×
16
  }
96✔
17
};
96✔
18

2✔
19
export const getAction = (op: CreateOp | DeleteOp | EditOp) => {
2✔
20
  if (op.create) {
52!
UNCOV
21
    return 'create';
×
UNCOV
22
  }
×
23
  if (op.del) {
52!
24
    return 'delete';
×
25
  }
×
26
  if (op.op) {
52✔
27
    return 'update';
52✔
28
  }
52!
29
  return null;
×
30
};
×
31

2✔
32
export const isShareViewResourceDoc = (docType: IdPrefix) => {
2✔
33
  const shareViewResource = [IdPrefix.View, IdPrefix.Field, IdPrefix.Record];
4✔
34
  return shareViewResource.includes(docType);
4✔
35
};
4✔
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