-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Declaration maps and transparent goto definition using them #22658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ab7cb27
91cc19c
c291828
2b26a27
ec44da5
ffb7f85
589ac28
5584a2d
238ba98
ff158cf
b9f6149
53f72de
29c732e
6070108
0a63553
d8480b2
ca88d5e
2b231d7
fed6132
509e4f3
0c44ba1
c8620e3
5687e10
e64e73d
47e701a
6a467ba
f2c8d3f
bd9cccf
c7a5296
f6e81f2
d0a5e28
943dc12
265cc1a
e34a6bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -458,6 +458,7 @@ namespace ts { | |
| clearScreen?(): void; | ||
| /*@internal*/ setBlocking?(): void; | ||
| base64decode?(input: string): string; | ||
| base64encode?(input: string): string; | ||
| } | ||
|
|
||
| export interface FileWatcher { | ||
|
|
@@ -529,7 +530,10 @@ namespace ts { | |
| _crypto = undefined; | ||
| } | ||
|
|
||
| const Buffer: typeof global.Buffer = require("buffer").Buffer; | ||
| const Buffer: { | ||
| new (input: string, encoding?: string): any; | ||
| from?(input: string, encoding?: string): any; | ||
| } = require("buffer").Buffer; | ||
|
|
||
| const nodeVersion = getNodeMajorVersion(); | ||
| const isNode4OrLater = nodeVersion >= 4; | ||
|
|
@@ -624,8 +628,15 @@ namespace ts { | |
| process.stdout._handle.setBlocking(true); | ||
| } | ||
| }, | ||
| base64decode: input => { | ||
| base64decode: Buffer.from ? input => { | ||
| return Buffer.from(input, "base64").toString("utf8"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } : input => { | ||
| return new Buffer(input, "base64").toString("utf8"); | ||
| }, | ||
| base64encode: Buffer.from ? input => { | ||
| return Buffer.from(input).toString("base64"); | ||
| } : input => { | ||
| return new Buffer(input).toString("base64"); | ||
| } | ||
| }; | ||
| return nodeSystem; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3512,6 +3512,13 @@ namespace ts { | |
| return output; | ||
| } | ||
|
|
||
| export function base64encode(host: { base64encode?(input: string): string }, input: string): string { | ||
| if (host.base64encode) { | ||
| return host.base64encode(input); | ||
| } | ||
| return convertToBase64(input); | ||
| } | ||
|
|
||
| export function base64decode(host: { base64decode?(input: string): string }, input: string): string { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're inconsistent with naming between |
||
| if (host.base64decode) { | ||
| return host.base64decode(input); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also add an optional
sysmember forbase64encode?