diff options
author | ache <ache@ache.one> | 2018-10-18 09:06:42 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2018-10-18 09:06:42 +0200 |
commit | 83363c9c24e846491b7f546f20365e7afe1b5359 (patch) | |
tree | 2f1cf0bc22740d551e8ac8a15b4b22dd2da31b13 | |
parent | Update dist package (diff) |
Add some documentation
-rw-r--r-- | README.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -53,6 +53,22 @@ parseAttr('{ width=500px editable=true #unicorn .dangerous .cute }'); } ``` +### Advanced usage + +The parsing can start at a positive offset. + +```js +parseAttr('SYNTAX{ width=500px editable=true }', len('SYNTAX')); +``` + +A configuration can also be specified, actualy, there is only one configuration option. +The default value of key without value. + +```js +parseAttr('{ width=500px editable }', 0, {defaultValue: true}); +// or +parseAttr('{ width=500px editable }', 0, {defaultValue: key => 'NO_VALUE_FOR_'+key.toUpperCase()}); +``` ## Licence |