@prisma/ts-builders 7.9.0-dev.9 → 7.10.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,7 +36,7 @@ class DocComment {
36
36
  write(writer) {
37
37
  writer.writeLine("/**");
38
38
  for (const line of this.lines) {
39
- writer.writeLine(` * ${line}`);
39
+ writer.writeLine(` * ${line.replace(/\*\//g, "*\\/")}`);
40
40
  }
41
41
  writer.writeLine(" */");
42
42
  return writer;
@@ -12,7 +12,7 @@ class DocComment {
12
12
  write(writer) {
13
13
  writer.writeLine("/**");
14
14
  for (const line of this.lines) {
15
- writer.writeLine(` * ${line}`);
15
+ writer.writeLine(` * ${line.replace(/\*\//g, "*\\/")}`);
16
16
  }
17
17
  writer.writeLine(" */");
18
18
  return writer;
@@ -37,6 +37,14 @@ var import_stringify = require("./stringify");
37
37
  "
38
38
  `);
39
39
  });
40
+ (0, import_vitest.test)("escapes comment terminator", () => {
41
+ (0, import_vitest.expect)((0, import_stringify.stringify)((0, import_DocComment.docComment)("before */ after"))).toMatchInlineSnapshot(`
42
+ "/**
43
+ * before *\\/ after
44
+ */
45
+ "
46
+ `);
47
+ });
40
48
  (0, import_vitest.test)("tagged template - empty", () => {
41
49
  (0, import_vitest.expect)((0, import_stringify.stringify)(import_DocComment.docComment``)).toMatchInlineSnapshot(`
42
50
  "/**
@@ -36,6 +36,14 @@ test("multiple addText calls", () => {
36
36
  "
37
37
  `);
38
38
  });
39
+ test("escapes comment terminator", () => {
40
+ expect(stringify(docComment("before */ after"))).toMatchInlineSnapshot(`
41
+ "/**
42
+ * before *\\/ after
43
+ */
44
+ "
45
+ `);
46
+ });
39
47
  test("tagged template - empty", () => {
40
48
  expect(stringify(docComment``)).toMatchInlineSnapshot(`
41
49
  "/**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/ts-builders",
3
- "version": "7.9.0-dev.9",
3
+ "version": "7.10.0-dev.1",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@prisma/internals": "7.9.0-dev.9"
27
+ "@prisma/internals": "7.10.0-dev.1"
28
28
  },
29
29
  "files": [
30
30
  "dist"