Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions snapshots/input/empty-package-fields/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "",
"version": "1.0.0",
"description": "Example TS/JS project with an empty package name",
"private": true
}
3 changes: 3 additions & 0 deletions snapshots/input/empty-package-fields/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function main(): string {
return ''
}
3 changes: 3 additions & 0 deletions snapshots/input/empty-package-fields/src/version/lib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function lib(): string {
return ''
}
4 changes: 4 additions & 0 deletions snapshots/input/empty-package-fields/src/version/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "empty-version",
"version": ""
}
8 changes: 8 additions & 0 deletions snapshots/output/empty-package-fields/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// language TypeScript
// < definition . 1.0.0 src/`main.ts`/

export function main(): string {
// ^^^^ definition . 1.0.0 src/`main.ts`/main().
return ''
}

8 changes: 8 additions & 0 deletions snapshots/output/empty-package-fields/src/version/lib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// language TypeScript
// < definition empty-version . `lib.ts`/

export function lib(): string {
// ^^^ definition empty-version . `lib.ts`/lib().
return ''
}

6 changes: 5 additions & 1 deletion src/ScipSymbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ export class ScipSymbol {
}

public static package(name: string, version: string): ScipSymbol {
return new ScipSymbol(`scip-typescript npm ${name} ${version} `)
// SCIP spells an empty package field as `.`, because a double space is an
// escaped space.
return new ScipSymbol(
`scip-typescript npm ${name || '.'} ${version || '.'} `
)
}

public static anonymousPackage(): ScipSymbol {
Expand Down