@prisma/client-engine-runtime 6.16.0-integration-feat-orm-1074-package-dev-export.4 → 6.16.0-integration-push-prynymnkvlrn.4
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/index.js +14 -10
- package/dist/index.mjs +9 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
52
52
|
var import_decimal2 = require("decimal.js");
|
|
53
53
|
|
|
54
54
|
// src/utils.ts
|
|
55
|
-
var import_decimal = require("decimal.js");
|
|
55
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
56
56
|
function assertNever(_, message) {
|
|
57
57
|
throw new Error(message);
|
|
58
58
|
}
|
|
@@ -67,7 +67,7 @@ function doKeysMatch(lhs, rhs) {
|
|
|
67
67
|
if (typeof lhs[key] === typeof rhs[key] && typeof lhs[key] !== "object") {
|
|
68
68
|
return lhs[key] === rhs[key];
|
|
69
69
|
}
|
|
70
|
-
if (import_decimal.
|
|
70
|
+
if (import_decimal.default.isDecimal(lhs[key]) || import_decimal.default.isDecimal(rhs[key])) {
|
|
71
71
|
const lhsDecimal = asDecimal(lhs[key]);
|
|
72
72
|
const rhsDecimal = asDecimal(rhs[key]);
|
|
73
73
|
return lhsDecimal && rhsDecimal && lhsDecimal.equals(rhsDecimal);
|
|
@@ -86,10 +86,10 @@ function doKeysMatch(lhs, rhs) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
function asDecimal(value) {
|
|
89
|
-
if (import_decimal.
|
|
89
|
+
if (import_decimal.default.isDecimal(value)) {
|
|
90
90
|
return value;
|
|
91
91
|
} else if (typeof value === "number" || typeof value === "string") {
|
|
92
|
-
return new import_decimal.
|
|
92
|
+
return new import_decimal.default(value);
|
|
93
93
|
} else {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
@@ -136,8 +136,8 @@ function safeJsonStringify(obj) {
|
|
|
136
136
|
return JSON.stringify(obj, (_key, val) => {
|
|
137
137
|
if (typeof val === "bigint") {
|
|
138
138
|
return val.toString();
|
|
139
|
-
} else if (val
|
|
140
|
-
return Buffer.from(val).toString("base64");
|
|
139
|
+
} else if (ArrayBuffer.isView(val)) {
|
|
140
|
+
return Buffer.from(val.buffer, val.byteOffset, val.byteLength).toString("base64");
|
|
141
141
|
}
|
|
142
142
|
return val;
|
|
143
143
|
});
|
|
@@ -155,6 +155,10 @@ function normalizeJsonProtocolValues(result) {
|
|
|
155
155
|
if (isTaggedValue(result)) {
|
|
156
156
|
return normalizeTaggedValue(result);
|
|
157
157
|
}
|
|
158
|
+
if (ArrayBuffer.isView(result)) {
|
|
159
|
+
const buffer = Buffer.from(result.buffer, result.byteOffset, result.byteLength);
|
|
160
|
+
return buffer.toString("base64");
|
|
161
|
+
}
|
|
158
162
|
if (result.constructor !== null && result.constructor.name !== "Object") {
|
|
159
163
|
return result;
|
|
160
164
|
}
|
|
@@ -439,7 +443,7 @@ function convertCompactedRows(rows, compiledBatch) {
|
|
|
439
443
|
}
|
|
440
444
|
|
|
441
445
|
// src/interpreter/data-mapper.ts
|
|
442
|
-
var import_decimal3 = require("decimal.js");
|
|
446
|
+
var import_decimal3 = __toESM(require("decimal.js"));
|
|
443
447
|
var DataMapperError = class extends Error {
|
|
444
448
|
name = "DataMapperError";
|
|
445
449
|
};
|
|
@@ -601,7 +605,7 @@ function mapValue(value, columnName, scalarType, enums) {
|
|
|
601
605
|
throw new DataMapperError(`Expected a boolean in column '${columnName}', got ${typeof value}: ${value}`);
|
|
602
606
|
}
|
|
603
607
|
case "decimal":
|
|
604
|
-
if (typeof value !== "number" && typeof value !== "string" && !import_decimal3.
|
|
608
|
+
if (typeof value !== "number" && typeof value !== "string" && !import_decimal3.default.isDecimal(value)) {
|
|
605
609
|
throw new DataMapperError(`Expected a decimal in column '${columnName}', got ${typeof value}: ${value}`);
|
|
606
610
|
}
|
|
607
611
|
return { $type: "Decimal", value };
|
|
@@ -1802,7 +1806,7 @@ function evalFieldOperation(op, value, scope, generators) {
|
|
|
1802
1806
|
}
|
|
1803
1807
|
|
|
1804
1808
|
// src/raw-json-protocol.ts
|
|
1805
|
-
var import_decimal4 = require("decimal.js");
|
|
1809
|
+
var import_decimal4 = __toESM(require("decimal.js"));
|
|
1806
1810
|
function normalizeRawJsonProtocolResponse(response) {
|
|
1807
1811
|
for (let i = 0; i < response.rows.length; i++) {
|
|
1808
1812
|
const row = response.rows[i];
|
|
@@ -1820,7 +1824,7 @@ function normalizeValue(type, value) {
|
|
|
1820
1824
|
case "bigint":
|
|
1821
1825
|
return String(BigInt(value));
|
|
1822
1826
|
case "decimal":
|
|
1823
|
-
return String(new import_decimal4.
|
|
1827
|
+
return String(new import_decimal4.default(value));
|
|
1824
1828
|
case "bigint-array":
|
|
1825
1829
|
return value.map((v) => normalizeValue("bigint", v));
|
|
1826
1830
|
case "decimal-array":
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Decimal as Decimal2 } from "decimal.js";
|
|
3
3
|
|
|
4
4
|
// src/utils.ts
|
|
5
|
-
import
|
|
5
|
+
import Decimal from "decimal.js";
|
|
6
6
|
function assertNever(_, message) {
|
|
7
7
|
throw new Error(message);
|
|
8
8
|
}
|
|
@@ -86,8 +86,8 @@ function safeJsonStringify(obj) {
|
|
|
86
86
|
return JSON.stringify(obj, (_key, val) => {
|
|
87
87
|
if (typeof val === "bigint") {
|
|
88
88
|
return val.toString();
|
|
89
|
-
} else if (val
|
|
90
|
-
return Buffer.from(val).toString("base64");
|
|
89
|
+
} else if (ArrayBuffer.isView(val)) {
|
|
90
|
+
return Buffer.from(val.buffer, val.byteOffset, val.byteLength).toString("base64");
|
|
91
91
|
}
|
|
92
92
|
return val;
|
|
93
93
|
});
|
|
@@ -105,6 +105,10 @@ function normalizeJsonProtocolValues(result) {
|
|
|
105
105
|
if (isTaggedValue(result)) {
|
|
106
106
|
return normalizeTaggedValue(result);
|
|
107
107
|
}
|
|
108
|
+
if (ArrayBuffer.isView(result)) {
|
|
109
|
+
const buffer = Buffer.from(result.buffer, result.byteOffset, result.byteLength);
|
|
110
|
+
return buffer.toString("base64");
|
|
111
|
+
}
|
|
108
112
|
if (result.constructor !== null && result.constructor.name !== "Object") {
|
|
109
113
|
return result;
|
|
110
114
|
}
|
|
@@ -389,7 +393,7 @@ function convertCompactedRows(rows, compiledBatch) {
|
|
|
389
393
|
}
|
|
390
394
|
|
|
391
395
|
// src/interpreter/data-mapper.ts
|
|
392
|
-
import
|
|
396
|
+
import Decimal3 from "decimal.js";
|
|
393
397
|
var DataMapperError = class extends Error {
|
|
394
398
|
name = "DataMapperError";
|
|
395
399
|
};
|
|
@@ -1752,7 +1756,7 @@ function evalFieldOperation(op, value, scope, generators) {
|
|
|
1752
1756
|
}
|
|
1753
1757
|
|
|
1754
1758
|
// src/raw-json-protocol.ts
|
|
1755
|
-
import
|
|
1759
|
+
import Decimal4 from "decimal.js";
|
|
1756
1760
|
function normalizeRawJsonProtocolResponse(response) {
|
|
1757
1761
|
for (let i = 0; i < response.rows.length; i++) {
|
|
1758
1762
|
const row = response.rows[i];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-engine-runtime",
|
|
3
|
-
"version": "6.16.0-integration-
|
|
3
|
+
"version": "6.16.0-integration-push-prynymnkvlrn.4",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"nanoid": "5.1.5",
|
|
32
32
|
"ulid": "3.0.0",
|
|
33
33
|
"uuid": "11.1.0",
|
|
34
|
-
"@prisma/
|
|
35
|
-
"@prisma/
|
|
34
|
+
"@prisma/driver-adapter-utils": "6.16.0-integration-push-prynymnkvlrn.4",
|
|
35
|
+
"@prisma/debug": "6.16.0-integration-push-prynymnkvlrn.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/jest": "29.5.14",
|