-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjason.html
More file actions
69 lines (66 loc) · 1.77 KB
/
jason.html
File metadata and controls
69 lines (66 loc) · 1.77 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta charset="utf-8">
<title>JASON</title>
<style>body{font-size: 12px;background:linen;}code,pre{margin:0;padding:0;}
body>pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space: -o-pre-wrap;word-wrap:break-word;}
table{vertical-align: top;}
td{vertical-align: top;}
</style>
</head>
<body>
<h1>JASON vs ES5 vs ES6</h1>
<pre>JASON = (x)=>{
x = x.raw[0].split('\\`').join('`').split('\\{').join('{');
if(x[x.length-1] == '\\\\'){
x.slice(0,1);
}
return x;
}
- multiline strings convert to JASON
- strings with 3+ escaped characters
</pre>
<p>JASON is a template function that 100% valid JavaScript. There are 2 functions JASON.parse & JASON.stringify to convert to and from JASON. json is JSON with one expection you must escape values like ${ so $\{ in both strings and template strings. And that is the only difference.</p>
<table style="width:100%" border="1">
<tbody>
<tr>
<td width="33%">
<pre>JASON</pre>
</td>
<td width="33%">ES5</td>
<td width="33%">ES6</td>
</tr>
<tr>
<td>
<pre>{"batick":JASON`
paste in blocks of code
in any way you want
`,"b":`JASON`1\
2`\
3`
"desktop":JASON`C:\Users\a\Desktop\\`}</pre>
</td>
<td>
<pre>{"backtick":"\
paste in blocks of code\
in any way you want
","b":"1\
2`\
3",
"desktop":"C:\\Users\\a\\Desktop\\"}</pre>
</td>
<td width="25%"><pre>{backtick:`
paste in blocks of code
in any way you want
`,
"desktop":String.raw`C:\Users\a\Desktop${'\\'}`}</pre>
</td>
</tr>
</tbody>
</table>
<pre>
</pre>
</body>
</html>