type logic against javascript metaprogramming
npm install typeomatica
!NPM
!GitHub package.json version
!GitHub last commit
This package is a part of mnemonica project.
Strict Types checker for objects which represent Data Types.
see test/index.ts
``js
class SimpleBase extends BasePrototype {
stringProp = '123';
};
// nect code line will work properly
simpleInstance.stringProp = '321';
// but next code line will throw TypeError('Type Mismatch')
// @ts-ignore
simpleInstance.stringProp = 123;
`
That is it. It will be impossible to assign anything else except of:
`js `
typeof something === 'string'
to stringProp` in runtime.
As we describe Data Types — please take a peek for tests directory:
HERE.