I have a simple module. Use for checking variable type.
index.js
'use strict';
var typeOf = function (variable) {
return ({}).toString.call(variable).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
};
module.exports = typeOf;
index.d.ts
export default typeOf;
declare function typeOf(value:any):string;
Here how I use it.
import typeOf from 'lc-type-of';
typeOf(value);
But the code dosen't work as expect. The typeOf function came out undefined error. Do I miss something?
when you export node like with Javascript:
in Typescript import it like :
and in the definition