Commit db9b710 1 parent f2aba79 commit db9b710 Copy full SHA for db9b710
File tree 2 files changed +10
-5
lines changed
src/client/scripts/public/props
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,9 @@ const guid = Guid.create();
124
124
125
125
126
126
### 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
+
127
130
* Methods
128
131
* valueless(val) :boolean
129
132
Original file line number Diff line number Diff line change 1
- /*******************************************
1
+ /*************************************************************
2
2
* PROPERTY CONVERTERS
3
- * ----------------------------------------
3
+ * ----------------------------------------------------------
4
4
* 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
+ *************************************************************/
7
10
const Converters = {
8
11
valueless ( val ) { // :boolean
9
- if ( typeof val !== 'string' ) return val ;
10
12
val = val . trim ( ) ;
11
13
if ( ! val ) return true ; // valueless attr is empty string
12
14
return / ^ t r u e $ / i. test ( val ) ;
You can’t perform that action at this time.
0 commit comments