@wssto2/vue-core 0.9.3 → 0.9.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/CHANGELOG.md +4 -0
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.js +610 -592
- package/dist/form/storableText.d.ts +24 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The `params.code` of the issue `refineStorableText` adds, and the code the server answers with (422). */
|
|
2
|
+
export declare const unsupportedCharactersCode = "unsupported_characters";
|
|
3
|
+
/** True when `value` holds a character a utf8mb3 column cannot store. */
|
|
4
|
+
export declare function hasUnsupportedCharacters(value: string): boolean;
|
|
5
|
+
/** What `refineStorableText` needs of the validator's context; Zod's `RefinementCtx` fits, the library does not import Zod. */
|
|
6
|
+
export interface StorableTextContext {
|
|
7
|
+
addIssue(issue: {
|
|
8
|
+
code: "custom";
|
|
9
|
+
path: (string | number)[];
|
|
10
|
+
params: {
|
|
11
|
+
code: typeof unsupportedCharactersCode;
|
|
12
|
+
};
|
|
13
|
+
}): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `.superRefine` callback: reports every string anywhere in the value that holds an unsupported
|
|
17
|
+
* character, on that string's path, with `params.code` set to `unsupportedCharactersCode` (the
|
|
18
|
+
* app's i18n owns the wording).
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* const schema = z.object({ name: z.string(), notes: z.array(z.string()) }).superRefine(refineStorableText);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function refineStorableText(data: unknown, ctx: StorableTextContext): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
|
|
2
|
-
export declare const version = "0.9.
|
|
2
|
+
export declare const version = "0.9.4";
|
package/dist/index.js
CHANGED
package/package.json
CHANGED