Infer JavaScript primtive types from a string value
A separate package for simple primitive type inference allows the re-use of the code for more complex applications.
Important: From version
1.0, this package supports only NodeJS with version 20 or later, and uses ES Modules exclusively.
This package can be downloaded from NPM.
The package exports a single function:
import inferType from '@giancarl021/type-inference';
const myInferedNumber = inferType('10');
console.log(typeof myInferedNumber === 'number');
// true