typemy
v0.0.1
Published
Get the type of each value in an object
Downloads
3
Readme
typemy
Install
npm install typemy
Usage
const typemy = require("typemy");
const object = {
a: "string",
b: 2,
c: [],
d: {
i: Symbol("sym"),
ii: null,
iii: undefined,
iv: {}
},
e: () => {},
f: new Error("err!!!")
};
const typedObject = typemy(object);
console.log(typedObject);
/*
{ a: 'String',
b: 'Number',
c: 'Array',
d: {
i: 'Symbol',
ii: 'Null',
iii: 'Undefined',
iv: 'Object'
},
e: 'Function',
f: 'Error'
}
*/
License
MIT © wmik