File tree Expand file tree Collapse file tree
packages/unplugin-dts/src/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,4 +2,13 @@ declare module 'tslib' {
22 export type Test = { newField : string }
33}
44
5+ declare global {
6+ // eslint-disable-next-line @typescript-eslint/no-namespace
7+ namespace jest {
8+ interface Matchers < R > {
9+ toChildSnapshot : ( filename : string , name : string ) => R
10+ }
11+ }
12+ }
13+
514export { }
Original file line number Diff line number Diff line change @@ -245,15 +245,18 @@ export function transformCode(options: {
245245 node . body . statements . some ( isVLSNode )
246246 ) {
247247 s . remove ( node . pos , node . end )
248- } else if ( ts . isStringLiteral ( node . name ) ) {
249- const libName = toLibName ( node . name . text )
248+ } else {
249+ let libName = ''
250+ if ( ts . isStringLiteral ( node . name ) ) {
251+ libName = toLibName ( node . name . text )
250252
251- if ( libName !== node . name . text ) {
252- s . update ( node . name . pos , node . name . end , ` '${ libName } '` )
253+ if ( libName !== node . name . text ) {
254+ s . update ( node . name . pos , node . name . end , ` '${ libName } '` )
255+ }
253256 }
254257
255258 if (
256- ! libName . startsWith ( '.' ) &&
259+ ( ! libName || ! libName . startsWith ( '.' ) ) &&
257260 node . modifiers ?. [ 0 ] &&
258261 node . modifiers [ 0 ] . kind === ts . SyntaxKind . DeclareKeyword &&
259262 ! node . body . statements . some (
You can’t perform that action at this time.
0 commit comments