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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +9 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {
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: Boolean,
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) {