0.1.1 • Published 5 years ago

xtypejs-name-scheme-compact v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

xtypejs - Name scheme: compact

Installation with npm

npm install xtypejs-name-scheme-compact --save

NodeJs import and setup

var xtype = require('xtypejs');
var xtypejsCompactNameScheme = require('xtypejs-name-scheme-compact');

// Either: Simple setup

xtype.options.setNameScheme(xtypejsCompactNameScheme);

// Or: To first register name scheme internally for later
// reference by name, for switching between name schemes:

xtype.ext.registerNameScheme('compact', xtypejsCompactNameScheme);
xtype.options.setNameScheme('compact');

// Scheme is now active here

HTML script tag import and setup

<!--
    Include name scheme script after xtypejs script 
    to automatically register the name scheme into
    xtypejs with the default scheme name: 'compact'
-->

<script src="path/to/xtype.js"></script>
<script src="path/to/xtypejs-name-scheme-compact.js"></script>

<script>
    xtype.options.setNameScheme('compact');
    // Scheme is now active here
</script>

Usage

For general documentation on using custom name schemes, see:

Type names in scheme


Type Default NameName in Scheme
nullnull
undefinedundef
nannan
symbolsymb
functionfunc
datedate
errorerr
regexpregex
booleanbool
truetrue
falsefalse
stringstr
whitespacestr_
single_char_stringstr1
multi_char_stringstr2+
empty_stringstr0
blank_stringstr0_
non_empty_string-str0
non_blank_string-str0_
numbernum
positive_numbernum+
negative_numbernum-
zeronum0
non_positive_number-num+
non_negative_number-num-
non_zero_number-num0
integerint
positive_integerint+
negative_integerint-
floatfloat
positive_floatfloat+
negative_floatfloat-
infinite_numberinf
positive_infinityinf+
negative_infinityinf-
non_infinite_number-inf
arrayarr
empty_arrayarr0
single_elem_arrayarr1
multi_elem_arrayarr2+
non_empty_array-arr0
objectobj
empty_objectobj0
single_prop_objectobj1
multi_prop_objectobj2+
non_empty_object-obj0
primitiveprim
nothingnil
anyany
nonenone