-
Notifications
You must be signed in to change notification settings - Fork 3
/
validator.html
69 lines (53 loc) · 1.97 KB
/
validator.html
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 lang="en">
<head>
<meta charset="utf-8">
<title>Shift Validator</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="css/ribbon.css" rel="stylesheet">
<link href="css/css.css" rel="stylesheet">
</head>
<body>
<div class="ribbon-container right">
<div class="ribbon">
<a href="https://github.com/shapesecurity/shift-validator-js" target="_blank">Fork me on GitHub</a>
</div>
</div>
<div class="container">
<div class="content">
<div class="masthead">
<h3><a href="./index.html" class="muted hub-link">part of the Shift suite</a></h3>
</div>
<div class="jumbotron">
<h1><span class="shift">Shift</span> Validator</h1>
<p class="lead">
determines whether a Shift AST represents an ECMAScript program
</p>
</div>
<hr />
<p>
We call an AST <dfn>valid</dfn> if it represents an ECMAScript
program. The Shift AST format was designed to permit the fewest
possible conforming ASTs that are not valid. For various reasons, it
is impossible to exclude all invalid ASTs. This module distinguishes
valid Shift ASTs from invalid ones.
</p>
<h3>Installation</h3>
<pre><code class="nohighlight">npm install shift-validator</code></pre>
<h3>Usage</h3>
<pre><code class="javascript">import isValid, {Validator} from "shift-validator";
isValid(myAst); // Boolean
Validator.validate(myAst); // [ValidationError]</code></pre>
</div>
<hr />
<div class="footer">
<p>© Shape Security, Inc.</p>
</div>
</div>
</body>
</html>