saasufy-components 5.4.0 → 5.5.0
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/package.json +1 -1
- package/utils.js +9 -3
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -374,14 +374,20 @@ export function generateRandomHexString(byteLength) {
|
|
|
374
374
|
export const fieldPartsRegExp = /("[^"]*"|'[^']*'|\([^)]*\)|[^,()"']+)+/g;
|
|
375
375
|
export const quotedContentRegExp = /^\s*["']?(.*?)["']?\s*$/;
|
|
376
376
|
|
|
377
|
+
export function toBoolean(value) {
|
|
378
|
+
return !!value && value !== 'false' && value !== 'null' && value !== 'undefined';
|
|
379
|
+
}
|
|
380
|
+
|
|
377
381
|
export const typeCastFunctions = {
|
|
378
382
|
text: String,
|
|
379
383
|
textarea: String,
|
|
380
|
-
checkbox:
|
|
381
|
-
number: Number,
|
|
384
|
+
checkbox: toBoolean,
|
|
382
385
|
radio: String,
|
|
383
386
|
select: String,
|
|
384
|
-
'text-select': String
|
|
387
|
+
'text-select': String,
|
|
388
|
+
number: Number,
|
|
389
|
+
string: String,
|
|
390
|
+
boolean: toBoolean
|
|
385
391
|
};
|
|
386
392
|
|
|
387
393
|
export function getTypeCastFunction(type) {
|