@andre_garvin/is

0.0.2 • Public • Published

is: instead of writting tyepof so much and less code in gerenal

I created this package becasue someone has to

NOT ON GITHUB YET

const is = require('@andre_garvin/is')

const empytObj = {}
is().stillTrue([
    is(emptyObj).Object(),
    is(emptyObj).notUndefined(),
    !is(emptyObj).empty()
]).then(resp => {
    if (resp) {
        console.log('YUUUUUSSS!!!')
    } else {
        console.log('Is was lied to, why :(')
    }
})


// versuses how you would originally do this
if ( Object.keys(emptyObj).length !== 0 && emptyObj !== undefined && typeof emptyObj === 'object' ) {
   console.log('YUUUUUSSS!!!')
} else {
   console.log('Is was lied to, why :(')
}

Readme

Keywords

none

Package Sidebar

Install

npm i @andre_garvin/is

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • andre_garvin