@prisma/client-common 6.12.0-dev.3 → 6.12.0-dev.31

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.
package/dist/casing.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- export declare function capitalize(str: string): string;
2
1
  /**
3
- * Converts the first character of a word to lower case
4
- * @param name
2
+ * Converts the first character of a word to upper case.
5
3
  */
6
- export declare function lowerCase(name: string): string;
4
+ export declare function capitalize<T extends string>(self: T): Capitalize<T>;
5
+ /**
6
+ * Converts the first character of a word to lower case.
7
+ */
8
+ export declare function uncapitalize<T extends string>(self: T): Uncapitalize<T>;
package/dist/casing.js CHANGED
@@ -19,18 +19,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var casing_exports = {};
20
20
  __export(casing_exports, {
21
21
  capitalize: () => capitalize,
22
- lowerCase: () => lowerCase
22
+ uncapitalize: () => uncapitalize
23
23
  });
24
24
  module.exports = __toCommonJS(casing_exports);
25
- function capitalize(str) {
26
- if (!str) return str;
27
- return str[0].toUpperCase() + str.slice(1);
25
+ function capitalize(self) {
26
+ if (self.length === 0) return self;
27
+ return self[0].toUpperCase() + self.slice(1);
28
28
  }
29
- function lowerCase(name) {
30
- return name.substring(0, 1).toLowerCase() + name.substring(1);
29
+ function uncapitalize(self) {
30
+ return self.substring(0, 1).toLowerCase() + self.substring(1);
31
31
  }
32
32
  // Annotate the CommonJS export names for ESM import in node:
33
33
  0 && (module.exports = {
34
34
  capitalize,
35
- lowerCase
35
+ uncapitalize
36
36
  });
package/dist/casing.mjs CHANGED
@@ -1,11 +1,11 @@
1
- function capitalize(str) {
2
- if (!str) return str;
3
- return str[0].toUpperCase() + str.slice(1);
1
+ function capitalize(self) {
2
+ if (self.length === 0) return self;
3
+ return self[0].toUpperCase() + self.slice(1);
4
4
  }
5
- function lowerCase(name) {
6
- return name.substring(0, 1).toLowerCase() + name.substring(1);
5
+ function uncapitalize(self) {
6
+ return self.substring(0, 1).toLowerCase() + self.substring(1);
7
7
  }
8
8
  export {
9
9
  capitalize,
10
- lowerCase
10
+ uncapitalize
11
11
  };
@@ -15,20 +15,20 @@ var import_casing = require("./casing");
15
15
  (0, import_vitest.expect)((0, import_casing.capitalize)("Hello")).toBe("Hello");
16
16
  });
17
17
  });
18
- (0, import_vitest.describe)("lowerCase", () => {
18
+ (0, import_vitest.describe)("uncapitalize", () => {
19
19
  (0, import_vitest.test)("empty", () => {
20
- (0, import_vitest.expect)((0, import_casing.lowerCase)("")).toBe("");
20
+ (0, import_vitest.expect)((0, import_casing.uncapitalize)("")).toBe("");
21
21
  });
22
22
  (0, import_vitest.test)("single character", () => {
23
- (0, import_vitest.expect)((0, import_casing.lowerCase)("A")).toBe("a");
23
+ (0, import_vitest.expect)((0, import_casing.uncapitalize)("A")).toBe("a");
24
24
  });
25
25
  (0, import_vitest.test)("multiple characters", () => {
26
- (0, import_vitest.expect)((0, import_casing.lowerCase)("Hello")).toBe("hello");
26
+ (0, import_vitest.expect)((0, import_casing.uncapitalize)("Hello")).toBe("hello");
27
27
  });
28
28
  (0, import_vitest.test)("does not modify already lower case string", () => {
29
- (0, import_vitest.expect)((0, import_casing.lowerCase)("hello")).toBe("hello");
29
+ (0, import_vitest.expect)((0, import_casing.uncapitalize)("hello")).toBe("hello");
30
30
  });
31
31
  (0, import_vitest.test)("only lowercases the first character", () => {
32
- (0, import_vitest.expect)((0, import_casing.lowerCase)("HelloWorld")).toBe("helloWorld");
32
+ (0, import_vitest.expect)((0, import_casing.uncapitalize)("HelloWorld")).toBe("helloWorld");
33
33
  });
34
34
  });
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, test } from "vitest";
2
- import { capitalize, lowerCase } from "./casing";
2
+ import { capitalize, uncapitalize } from "./casing";
3
3
  describe("capitalize", () => {
4
4
  test("empty", () => {
5
5
  expect(capitalize("")).toBe("");
@@ -14,20 +14,20 @@ describe("capitalize", () => {
14
14
  expect(capitalize("Hello")).toBe("Hello");
15
15
  });
16
16
  });
17
- describe("lowerCase", () => {
17
+ describe("uncapitalize", () => {
18
18
  test("empty", () => {
19
- expect(lowerCase("")).toBe("");
19
+ expect(uncapitalize("")).toBe("");
20
20
  });
21
21
  test("single character", () => {
22
- expect(lowerCase("A")).toBe("a");
22
+ expect(uncapitalize("A")).toBe("a");
23
23
  });
24
24
  test("multiple characters", () => {
25
- expect(lowerCase("Hello")).toBe("hello");
25
+ expect(uncapitalize("Hello")).toBe("hello");
26
26
  });
27
27
  test("does not modify already lower case string", () => {
28
- expect(lowerCase("hello")).toBe("hello");
28
+ expect(uncapitalize("hello")).toBe("hello");
29
29
  });
30
30
  test("only lowercases the first character", () => {
31
- expect(lowerCase("HelloWorld")).toBe("helloWorld");
31
+ expect(uncapitalize("HelloWorld")).toBe("helloWorld");
32
32
  });
33
33
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-common",
3
- "version": "6.12.0-dev.3",
3
+ "version": "6.12.0-dev.31",
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,10 +24,10 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@prisma/dmmf": "6.12.0-dev.3",
28
- "@prisma/driver-adapter-utils": "6.12.0-dev.3",
29
- "@prisma/generator": "6.12.0-dev.3",
30
- "@prisma/internals": "6.12.0-dev.3"
27
+ "@prisma/dmmf": "6.12.0-dev.31",
28
+ "@prisma/driver-adapter-utils": "6.12.0-dev.31",
29
+ "@prisma/generator": "6.12.0-dev.31",
30
+ "@prisma/internals": "6.12.0-dev.31"
31
31
  },
32
32
  "devDependencies": {
33
33
  "vitest": "3.0.9"