Skip to content

Commit

Permalink
Release 2.0.18; Fix mapping type cast bug (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrinktofit committed Dec 11, 2020
1 parent e5c0421 commit f5a326e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tfig",
"version": "2.0.17",
"version": "2.0.18",
"description": "Yet another tool to generate .d.ts bundle.",
"main": "build/gift.js",
"types": "build/gift.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion source/recast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ export function recastTopLevelModule({
return ts.createMappedTypeNode(
recastToken(type.readonlyToken),
recastTypeParameter(type.typeParameter),
recastTypeNode(type.type),
recastTypeNode(type.nameType),
recastToken(type.questionToken),
recastTypeNode(type.type),
);
Expand Down
8 changes: 4 additions & 4 deletions test/alias-exports/alias-export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ps from 'path';
import fs from 'fs-extra';
import { bundle, GiftErrors } from '../../source/gift';

test('alias export', async () => {
describe('alias export', () => {
const match = async (dirName: string) => {
const inputPath = ps.join(__dirname, dirName, 'input.d.ts');
const outputPath = ps.join(__dirname, dirName, 'output.d.ts');
Expand All @@ -19,11 +19,11 @@ test('alias export', async () => {
};

// Export from namespace to module
await match('n-m');
test('n-m', async () => await match('n-m'));

// Export from namespace to namespace
await match('n-n');
test('n-n', async () => await match('n-n'));

// Export from module to namespace
await match('m-n');
test('m-n', async () => await match('m-n'));
});
2 changes: 1 addition & 1 deletion test/alias-exports/m-n/output.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ declare module "out/index" {
export { v };
}
export {};
}
}

0 comments on commit f5a326e

Please sign in to comment.