typehardeningrc

0.9.9-beta20 • Public • Published

typeHardening

Type hardening is a simple type / type limit checker

init

const typeHardening =  new (require('./index.js')).base();

supported types

type comment
any
array
boolean
float
function
integer
list
select
string

type object

const typeObject = {  // variable type description
       'type':'string', // variable type
       'list': [], // list of posible values (optional)
       'max': [], // maximum value limit (optional)
       'min': [] // minimum value limit (optional)
    },

check


typeHardening.check( 
    typeObject,
    'value' // checkable value
);

// expectation is boolean

getDefault value


typeHardening.getDefault( typeObject );


// expectation is any

Readme

Keywords

Package Sidebar

Install

npm i typehardeningrc

Weekly Downloads

10

Version

0.9.9-beta20

License

GPL-3.0-or-later

Unpacked Size

27.5 kB

Total Files

4

Last publish

Collaborators

  • soldy