Code view:
From the node mapping Minimal Full
A painting is a person's account of this edit as text , recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.
Before
1 function addUser(name, age ) {
2 return {
3 name: name,
4 age: age,
5 createdAt: new Date()
6 };
7 }
8
9 const user = addUser("Alice", 30);
10 console.log(user);
11
After
1 interface User {
2 name: string;
3 age: number;
4 createdAt: Date;
5 }
6
7 function addUser(name: string , age : number ) : User {
8 return {
9 name: name,
10 age: age,
11 createdAt: new Date()
12 };
13 }
14
15 const user: User = addUser("Alice", 30);
16 console.log(user);
17
Before
1 function addUser(name, age) {
2 return {
3 name: name,
4 age: age,
5 createdAt: new Date()
6 };
7 }
8
9 const user = addUser("Alice", 30);
10 console.log(user);
11
After
1 interface User {
2 name: string;
3 age: number;
4 createdAt: Date;
5 }
6
7 function addUser(name: string , age: number ): User {
8 return {
9 name: name,
10 age: age,
11 createdAt: new Date()
12 };
13 }
14
15 const user: User = addUser("Alice", 30);
16 console.log(user);
17
Before
1 function addUser( name , age ) {
2 return {
3 name: name,
4 age: age,
5 createdAt: new Date()
6 };
7 }
8
9 const user = addUser("Alice", 30);
10 console.log(user);
11
After
1 interface User {
2 name: string;
3 age: number;
4 createdAt: Date;
5 }
6
7 function addUser( name : string , age : number ) : User {
8 return {
9 name: name,
10 age: age,
11 createdAt: new Date()
12 };
13 }
14
15 const user: User = addUser("Alice", 30);
16 console.log(user);
17
Before
program function_declaration function "function"
identifier "addUser"
formal_parameters ( "("
required_parameter identifier "name"
, ","
required_parameter identifier "age"
) ")"
statement_block (+28 nodes collapsed)
lexical_declaration const "const"
variable_declarator identifier "user"
= "="
call_expression identifier "addUser"
arguments ( "("
string " "\""
string_fragment "Alice"
" "\""
, ","
number "30"
) ")"
; ";"
expression_statement call_expression member_expression identifier "console"
. "."
property_identifier "log"
arguments ( "("
identifier "user"
) ")"
; ";"
After
program interface_declaration interface "interface"
type_identifier "User"
interface_body { "{"
property_signature property_identifier "name"
type_annotation : ":"
predefined_type string "string"
; ";"
property_signature property_identifier "age"
type_annotation : ":"
predefined_type number "number"
; ";"
property_signature property_identifier "createdAt"
type_annotation : ":"
type_identifier "Date"
; ";"
} "}"
function_declaration function "function"
identifier "addUser"
formal_parameters ( "("
required_parameter identifier "name"
type_annotation : ":"
predefined_type string "string"
, ","
required_parameter identifier "age"
type_annotation : ":"
predefined_type number "number"
) ")"
type_annotation : ":"
type_identifier "User"
statement_block (+28 nodes collapsed)
lexical_declaration const "const"
variable_declarator identifier "user"
type_annotation : ":"
type_identifier "User"
= "="
call_expression identifier "addUser"
arguments ( "("
string " "\""
string_fragment "Alice"
" "\""
, ","
number "30"
) ")"
; ";"
expression_statement call_expression member_expression identifier "console"
. "."
property_identifier "log"
arguments ( "("
identifier "user"
) ")"
; ";"
Keybindings
j / k next / previous visible node (tree panels)
h / l collapse / expand the focused node
g / G jump to first / last visible node
Tab switch focus between Before/After panels
/ search: jump to next node whose text contains a given string
a jump the other panel to this node's mapped counterpart
i hide identical matches, showing only inserted/deleted/updated nodes and their ancestors
v cycle the view: split / code only / tree only
p cycle what the code view renders: the node mapping, then each human painting
r mark this fixture as reviewed, or forget the mark (kept in this browser only)
n open a random fixture not yet marked as reviewed
? toggle this help
Search (plain substring, no regex):