Skip to content

Commit

Permalink
Revert ლ
Browse files Browse the repository at this point in the history
  • Loading branch information
shrinktofit committed Jan 7, 2022
1 parent 8d34e9e commit 54e5607
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 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": "3.2.3",
"version": "3.2.4",
"description": "Yet another tool to generate .d.ts bundle.",
"main": "build/gift.js",
"types": "build/gift.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions source/gift.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export function rollupTypes(options: IOptions) {
current = current.parent;
}

const name = namespaces.join('');
const name = namespaces.join('_');
return name;
}

Expand All @@ -412,7 +412,7 @@ export function rollupTypes(options: IOptions) {

function generateIdFromString(text: string) {
// To handle keywords and illegal first letters, we prefix it with a legal letter.
return '' + text.replace(/[\/\\-]/g, '').replace(/['":\.@]/g, '');
return '_' + text.replace(/[\/\\-]/g, '_').replace(/['":\.@]/g, '');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

exports[`Non exported symbol distribution: Export to "firstly encountered" module 1`] = `
"declare module \\"baz\\" {
export function foo(): __private.internalლლNonExported;
export function foo(): __private._internal__NonExported;
export namespace __private {
export class ლinternalლლNonExported {
export class _internal__NonExported {
}
}
export {};
}
declare module \\"foo\\" {
export function foo(): ___private.internalლლNonExported;
export function foo(): ___private._internal__NonExported;
import { __private as ___private } from \\"baz\\";
export {};
}
declare module \\"bar\\" {
export function bar(): ___private.internalლლNonExported;
export function bar(): ___private._internal__NonExported;
import { __private as ___private } from \\"baz\\";
export {};
}
Expand All @@ -24,19 +24,19 @@ declare module \\"bar\\" {

exports[`Non exported symbol distribution: Export to bar 1`] = `
"declare module \\"baz\\" {
export function foo(): ___private.internalლლNonExported;
export function foo(): ___private._internal__NonExported;
import { __private as ___private } from \\"bar\\";
export {};
}
declare module \\"foo\\" {
export function foo(): ___private.internalლლNonExported;
export function foo(): ___private._internal__NonExported;
import { __private as ___private } from \\"bar\\";
export {};
}
declare module \\"bar\\" {
export function bar(): __private.internalლლNonExported;
export function bar(): __private._internal__NonExported;
export namespace __private {
export class ლinternalლლNonExported {
export class _internal__NonExported {
}
}
export {};
Expand All @@ -46,20 +46,20 @@ declare module \\"bar\\" {

exports[`Non exported symbol distribution: Export to foo 1`] = `
"declare module \\"baz\\" {
export function foo(): ___private.internalლლNonExported;
export function foo(): ___private._internal__NonExported;
import { __private as ___private } from \\"foo\\";
export {};
}
declare module \\"foo\\" {
export function foo(): __private.internalლლNonExported;
export function foo(): __private._internal__NonExported;
export namespace __private {
export class ლinternalლლNonExported {
export class _internal__NonExported {
}
}
export {};
}
declare module \\"bar\\" {
export function bar(): ___private.internalლლNonExported;
export function bar(): ___private._internal__NonExported;
import { __private as ___private } from \\"foo\\";
export {};
}
Expand Down
4 changes: 2 additions & 2 deletions test/types/__snapshots__/types.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ exports[`From triple slash directive 1`] = `
export class Component {
}
export class Node {
getComponent<T extends Component>(constructor: __private.typesglobalsლლConstructor<T>): T | null;
getComponent<T extends Component>(constructor: __private._types_globals__Constructor<T>): T | null;
}
export namespace __private {
export type ლtypesლglobalsლლConstructor<T = unknown> = new (...args: any[]) => T;
export type _types_globals__Constructor<T = unknown> = new (...args: any[]) => T;
}
export {};
}
Expand Down

0 comments on commit 54e5607

Please sign in to comment.