Using an `index.ts` file to export multiple types that would be deserialized causes silent failures
See original GitHub issueIf you have multiple files like bellow:
data/stat-weight-unit.ts
export type StatWeightUnit = 'lbs' | 'kg';
data/stat-engine-power-unit.ts
export type StatEnginePowerUnit = 'hp';
data/index.ts
export { StatWeightUnit } from './stat-weight-unit';
export { StatEnginePowerUnit } from './stat-engine-power-unit';
test.ts
import { StatEnginePowerUnit } from './data';
console.log(cast<StatEnginePowerUnit>('kg'));
The serializer will return undefined
always, and it will not emit the value, no matter if the serialized value is valid or not.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Export all files in `index.ts` - Stack Overflow
In this case, you need to create an index.ts file in your components directory. ... Note 1: Using this type of imports/exports will...
Read more >Imports in index.ts file are not getting correctly resolved. #29171
When I try to import, Engine class in another file using import {Engine} from '../engine'; engine is not defined.
Read more >Node.js v19.3.0 Documentation
Indicates the failure of an assertion. All errors thrown by the node:assert module will be instances of the AssertionError class. new assert.AssertionError( ...
Read more >Firebase JavaScript SDK Release Notes - Google
Added types fields to exports object in package.json files for all published ... Fixed some typings issues that caused compile errors for TypeScript...
Read more >IO tools (text, CSV, HDF5, …) — pandas 1.5.2 documentation
index_col=False can be used to force pandas to not use the first column as the index, e.g. when you have a malformed file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@danfma ok, cool! You might be interested in https://github.com/hanayashiki/deepkit-openapi
ah, I see, thanks for the explanation. I think we have to adjust export statements in the compiler to fix that, so that
becomes
seems straightforward and easy