1234567891011 |
- export const objectToString = Object.prototype.toString
- export const toTypeString = (value: unknown): string => objectToString.call(value)
- export const toRawType = (value: unknown): string => {
- // extract "RawType" from strings like "[object RawType]"
- return toTypeString(value).slice(8, -1)
- }
- export const isString = <T>(value: T): T extends string ? true : false => (toRawType(value) === 'String') as any
|