-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update build script and refactor code for ES module compatibility
- Loading branch information
1 parent
55c330d
commit ab67c0a
Showing
4 changed files
with
16 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { greet } from './lib/greeter' | ||
import { Person } from './types' | ||
import { Person } from './types.js'; | ||
import { greet } from './lib/greeter.js'; | ||
|
||
const person: Person = { | ||
firstName: 'Jane', | ||
lastName: 'Doe', | ||
} | ||
firstName: 'John', | ||
lastName: 'Doe' | ||
}; | ||
|
||
console.log(greet(`${person.firstName} ${person.lastName}`)) | ||
console.log(greet(person)); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export function greet(name: string): string { | ||
return `Hello, ${name}!` | ||
import { Person } from '../types.js'; | ||
|
||
export function greet(person: Person): string { | ||
return `Hello ${person.firstName} ${person.lastName}!`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters