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

vzakharchenko / Forge-Secure-Notes-for-Jira / 21492811779

29 Jan 2026 08:00PM UTC coverage: 95.191% (-2.8%) from 98.026%
21492811779

push

github

vzakharchenko
fix validation

211 of 224 branches covered (94.2%)

Branch coverage included in aggregate %.

660 of 691 relevant lines covered (95.51%)

20.35 hits per line

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

9.52
/src/database/entities/CustomTypes.ts
1
import { customType } from "drizzle-orm/mysql-core";
2
import { stringify } from "uuid";
3
import { sql } from "drizzle-orm";
4

5
export const uuidBinary = customType<{
28✔
6
  data: string;
7
  driverData: {
8
    type: "Buffer";
9
    data: number[];
10
  };
11
  config: [];
12
}>({
13
  dataType() {
14
    return "varbinary(16)";
56✔
15
  },
16
  toDriver(value) {
17
    if (value === null) {
×
18
      return sql`null`;
×
19
    }
20
    return sql<{
×
21
      type: "Buffer";
22
      data: number[];
23
    }>`UUID_TO_BIN(${value})`;
24
  },
25
  fromDriver(value) {
26
    if (value === null) {
×
27
      return null as unknown as string;
×
28
    }
29
    const arrayBufferBuffer = Buffer.from(value.data);
×
30
    const bytesArray = new Uint8Array(arrayBufferBuffer);
×
31
    if (bytesArray.length !== 16) {
×
32
      throw new Error(`Invalid UUID buffer length: ${bytesArray.length}`);
×
33
    }
34
    try {
×
35
      return stringify(bytesArray);
×
36
    } catch (e) {
37
      // eslint-disable-next-line no-console
38
      console.error(`Unable to parse UUID buffer: ${bytesArray}`, e);
×
39
      return null as unknown as string;
×
40
    }
41
  },
42
});
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

© 2026 Coveralls, Inc