@prisma/orm-framework 8.0.0-rc.16-dev.4 → 8.0.0-rc.16-dev.5

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.
@@ -0,0 +1,35 @@
1
+ //#region ../../../1-framework/0-foundation/utils/dist/text.mjs
2
+ /**
3
+ * `text` without the run of `character` it ends with, found by walking back from the end, so the cost is the length of that run. A regular expression such as `/ +$/` retries at every position of an earlier run and costs time quadratic in its length.
4
+ */
5
+ function withoutTrailing(text, character) {
6
+ let end = text.length;
7
+ while (end > 0 && text[end - 1] === character) end -= 1;
8
+ return end === text.length ? text : text.slice(0, end);
9
+ }
10
+ /** `1 character`, `3 characters`: a count and its noun, as a refusal names what a value must hold. */
11
+ function counted(count, noun) {
12
+ return `${count} ${count === 1 ? noun : `${noun}s`}`;
13
+ }
14
+ const utf8 = new TextEncoder();
15
+ /** The length of `text` in UTF-8 bytes, the unit databases measure identifiers in. */
16
+ function utf8ByteLength(text) {
17
+ return utf8.encode(text).length;
18
+ }
19
+ /** The longest start of `text` that fits `maxBytes` UTF-8 bytes, cut on a character boundary so a multibyte character is never split. */
20
+ function clipToUtf8Bytes(text, maxBytes) {
21
+ if (utf8ByteLength(text) <= maxBytes) return text;
22
+ let kept = "";
23
+ let bytes = 0;
24
+ for (const character of text) {
25
+ const size = utf8ByteLength(character);
26
+ if (bytes + size > maxBytes) break;
27
+ kept += character;
28
+ bytes += size;
29
+ }
30
+ return kept;
31
+ }
32
+ //#endregion
33
+ export { withoutTrailing as i, counted as n, utf8ByteLength as r, clipToUtf8Bytes as t };
34
+
35
+ //# sourceMappingURL=text-C3TTEtgd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-C3TTEtgd.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/text.mjs"],"sourcesContent":["//#region src/text.ts\n/**\n* `text` without the run of `character` it ends with, found by walking back from the end, so the cost is the length of that run. A regular expression such as `/ +$/` retries at every position of an earlier run and costs time quadratic in its length.\n*/\nfunction withoutTrailing(text, character) {\n\tlet end = text.length;\n\twhile (end > 0 && text[end - 1] === character) end -= 1;\n\treturn end === text.length ? text : text.slice(0, end);\n}\n/** `1 character`, `3 characters`: a count and its noun, as a refusal names what a value must hold. */\nfunction counted(count, noun) {\n\treturn `${count} ${count === 1 ? noun : `${noun}s`}`;\n}\nconst utf8 = new TextEncoder();\n/** The length of `text` in UTF-8 bytes, the unit databases measure identifiers in. */\nfunction utf8ByteLength(text) {\n\treturn utf8.encode(text).length;\n}\n/** The longest start of `text` that fits `maxBytes` UTF-8 bytes, cut on a character boundary so a multibyte character is never split. */\nfunction clipToUtf8Bytes(text, maxBytes) {\n\tif (utf8ByteLength(text) <= maxBytes) return text;\n\tlet kept = \"\";\n\tlet bytes = 0;\n\tfor (const character of text) {\n\t\tconst size = utf8ByteLength(character);\n\t\tif (bytes + size > maxBytes) break;\n\t\tkept += character;\n\t\tbytes += size;\n\t}\n\treturn kept;\n}\n//#endregion\nexport { clipToUtf8Bytes, counted, utf8ByteLength, withoutTrailing };\n\n//# sourceMappingURL=text.mjs.map"],"mappings":";;;;AAIA,SAAS,gBAAgB,MAAM,WAAW;CACzC,IAAI,MAAM,KAAK;CACf,OAAO,MAAM,KAAK,KAAK,MAAM,OAAO,WAAW,OAAO;CACtD,OAAO,QAAQ,KAAK,SAAS,OAAO,KAAK,MAAM,GAAG,GAAG;AACtD;;AAEA,SAAS,QAAQ,OAAO,MAAM;CAC7B,OAAO,GAAG,MAAM,GAAG,UAAU,IAAI,OAAO,GAAG,KAAK;AACjD;AACA,MAAM,OAAO,IAAI,YAAY;;AAE7B,SAAS,eAAe,MAAM;CAC7B,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC;AAC1B;;AAEA,SAAS,gBAAgB,MAAM,UAAU;CACxC,IAAI,eAAe,IAAI,KAAK,UAAU,OAAO;CAC7C,IAAI,OAAO;CACX,IAAI,QAAQ;CACZ,KAAK,MAAM,aAAa,MAAM;EAC7B,MAAM,OAAO,eAAe,SAAS;EACrC,IAAI,QAAQ,OAAO,UAAU;EAC7B,QAAQ;EACR,SAAS;CACV;CACA,OAAO;AACR"}
@@ -6,6 +6,10 @@
6
6
  declare function withoutTrailing(text: string, character: string): string;
7
7
  /** `1 character`, `3 characters`: a count and its noun, as a refusal names what a value must hold. */
8
8
  declare function counted(count: number, noun: string): string;
9
+ /** The length of `text` in UTF-8 bytes, the unit databases measure identifiers in. */
10
+ declare function utf8ByteLength(text: string): number;
11
+ /** The longest start of `text` that fits `maxBytes` UTF-8 bytes, cut on a character boundary so a multibyte character is never split. */
12
+ declare function clipToUtf8Bytes(text: string, maxBytes: number): string;
9
13
  //#endregion
10
- export { withoutTrailing as n, counted as t };
11
- //# sourceMappingURL=text-3bjr4s7K.d.mts.map
14
+ export { withoutTrailing as i, counted as n, utf8ByteLength as r, clipToUtf8Bytes as t };
15
+ //# sourceMappingURL=text-C8_-rheN.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-C8_-rheN.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/text.d.mts"],"mappings":";;;;;iBAIiB,gBAAgB,cAAc;;iBAE9B,QAAQ,eAAe;;iBAEvB,eAAe;;iBAEf,gBAAgB,cAAc"}
package/dist/utils.d.mts CHANGED
@@ -14,5 +14,5 @@ import { t as isThenable } from "./promise-DHJWZv49.mjs";
14
14
  import { n as redactDatabaseUrl, t as RedactedDatabaseUrl } from "./redact-db-url-BlaloOwt.mjs";
15
15
  import { t as SimplifyDeep } from "./simplify-deep-Dw9I_ZUl.mjs";
16
16
  import { t as suppressIdleConnectionErrors } from "./suppress-idle-connection-errors-CKrTbp5P.mjs";
17
- import { n as withoutTrailing, t as counted } from "./text-3bjr4s7K.mjs";
18
- export { DOCS_BASE, DOCS_ERRORS_VERSION, type Diagnostic, InternalError, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type NextAction, type NotOk, type Ok, type RedactedDatabaseUrl, type Result, type Simplify, type SimplifyDeep, type StructuredError, type StructuredErrorOptions, type UnionToIntersection, abortable, and, assertDefined, assertNever, blindCast, canonicalStringify, castAs, counted, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, or, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors, withoutTrailing };
17
+ import { i as withoutTrailing, n as counted, r as utf8ByteLength, t as clipToUtf8Bytes } from "./text-C8_-rheN.mjs";
18
+ export { DOCS_BASE, DOCS_ERRORS_VERSION, type Diagnostic, InternalError, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type NextAction, type NotOk, type Ok, type RedactedDatabaseUrl, type Result, type Simplify, type SimplifyDeep, type StructuredError, type StructuredErrorOptions, type UnionToIntersection, abortable, and, assertDefined, assertNever, blindCast, canonicalStringify, castAs, clipToUtf8Bytes, counted, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, or, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors, utf8ByteLength, withoutTrailing };
package/dist/utils.mjs CHANGED
@@ -11,5 +11,5 @@ import { t as isThenable } from "./promise-D8meygPf.mjs";
11
11
  import { t as redactDatabaseUrl } from "./redact-db-url-CRWJWdB1.mjs";
12
12
  import { a as or, i as okVoid, n as notOk, r as ok, t as and } from "./result-8OXF26MN.mjs";
13
13
  import { t as suppressIdleConnectionErrors } from "./suppress-idle-connection-errors-DzApeUb3.mjs";
14
- import { n as withoutTrailing, t as counted } from "./text-1AbzksP9.mjs";
15
- export { DOCS_BASE, DOCS_ERRORS_VERSION, InternalError, abortable, and, assertDefined, assertNever, blindCast, canonicalStringify, castAs, counted, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, or, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors, withoutTrailing };
14
+ import { i as withoutTrailing, n as counted, r as utf8ByteLength, t as clipToUtf8Bytes } from "./text-C3TTEtgd.mjs";
15
+ export { DOCS_BASE, DOCS_ERRORS_VERSION, InternalError, abortable, and, assertDefined, assertNever, blindCast, canonicalStringify, castAs, clipToUtf8Bytes, counted, docsUrlFor, hashContent, ifDefined, invariant, isArrayEqual, isInternalError, isStructuredError, isStructuredErrorCode, isThenable, notOk, ok, okVoid, or, redactDatabaseUrl, structuredError, suppressIdleConnectionErrors, utf8ByteLength, withoutTrailing };
@@ -1,2 +1,2 @@
1
- import { n as withoutTrailing, t as counted } from "./text-3bjr4s7K.mjs";
2
- export { counted, withoutTrailing };
1
+ import { i as withoutTrailing, n as counted, r as utf8ByteLength, t as clipToUtf8Bytes } from "./text-C8_-rheN.mjs";
2
+ export { clipToUtf8Bytes, counted, utf8ByteLength, withoutTrailing };
@@ -1,2 +1,2 @@
1
- import { n as withoutTrailing, t as counted } from "./text-1AbzksP9.mjs";
2
- export { counted, withoutTrailing };
1
+ import { i as withoutTrailing, n as counted, r as utf8ByteLength, t as clipToUtf8Bytes } from "./text-C3TTEtgd.mjs";
2
+ export { clipToUtf8Bytes, counted, utf8ByteLength, withoutTrailing };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-framework",
3
- "version": "8.0.0-rc.16-dev.4",
3
+ "version": "8.0.0-rc.16-dev.5",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -16,20 +16,20 @@
16
16
  "uniku": "^0.5.0"
17
17
  },
18
18
  "devDependencies": {
19
- "@internal/config": "8.0.0-rc.16-dev.4",
20
- "@internal/contract": "8.0.0-rc.16-dev.4",
21
- "@internal/contract-authoring": "8.0.0-rc.16-dev.4",
22
- "@internal/errors": "8.0.0-rc.16-dev.4",
23
- "@internal/framework-components": "8.0.0-rc.16-dev.4",
24
- "@internal/ids": "8.0.0-rc.16-dev.4",
25
- "@internal/operations": "8.0.0-rc.16-dev.4",
26
- "@internal/psl-parser": "8.0.0-rc.16-dev.4",
27
- "@internal/psl-printer": "8.0.0-rc.16-dev.4",
28
- "@internal/ts-render": "8.0.0-rc.16-dev.4",
29
- "@repo/tsconfig": "8.0.0-rc.16-dev.4",
30
- "@internal/publish-surface": "8.0.0-rc.16-dev.4",
31
- "@repo/tsdown": "8.0.0-rc.16-dev.4",
32
- "@internal/utils": "8.0.0-rc.16-dev.4",
19
+ "@internal/config": "8.0.0-rc.16-dev.5",
20
+ "@internal/contract": "8.0.0-rc.16-dev.5",
21
+ "@internal/contract-authoring": "8.0.0-rc.16-dev.5",
22
+ "@internal/errors": "8.0.0-rc.16-dev.5",
23
+ "@internal/framework-components": "8.0.0-rc.16-dev.5",
24
+ "@internal/ids": "8.0.0-rc.16-dev.5",
25
+ "@internal/operations": "8.0.0-rc.16-dev.5",
26
+ "@internal/psl-parser": "8.0.0-rc.16-dev.5",
27
+ "@internal/psl-printer": "8.0.0-rc.16-dev.5",
28
+ "@internal/ts-render": "8.0.0-rc.16-dev.5",
29
+ "@repo/tsconfig": "8.0.0-rc.16-dev.5",
30
+ "@internal/publish-surface": "8.0.0-rc.16-dev.5",
31
+ "@repo/tsdown": "8.0.0-rc.16-dev.5",
32
+ "@internal/utils": "8.0.0-rc.16-dev.5",
33
33
  "tsdown": "0.22.14",
34
34
  "typescript": "5.9.3",
35
35
  "vitest": "5.0.0-rc.2"
@@ -1,17 +0,0 @@
1
- //#region ../../../1-framework/0-foundation/utils/dist/text.mjs
2
- /**
3
- * `text` without the run of `character` it ends with, found by walking back from the end, so the cost is the length of that run. A regular expression such as `/ +$/` retries at every position of an earlier run and costs time quadratic in its length.
4
- */
5
- function withoutTrailing(text, character) {
6
- let end = text.length;
7
- while (end > 0 && text[end - 1] === character) end -= 1;
8
- return end === text.length ? text : text.slice(0, end);
9
- }
10
- /** `1 character`, `3 characters`: a count and its noun, as a refusal names what a value must hold. */
11
- function counted(count, noun) {
12
- return `${count} ${count === 1 ? noun : `${noun}s`}`;
13
- }
14
- //#endregion
15
- export { withoutTrailing as n, counted as t };
16
-
17
- //# sourceMappingURL=text-1AbzksP9.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-1AbzksP9.mjs","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/text.mjs"],"sourcesContent":["//#region src/text.ts\n/**\n* `text` without the run of `character` it ends with, found by walking back from the end, so the cost is the length of that run. A regular expression such as `/ +$/` retries at every position of an earlier run and costs time quadratic in its length.\n*/\nfunction withoutTrailing(text, character) {\n\tlet end = text.length;\n\twhile (end > 0 && text[end - 1] === character) end -= 1;\n\treturn end === text.length ? text : text.slice(0, end);\n}\n/** `1 character`, `3 characters`: a count and its noun, as a refusal names what a value must hold. */\nfunction counted(count, noun) {\n\treturn `${count} ${count === 1 ? noun : `${noun}s`}`;\n}\n//#endregion\nexport { counted, withoutTrailing };\n\n//# sourceMappingURL=text.mjs.map"],"mappings":";;;;AAIA,SAAS,gBAAgB,MAAM,WAAW;CACzC,IAAI,MAAM,KAAK;CACf,OAAO,MAAM,KAAK,KAAK,MAAM,OAAO,WAAW,OAAO;CACtD,OAAO,QAAQ,KAAK,SAAS,OAAO,KAAK,MAAM,GAAG,GAAG;AACtD;;AAEA,SAAS,QAAQ,OAAO,MAAM;CAC7B,OAAO,GAAG,MAAM,GAAG,UAAU,IAAI,OAAO,GAAG,KAAK;AACjD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-3bjr4s7K.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/text.d.mts"],"mappings":";;;;;iBAIiB,gBAAgB,cAAc;;iBAE9B,QAAQ,eAAe"}