-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/mapped generic type with date #1597
Fix/mapped generic type with date #1597
Conversation
@WoH need a rerun. thx |
Is this needed if the declaration is included? I am generally very sceptical about these since they basically opt out of everything predictable. |
I'm not sure the meaning of The error is cause by generic type name cannot determine if given T is Date. |
I am worried about any |
I briefly debugged this. We have declarations for Date, 6 of them actually. The fix should be in how we get the right one, not papering over a fix with another fix. |
I do noticed that there is 6 declarations (5 interface, 1 value). Here comes 2 solutions:
modelTypes = modelTypes.filter(modelType => {
// remove types that are from typescript e.g. 'Account'
switch (typeName) {
case 'Date':
return modelType;
default: {
const srcFileName = modelType.getSourceFile().fileName;
return srcFileName.replace(/\\/g, '/').toLowerCase().indexOf('node_modules/typescript') <= -1;
}
}
});
Do you still remember anything about this native escape? |
Iirc there's a lot of bs in there. Basically all environments, as well as type declarations TS uses. Maybe we can decide based on the lib that is used from tsconfig. Otherwise we'd end up including a lot. |
I'm not sure should we keep this line or not. Shall we try remove this? |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Is there any indication of whether and when this pull request will be merged? |
@WoH Any news? |
I have no clue, but removing and bumping a major version seems reasonable |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Will this be reopened and hopefully merged, or is it closed for good? |
is there a change that there is a fix for this? in version 6.4 it still throws an error. |
All Submissions:
Closing issues
Closes #1596
Potential Problems With The Approach
I'm not sure this fix will effect other not covered cases.
Need folks to help me figure it out are there any possible missed cases.