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

teableio / teable / 8389034568

22 Mar 2024 10:38AM UTC coverage: 79.934% (+51.7%) from 28.208%
8389034568

Pull #487

github

web-flow
Merge 3045b1f94 into a06c6afb1
Pull Request #487: refactor: move zod schema to openapi

3263 of 3860 branches covered (84.53%)

67 of 70 new or added lines in 23 files covered. (95.71%)

762 existing lines in 27 files now uncovered.

25152 of 31466 relevant lines covered (79.93%)

1188.31 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