Skip to content

Commit db9b710

Browse files
committed
docs(readme): update property converters documentation
1 parent f2aba79 commit db9b710

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ const guid = Guid.create();
124124

125125

126126
### property converters
127+
All methods convert the attribute's value to a type and returns it.
128+
The first param is the attribute's value which is always a string.
129+
127130
* Methods
128131
* valueless(val) :boolean
129132

src/client/scripts/public/props/converters.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
/*******************************************
1+
/*************************************************************
22
* PROPERTY CONVERTERS
3-
* ----------------------------------------
3+
* ----------------------------------------------------------
44
* HOW TO USE
5-
- import Converter from './converters.js';
6-
*******************************************/
5+
- import Converter from './converters.js'; :object
6+
* API
7+
- All methods convert the attr val to a type and returns it.
8+
- The first param is the attr val which is always a string.
9+
*************************************************************/
710
const Converters = {
811
valueless(val) { // :boolean
9-
if (typeof val !== 'string') return val;
1012
val = val.trim();
1113
if (!val) return true; // valueless attr is empty string
1214
return /^true$/i.test(val);

0 commit comments

Comments
 (0)