We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db9b710 commit 13eb1d4Copy full SHA for 13eb1d4
README.md
@@ -128,6 +128,7 @@ 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
130
* Methods
131
+ * boolean(val) :boolean
132
* valueless(val) :boolean
133
134
```js
src/client/scripts/public/props/converters.js
@@ -8,6 +8,9 @@
8
- The first param is the attr val which is always a string.
9
*************************************************************/
10
const Converters = {
11
+ boolean(val) { // :boolean
12
+ return /^true$/i.test(val);
13
+ },
14
valueless(val) { // :boolean
15
val = val.trim();
16
if (!val) return true; // valueless attr is empty string
0 commit comments