3 ms·
There is no pseudo-code in the documentation. All of the documentation code executes as documented. The library works with type names in two naming modes - def
by lucono 11y ago
There is no pseudo-code in the documentation. All of the documentation code executes as documented.
The library works with type names in two naming modes - default and compact. The default name scheme uses the full type names, such as 'positive_integer', while the compact name scheme uses compact names, such as 'int+' for 'positive_integer'.
You can only be in one mode or the other at any one time. You can switch between the two using the xtype.setOptions method:
xtype(5); // 'positive_integer'
// Switch to compact name scheme:
xtype.setOptions({nameScheme:'compact'});
xtype(5); // 'int+'
See this jsbin I've made for this specific piece of code - http://jsbin.com/kixuko/1/edit?html,js,console http://jsbin.com/kixuko/1/edit?html,js,console.
And the documentation for switching between the default and compact name schemes - https://github.com/lucono/xtypejs/blob/master/docs/Usage.md#switching-to-the-compact-name-scheme https://github.com/lucono/xtypejs/blob/master/docs/Usage.md#....
- btown 11y agoI saw you updated the readme, thanks for that! In its previous state, it was much less clear: https://github.com/lucono/xtypejs/commit/4f9b631e2bd8cddb7be5e847093e6b2dad511c68 https://github.com/lucono/xtypejs/commit/4f9b631e2bd8cddb7be... Again, I think it's a great library, and it's great to see you actively improving it - I was just offering some constructive criticism!
- lucono 11y agoConstructive criticism is very welcome. I updated the docs to better highlight the compact naming scheme switch. Definitely appreciate the feedback.