Create new
Bindings
Transitions
Animations
Easing
Component composition
Context API
Special elements
Module context
Debugging
Miscellaneous
App.svelte
rebalance.js
runes
This component is not in runes mode.
To enable runes mode, either start using runes in your code, or add the following to the top of your component:
<svelte:options runes />
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
<script>
import { tweened } from "svelte/motion"
import { rebalance } from "./rebalance";
let value = 300;
let text = 'Visual artists, poets, and musicians are releasing free content online faster than ever before. There is an athleticism to these aesthetic outpourings, with artists taking on the creative act as a way of exercising other muscle groups, bodybuilding a personal brand or self-mythology, a concept or a formal vocabulary. Images, music, and words become drips in a pool of art sweat, puddling online for all to view. The long-derided notion of the “masterpiece” has reached its logical antithesis with the aesthlete: a cultural producer who trumps craft and contemplative brooding with immediacy and rapid production.';
let tw = tweened(1, { duration: 2000 });
setInterval(() => {
tw.set(Math.random())
}, 2500)
$: amt = ~~($tw * (text.length / 4))
$: abbreviated = text.slice(0, amt) + '...';
</script>
<label style="display:flex; align-items: center; gap: 1em">container width
<input type="range" min={50} max={500} bind:value />
</label>
<section>
<h1>
no rebalancing
</h1>
<div
style:--width="{value}px"
class="container"
>
{abbreviated}
</div>
</section>
<section>
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
⌄
⌄
⌄
import 'svelte/internal/disclose-version';
import 'svelte/internal/flags/legacy';
import * as $ from 'svelte/internal/client';
import { tweened } from "svelte/motion";
import { rebalance } from "./rebalance";
var root = $.template(`<label style="display:flex; align-items: center; gap: 1em">container width <input type="range"></label> <section class="svelte-15852zx"><h1>no rebalancing</h1> <div class="container svelte-15852zx"> </div></section> <section class="svelte-15852zx"><h1>with rebalancing</h1> <div class="container svelte-15852zx"><div> </div></div></section>`, 1);
export default function App($$anchor, $$props) {
$.push($$props, false);
const [$$stores, $$cleanup] = $.setup_stores();
const $tw = () => $.store_get(tw, '$tw', $$stores);
const amt = $.mutable_state();
const abbreviated = $.mutable_state();
let value = $.mutable_state(300);
let text = 'Visual artists, poets, and musicians are releasing free content online faster than ever before. There is an athleticism to these aesthetic outpourings, with artists taking on the creative act as a way of exercising other muscle groups, bodybuilding a personal brand or self-mythology, a concept or a formal vocabulary. Images, music, and words become drips in a pool of art sweat, puddling online for all to view. The long-derided notion of the “masterpiece” has reached its logical antithesis with the aesthlete: a cultural producer who trumps craft and contemplative brooding with immediacy and rapid production.';
let tw = tweened(1, { duration: 2000 });
setInterval(
() => {
tw.set(Math.random());
},
2500
);
$.legacy_pre_effect(() => ($tw()), () => {
$.set(amt, ~~($tw() * (text.length / 4)));
});
$.legacy_pre_effect(() => ($.get(amt)), () => {
$.set(abbreviated, text.slice(0, $.get(amt)) + '...');
});
$.legacy_pre_effect_reset();
$.init();
result = svelte.compile(source, {
generate: ,
});99
1
2
3
4
5
6
7
8
9
10
›
section.svelte-15852zx {
height: 180px;
}
.container.svelte-15852zx {
width: var(--width, 200px);
border: 1px solid hsl(217, 10%, 85%);
border-radius: .25rem;
}
Root {
css: StyleSheet {...}
- type: "StyleSheet"
- start: 1418
- end: 1577
- attributes: []
children: [...] (2)
Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 1427
- end: 1434
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 1427
- end: 1434
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
TypeSelector {...}
- type: "TypeSelector"
- name: "section"
- start: 1427
- end: 1434
}
]- start: 1427
- end: 1434
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 1435
- end: 1456
children: [...] (1)
Declaration {...}
- type: "Declaration"
- start: 1439
- end: 1452
- property: "height"
- value: "180px"
}
]
}- start: 1427
- end: 1456
} Rule {...}
- type: "Rule"
prelude: SelectorList {...}
- type: "SelectorList"
- start: 1458
- end: 1468
children: [...] (1)
ComplexSelector {...}
- type: "ComplexSelector"
- start: 1458
- end: 1468
children: [...] (1)
RelativeSelector {...}
- type: "RelativeSelector"
- combinator: null
selectors: [...] (1)
ClassSelector {...}
- type: "ClassSelector"
- name: "container"
- start: 1458
- end: 1468
}
]- start: 1458
- end: 1468
}
]
}
]
}block: Block {...}
- type: "Block"
- start: 1469
- end: 1568
children: [...] (3)
Declaration {...}
- type: "Declaration"
- start: 1473
- end: 1499
- property: "width"
- value: "var(--width, 200px)"
} Declaration {...}
- type: "Declaration"
- start: 1503
- end: 1539
- property: "border"
- value: "1px solid hsl(217, 10%, 85%)"
} Declaration {...}
- type: "Declaration"
- start: 1543
- end: 1564
- property: "border-radius"
- value: ".25rem"
}
]
}- start: 1458
- end: 1568
}
]content: {...}
- start: 1425
- end: 1569
- styles: "\n\tsection {\n\t\theight: 180px;\n\t}\n\t.container {\n\t\twidth: var(--width, 200px);\n\t\tborder: 1px solid hsl(217, 10%, 85%);\n\t\tborder-radius: .25rem;\n\t}\n"
- comment: null
}
}- js: []
- start: 943
- end: 1417
- type: "Root"
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (7)
Text {...}
- type: "Text"
- start: 941
- end: 943
- raw: "\n\n"
- data: "\n\n"
} RegularElement {...}
- type: "RegularElement"
- start: 943
- end: 1080
- name: "label"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 950
- end: 1001
- name: "style"
value: [...] (1)
Text {...}
- start: 957
- end: 1000
- type: "Text"
- raw: "display:flex; align-items: center; gap: 1em"
- data: "display:flex; align-items: center; gap: 1em"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 1002
- end: 1019
- raw: "container width "
- data: "container width "
} RegularElement {...}
- type: "RegularElement"
- start: 1019
- end: 1071
- name: "input"
attributes: [...] (4)
Attribute {...}
- type: "Attribute"
- start: 1026
- end: 1038
- name: "type"
value: [...] (1)
Text {...}
- start: 1032
- end: 1037
- type: "Text"
- raw: "range"
- data: "range"
}
]
} Attribute {...}
- type: "Attribute"
- start: 1039
- end: 1047
- name: "min"
value: ExpressionTag {...}
- type: "ExpressionTag"
- start: 1043
- end: 1047
expression: Literal {...}
- type: "Literal"
- start: 1044
- end: 1046
loc: {...}
start: {...}
- line: 20
- column: 26
}end: {...}
- line: 20
- column: 28
}
}- value: 50
- raw: "50"
}
}
} Attribute {...}
- type: "Attribute"
- start: 1048
- end: 1057
- name: "max"
value: ExpressionTag {...}
- type: "ExpressionTag"
- start: 1052
- end: 1057
expression: Literal {...}
- type: "Literal"
- start: 1053
- end: 1056
loc: {...}
start: {...}
- line: 20
- column: 35
}end: {...}
- line: 20
- column: 38
}
}- value: 500
- raw: "500"
}
}
} BindDirective {...}
- start: 1058
- end: 1068
- type: "BindDirective"
- name: "value"
expression: Identifier {...}
- start: 1063
- end: 1068
- type: "Identifier"
- name: "value"
}- modifiers: []
}
]fragment: Fragment {...}
- type: "Fragment"
- nodes: []
}
} Text {...}
- type: "Text"
- start: 1071
- end: 1072
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 1080
- end: 1082
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 1082
- end: 1212
- name: "section"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: -1
- end: -1
- name: "class"
value: [...] (1)
Text {...}
- type: "Text"
- data: "svelte-15852zx"
- raw: "svelte-15852zx"
- start: -1
- end: -1
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (5)
Text {...}
- type: "Text"
- start: 1091
- end: 1093
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 1093
- end: 1121
- name: "h1"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (1)
Text {...}
- type: "Text"
- start: 1097
- end: 1116
- raw: "no rebalancing"
- data: "no rebalancing"
}
]
}
} Text {...}
- type: "Text"
- start: 1121
- end: 1122
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 1122
- end: 1200
- name: "div"
attributes: [...] (2)
StyleDirective {...}
- start: 1130
- end: 1155
- type: "StyleDirective"
- name: "--width"
- modifiers: []
value: [...] (2)
ExpressionTag {...}
- type: "ExpressionTag"
- start: 1145
- end: 1152
expression: Identifier {...}
- type: "Identifier"
- start: 1146
- end: 1151
loc: {...}
start: {...}
- line: 28
- column: 19
}end: {...}
- line: 28
- column: 24
}
}- name: "value"
}
} Text {...}
- start: 1152
- end: 1154
- type: "Text"
- raw: "px"
- data: "px"
}
]
} Attribute {...}
- type: "Attribute"
- start: 1159
- end: 1176
- name: "class"
value: [...] (1)
Text {...}
- start: 1166
- end: 1175
- type: "Text"
- raw: "container"
- data: "container svelte-15852zx"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 1178
- end: 1180
- raw: "\n\t"
- data: "\n\t"
} ExpressionTag {...}
- type: "ExpressionTag"
- start: 1180
- end: 1193
expression: Identifier {...}
- type: "Identifier"
- start: 1181
- end: 1192
loc: {...}
start: {...}
- line: 31
- column: 2
}end: {...}
- line: 31
- column: 13
}
}- name: "abbreviated"
}
} Text {...}
- type: "Text"
- start: 1193
- end: 1194
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 1200
- end: 1202
- raw: "\n\t"
- data: "\n\t"
}
]
}
} Text {...}
- type: "Text"
- start: 1212
- end: 1215
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 1215
- end: 1417
- name: "section"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: -1
- end: -1
- name: "class"
value: [...] (1)
Text {...}
- type: "Text"
- data: "svelte-15852zx"
- raw: "svelte-15852zx"
- start: -1
- end: -1
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (5)
Text {...}
- type: "Text"
- start: 1224
- end: 1226
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 1226
- end: 1257
- name: "h1"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (1)
Text {...}
- type: "Text"
- start: 1230
- end: 1252
- raw: "with rebalancing"
- data: "with rebalancing"
}
]
}
} Text {...}
- type: "Text"
- start: 1257
- end: 1258
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 1258
- end: 1406
- name: "div"
attributes: [...] (2)
Attribute {...}
- type: "Attribute"
- start: 1267
- end: 1284
- name: "class"
value: [...] (1)
Text {...}
- start: 1274
- end: 1283
- type: "Text"
- raw: "container"
- data: "container svelte-15852zx"
}
]
} StyleDirective {...}
- start: 1288
- end: 1313
- type: "StyleDirective"
- name: "--width"
- modifiers: []
value: [...] (2)
ExpressionTag {...}
- type: "ExpressionTag"
- start: 1303
- end: 1310
expression: Identifier {...}
- type: "Identifier"
- start: 1304
- end: 1309
loc: {...}
start: {...}
- line: 42
- column: 19
}end: {...}
- line: 42
- column: 24
}
}- name: "value"
}
} Text {...}
- start: 1310
- end: 1312
- type: "Text"
- raw: "px"
- data: "px"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 1315
- end: 1317
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 1317
- end: 1399
- name: "div"
attributes: [...] (3)
UseDirective {...}
- start: 1322
- end: 1335
- type: "UseDirective"
- name: "rebalance"
- expression: null
- modifiers: []
} StyleDirective {...}
- start: 1336
- end: 1356
- type: "StyleDirective"
- name: "padding"
- modifiers: []
value: [...] (1)
Text {...}
- start: 1351
- end: 1355
- type: "Text"
- raw: "1rem"
- data: "1rem"
}
]
} StyleDirective {...}
- start: 1357
- end: 1374
- type: "StyleDirective"
- name: "margin"
- modifiers: []
value: [...] (1)
Text {...}
- start: 1370
- end: 1374
- type: "Text"
- raw: "auto"
- data: "auto"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 1375
- end: 1378
- raw: "\n\t\t"
- data: "\n\t\t"
} ExpressionTag {...}
- type: "ExpressionTag"
- start: 1378
- end: 1391
expression: Identifier {...}
- type: "Identifier"
- start: 1379
- end: 1390
loc: {...}
start: {...}
- line: 45
- column: 3
}end: {...}
- line: 45
- column: 14
}
}- name: "abbreviated"
}
} Text {...}
- type: "Text"
- start: 1391
- end: 1393
- raw: "\n\t"
- data: "\n\t"
}
]
}
} Text {...}
- type: "Text"
- start: 1399
- end: 1400
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 1406
- end: 1407
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 1417
- end: 1418
- raw: "\n"
- data: "\n"
}
]
}- options: null
instance: Script {...}
- type: "Script"
- start: 0
- end: 941
- context: "default"
content: Program {...}
- type: "Program"
- start: 8
- end: 932
loc: {...}
start: {...}
- line: 1
- column: 0
}end: {...}
- line: 17
- column: 0
}
}body: [...] (8)
ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 10
- end: 49
loc: {...}
start: {...}
- line: 2
- column: 1
}end: {...}
- line: 2
- column: 40
}
}specifiers: [...] (1)
ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 19
- end: 26
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 17
}
}imported: Identifier {...}
- type: "Identifier"
- start: 19
- end: 26
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 17
}
}- name: "tweened"
}local: Identifier {...}
- type: "Identifier"
- start: 19
- end: 26
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 17
}
}- name: "tweened"
}
}
]source: Literal {...}
- type: "Literal"
- start: 34
- end: 49
loc: {...}
start: {...}
- line: 2
- column: 25
}end: {...}
- line: 2
- column: 40
}
}- value: "svelte/motion"
- raw: "\"svelte/motion\""
}
} ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 51
- end: 91
loc: {...}
start: {...}
- line: 3
- column: 1
}end: {...}
- line: 3
- column: 41
}
}specifiers: [...] (1)
ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 60
- end: 69
loc: {...}
start: {...}
- line: 3
- column: 10
}end: {...}
- line: 3
- column: 19
}
}imported: Identifier {...}
- type: "Identifier"
- start: 60
- end: 69
loc: {...}
start: {...}
- line: 3
- column: 10
}end: {...}
- line: 3
- column: 19
}
}- name: "rebalance"
}local: Identifier {...}
- type: "Identifier"
- start: 60
- end: 69
loc: {...}
start: {...}
- line: 3
- column: 10
}end: {...}
- line: 3
- column: 19
}
}- name: "rebalance"
}
}
]source: Literal {...}
- type: "Literal"
- start: 77
- end: 90
loc: {...}
start: {...}
- line: 3
- column: 27
}end: {...}
- line: 3
- column: 40
}
}- value: "./rebalance"
- raw: "\"./rebalance\""
}
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 93
- end: 109
loc: {...}
start: {...}
- line: 4
- column: 1
}end: {...}
- line: 4
- column: 17
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 97
- end: 108
loc: {...}
start: {...}
- line: 4
- column: 5
}end: {...}
- line: 4
- column: 16
}
}id: Identifier {...}
- type: "Identifier"
- start: 97
- end: 102
loc: {...}
start: {...}
- line: 4
- column: 5
}end: {...}
- line: 4
- column: 10
}
}- name: "value"
}init: Literal {...}
- type: "Literal"
- start: 105
- end: 108
loc: {...}
start: {...}
- line: 4
- column: 13
}end: {...}
- line: 4
- column: 16
}
}- value: 300
- raw: "300"
}
}
]- kind: "let"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 111
- end: 739
loc: {...}
start: {...}
- line: 5
- column: 1
}end: {...}
- line: 5
- column: 629
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 115
- end: 738
loc: {...}
start: {...}
- line: 5
- column: 5
}end: {...}
- line: 5
- column: 628
}
}id: Identifier {...}
- type: "Identifier"
- start: 115
- end: 119
loc: {...}
start: {...}
- line: 5
- column: 5
}end: {...}
- line: 5
- column: 9
}
}- name: "text"
}init: Literal {...}
- type: "Literal"
- start: 122
- end: 738
loc: {...}
start: {...}
- line: 5
- column: 12
}end: {...}
- line: 5
- column: 628
}
}- value: "Visual artists, poets, and musicians are releasing free content online faster than ever before. There is an athleticism to these aesthetic outpourings, with artists taking on the creative act as a way of exercising other muscle groups, bodybuilding a personal brand or self-mythology, a concept or a formal vocabulary. Images, music, and words become drips in a pool of art sweat, puddling online for all to view. The long-derided notion of the “masterpiece” has reached its logical antithesis with the aesthlete: a cultural producer who trumps craft and contemplative brooding with immediacy and rapid production."
- raw: "'Visual artists, poets, and musicians are releasing free content online faster than ever before. There is an athleticism to these aesthetic outpourings, with artists taking on the creative act as a way of exercising other muscle groups, bodybuilding a personal brand or self-mythology, a concept or a formal vocabulary. Images, music, and words become drips in a pool of art sweat, puddling online for all to view. The long-derided notion of the “masterpiece” has reached its logical antithesis with the aesthlete: a cultural producer who trumps craft and contemplative brooding with immediacy and rapid production.'"
}
}
]- kind: "let"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 743
- end: 783
loc: {...}
start: {...}
- line: 7
- column: 1
}end: {...}
- line: 7
- column: 41
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 747
- end: 782
loc: {...}
start: {...}
- line: 7
- column: 5
}end: {...}
- line: 7
- column: 40
}
}id: Identifier {...}
- type: "Identifier"
- start: 747
- end: 749
loc: {...}
start: {...}
- line: 7
- column: 5
}end: {...}
- line: 7
- column: 7
}
}- name: "tw"
}init: CallExpression {...}
- type: "CallExpression"
- start: 752
- end: 782
loc: {...}
start: {...}
- line: 7
- column: 10
}end: {...}
- line: 7
- column: 40
}
}callee: Identifier {...}
- type: "Identifier"
- start: 752
- end: 759
loc: {...}
start: {...}
- line: 7
- column: 10
}end: {...}
- line: 7
- column: 17
}
}- name: "tweened"
}arguments: [...] (2)
Literal {...}
- type: "Literal"
- start: 760
- end: 761
loc: {...}
start: {...}
- line: 7
- column: 18
}end: {...}
- line: 7
- column: 19
}
}- value: 1
- raw: "1"
} ObjectExpression {...}
- type: "ObjectExpression"
- start: 763
- end: 781
loc: {...}
start: {...}
- line: 7
- column: 21
}end: {...}
- line: 7
- column: 39
}
}properties: [...] (1)
Property {...}
- type: "Property"
- start: 765
- end: 779
loc: {...}
start: {...}
- line: 7
- column: 23
}end: {...}
- line: 7
- column: 37
}
}- method: false
- shorthand: false
- computed: false
key: Identifier {...}
- type: "Identifier"
- start: 765
- end: 773
loc: {...}
start: {...}
- line: 7
- column: 23
}end: {...}
- line: 7
- column: 31
}
}- name: "duration"
}value: Literal {...}
- type: "Literal"
- start: 775
- end: 779
loc: {...}
start: {...}
- line: 7
- column: 33
}end: {...}
- line: 7
- column: 37
}
}- value: 2000
- raw: "2000"
}- kind: "init"
}
]
}
]- optional: false
}
}
]- kind: "let"
} ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 787
- end: 841
loc: {...}
start: {...}
- line: 9
- column: 1
}end: {...}
- line: 11
- column: 9
}
}expression: CallExpression {...}
- type: "CallExpression"
- start: 787
- end: 841
loc: {...}
start: {...}
- line: 9
- column: 1
}end: {...}
- line: 11
- column: 9
}
}callee: Identifier {...}
- type: "Identifier"
- start: 787
- end: 798
loc: {...}
start: {...}
- line: 9
- column: 1
}end: {...}
- line: 9
- column: 12
}
}- name: "setInterval"
}arguments: [...] (2)
ArrowFunctionExpression {...}
- type: "ArrowFunctionExpression"
- start: 799
- end: 834
loc: {...}
start: {...}
- line: 9
- column: 13
}end: {...}
- line: 11
- column: 2
}
}- id: null
- expression: false
- generator: false
- async: false
- params: []
body: BlockStatement {...}
- type: "BlockStatement"
- start: 805
- end: 834
loc: {...}
start: {...}
- line: 9
- column: 19
}end: {...}
- line: 11
- column: 2
}
}body: [...] (1)
ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 810
- end: 831
loc: {...}
start: {...}
- line: 10
- column: 3
}end: {...}
- line: 10
- column: 24
}
}expression: CallExpression {...}
- type: "CallExpression"
- start: 810
- end: 831
loc: {...}
start: {...}
- line: 10
- column: 3
}end: {...}
- line: 10
- column: 24
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 810
- end: 816
loc: {...}
start: {...}
- line: 10
- column: 3
}end: {...}
- line: 10
- column: 9
}
}object: Identifier {...}
- type: "Identifier"
- start: 810
- end: 812
loc: {...}
start: {...}
- line: 10
- column: 3
}end: {...}
- line: 10
- column: 5
}
}- name: "tw"
}property: Identifier {...}
- type: "Identifier"
- start: 813
- end: 816
loc: {...}
start: {...}
- line: 10
- column: 6
}end: {...}
- line: 10
- column: 9
}
}- name: "set"
}- computed: false
- optional: false
}arguments: [...] (1)
CallExpression {...}
- type: "CallExpression"
- start: 817
- end: 830
loc: {...}
start: {...}
- line: 10
- column: 10
}end: {...}
- line: 10
- column: 23
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 817
- end: 828
loc: {...}
start: {...}
- line: 10
- column: 10
}end: {...}
- line: 10
- column: 21
}
}object: Identifier {...}
- type: "Identifier"
- start: 817
- end: 821
loc: {...}
start: {...}
- line: 10
- column: 10
}end: {...}
- line: 10
- column: 14
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 822
- end: 828
loc: {...}
start: {...}
- line: 10
- column: 15
}end: {...}
- line: 10
- column: 21
}
}- name: "random"
}- computed: false
- optional: false
}- arguments: []
- optional: false
}
]- optional: false
}
}
]
}
} Literal {...}
- type: "Literal"
- start: 836
- end: 840
loc: {...}
start: {...}
- line: 11
- column: 4
}end: {...}
- line: 11
- column: 8
}
}- value: 2500
- raw: "2500"
}
]- optional: false
}
} LabeledStatement {...}
- type: "LabeledStatement"
- start: 846
- end: 882
loc: {...}
start: {...}
- line: 13
- column: 2
}end: {...}
- line: 13
- column: 38
}
}body: ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 849
- end: 882
loc: {...}
start: {...}
- line: 13
- column: 5
}end: {...}
- line: 13
- column: 38
}
}expression: AssignmentExpression {...}
- type: "AssignmentExpression"
- start: 849
- end: 882
loc: {...}
start: {...}
- line: 13
- column: 5
}end: {...}
- line: 13
- column: 38
}
}- operator: "="
left: Identifier {...}
- type: "Identifier"
- start: 849
- end: 852
loc: {...}
start: {...}
- line: 13
- column: 5
}end: {...}
- line: 13
- column: 8
}
}- name: "amt"
}right: UnaryExpression {...}
- type: "UnaryExpression"
- start: 855
- end: 882
loc: {...}
start: {...}
- line: 13
- column: 11
}end: {...}
- line: 13
- column: 38
}
}- operator: "~"
- prefix: true
argument: UnaryExpression {...}
- type: "UnaryExpression"
- start: 856
- end: 882
loc: {...}
start: {...}
- line: 13
- column: 12
}end: {...}
- line: 13
- column: 38
}
}- operator: "~"
- prefix: true
argument: BinaryExpression {...}
- type: "BinaryExpression"
- start: 858
- end: 881
loc: {...}
start: {...}
- line: 13
- column: 14
}end: {...}
- line: 13
- column: 37
}
}left: Identifier {...}
- type: "Identifier"
- start: 858
- end: 861
loc: {...}
start: {...}
- line: 13
- column: 14
}end: {...}
- line: 13
- column: 17
}
}- name: "$tw"
}- operator: "*"
right: BinaryExpression {...}
- type: "BinaryExpression"
- start: 865
- end: 880
loc: {...}
start: {...}
- line: 13
- column: 21
}end: {...}
- line: 13
- column: 36
}
}left: MemberExpression {...}
- type: "MemberExpression"
- start: 865
- end: 876
loc: {...}
start: {...}
- line: 13
- column: 21
}end: {...}
- line: 13
- column: 32
}
}object: Identifier {...}
- type: "Identifier"
- start: 865
- end: 869
loc: {...}
start: {...}
- line: 13
- column: 21
}end: {...}
- line: 13
- column: 25
}
}- name: "text"
}property: Identifier {...}
- type: "Identifier"
- start: 870
- end: 876
loc: {...}
start: {...}
- line: 13
- column: 26
}end: {...}
- line: 13
- column: 32
}
}- name: "length"
}- computed: false
- optional: false
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 879
- end: 880
loc: {...}
start: {...}
- line: 13
- column: 35
}end: {...}
- line: 13
- column: 36
}
}- value: 4
- raw: "4"
}
}
}
}
}
}
}label: Identifier {...}
- type: "Identifier"
- start: 846
- end: 847
loc: {...}
start: {...}
- line: 13
- column: 2
}end: {...}
- line: 13
- column: 3
}
}- name: "$"
}
} LabeledStatement {...}
- type: "LabeledStatement"
- start: 887
- end: 931
loc: {...}
start: {...}
- line: 16
- column: 1
}end: {...}
- line: 16
- column: 45
}
}body: ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 890
- end: 931
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 45
}
}expression: AssignmentExpression {...}
- type: "AssignmentExpression"
- start: 890
- end: 930
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 44
}
}- operator: "="
left: Identifier {...}
- type: "Identifier"
- start: 890
- end: 901
loc: {...}
start: {...}
- line: 16
- column: 4
}end: {...}
- line: 16
- column: 15
}
}- name: "abbreviated"
}right: BinaryExpression {...}
- type: "BinaryExpression"
- start: 904
- end: 930
loc: {...}
start: {...}
- line: 16
- column: 18
}end: {...}
- line: 16
- column: 44
}
}left: CallExpression {...}
- type: "CallExpression"
- start: 904
- end: 922
loc: {...}
start: {...}
- line: 16
- column: 18
}end: {...}
- line: 16
- column: 36
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 904
- end: 914
loc: {...}
start: {...}
- line: 16
- column: 18
}end: {...}
- line: 16
- column: 28
}
}object: Identifier {...}
- type: "Identifier"
- start: 904
- end: 908
loc: {...}
start: {...}
- line: 16
- column: 18
}end: {...}
- line: 16
- column: 22
}
}- name: "text"
}property: Identifier {...}
- type: "Identifier"
- start: 909
- end: 914
loc: {...}
start: {...}
- line: 16
- column: 23
}end: {...}
- line: 16
- column: 28
}
}- name: "slice"
}- computed: false
- optional: false
}arguments: [...] (2)
Literal {...}
- type: "Literal"
- start: 915
- end: 916
loc: {...}
start: {...}
- line: 16
- column: 29
}end: {...}
- line: 16
- column: 30
}
}- value: 0
- raw: "0"
} Identifier {...}
- type: "Identifier"
- start: 918
- end: 921
loc: {...}
start: {...}
- line: 16
- column: 32
}end: {...}
- line: 16
- column: 35
}
}- name: "amt"
}
]- optional: false
}- operator: "+"
right: Literal {...}
- type: "Literal"
- start: 925
- end: 930
loc: {...}
start: {...}
- line: 16
- column: 39
}end: {...}
- line: 16
- column: 44
}
}- value: "..."
- raw: "'...'"
}
}
}
}label: Identifier {...}
- type: "Identifier"
- start: 887
- end: 888
loc: {...}
start: {...}
- line: 16
- column: 1
}end: {...}
- line: 16
- column: 2
}
}- name: "$"
}
}
]- sourceType: "module"
}- attributes: []
}
}
The AST is not public API and may change at any point in time