You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'use strict'/** * @typedef {Object.<string, function(*):boolean>} TypeMap *//** * Get the type of the value in lowercase * @param {*} value * @param {TypeMap} [customTypeMap] a custom type map * @returns {?string} */functiongetType(value,customTypeMap){// Cycle through our type mapfor(constkeyincustomTypeMap){if(customTypeMap.hasOwnProperty(key)){if(customTypeMap[key](value)){returnkey}}}// No type was successfulreturnnull}/** * Get the type of the value in lowercase * @param {*} value * @param {Object.<string, function(*):boolean>} [customTypeMap] a custom type map * @returns {?string} */functiongetTypeWorkaround(value,customTypeMap){// Cycle through our type mapfor(constkeyincustomTypeMap){if(customTypeMap.hasOwnProperty(key)){if(customTypeMap[key](value)){returnkey}}}// No type was successfulreturnnull}
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.3.2
Code
example repository: https://github.com/balupton/typescript-typedef-object-issue
source/index.js
:tsconfig.json
:Expected behavior:
Expected that
getType
would use theTypeMap
type definition correctly.Actual behavior:
I get this error message on compile:
VSCode Screenshots:
The text was updated successfully, but these errors were encountered: