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

teableio / teable / 8389034572

22 Mar 2024 10:38AM UTC coverage: 26.087% (-2.1%) from 28.208%
8389034572

Pull #487

github

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

2100 of 3363 branches covered (62.44%)

282 of 757 new or added lines in 74 files covered. (37.25%)

224 existing lines in 8 files now uncovered.

25574 of 98035 relevant lines covered (26.09%)

5.17 hits per line

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

0.0
/packages/core/src/op-builder/table/set-table-property.ts
NEW
1
import type { IOtOperation } from '../../models';
×
2
import { OpName, pathMatcher } from '../common';
×
3
import type { IOpBuilder } from '../interface';
×
4

×
NEW
5
export interface ITableOp {
×
NEW
6
  name?: string;
×
NEW
7
  dbTableName: string;
×
NEW
8
  description?: string;
×
NEW
9
  icon?: string;
×
NEW
10
  order: number;
×
NEW
11
  lastModifiedTime?: string;
×
NEW
12
}
×
NEW
13

×
NEW
14
type ITablePropertyKey = keyof ITableOp;
×
NEW
15

×
16
export interface ISetTablePropertyOpContext {
×
17
  name: OpName.SetTableProperty;
×
18
  key: ITablePropertyKey;
×
19
  newValue: unknown;
×
20
  oldValue: unknown;
×
21
}
×
22

×
23
export class SetTablePropertyBuilder implements IOpBuilder {
×
24
  name: OpName.SetTableProperty = OpName.SetTableProperty;
×
25

×
26
  build(params: { key: ITablePropertyKey; oldValue: unknown; newValue: unknown }): IOtOperation {
×
27
    const { key, newValue, oldValue } = params;
×
28

×
29
    return {
×
30
      p: [key],
×
31
      ...(newValue == null ? {} : { oi: newValue }),
×
32
      ...(oldValue == null ? {} : { od: oldValue }),
×
33
    };
×
34
  }
×
35

×
36
  detect(op: IOtOperation): ISetTablePropertyOpContext | null {
×
37
    const { p, oi, od } = op;
×
38

×
39
    const result = pathMatcher<Record<string, never>>(p, ['*']);
×
40

×
41
    if (!result) {
×
42
      return null;
×
43
    }
×
44

×
45
    return {
×
46
      name: this.name,
×
47
      key: p[0] as ITablePropertyKey,
×
48
      newValue: oi,
×
49
      oldValue: od,
×
50
    };
×
51
  }
×
52
}
×
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