@akad/form-builder 1.0.0 → 1.0.2
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/components/FormBuilder/utils/facade/AddressFormLegacy.d.ts +0 -1
- package/components/FormBuilder/utils/facade/PaymentOptionsLegacy.d.ts +0 -1
- package/components/FormBuilder/utils/typeCoercion.d.ts +14 -0
- package/package.json +1 -1
- package/react-lib.js +10786 -10792
- package/react-lib.umd.cjs +75 -75
|
@@ -55,3 +55,17 @@ export declare function coerceType(value: unknown, schemaProps: Record<string, u
|
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
57
|
export declare function coerceFieldValue(fieldPath: string, value: unknown, schema: Record<string, unknown>): unknown;
|
|
58
|
+
/**
|
|
59
|
+
* Safely converts a value to a string for form inputs
|
|
60
|
+
* @description Prevents '[object Object]' stringification by handling null/undefined/objects properly
|
|
61
|
+
* @param value - The value to convert
|
|
62
|
+
* @returns A string representation, or empty string for null/undefined/objects/arrays
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* safeStringValue(null); // Returns ''
|
|
66
|
+
* safeStringValue('hello'); // Returns 'hello'
|
|
67
|
+
* safeStringValue(42); // Returns '42'
|
|
68
|
+
* safeStringValue({}); // Returns '' (prevents '[object Object]')
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function safeStringValue(value: unknown): string;
|