Showing
1000 changed files
with
0 additions
and
4834 deletions
Too many changes to show.
To preserve performance only 1000 of 1000+ files are displayed.
node_modules/.bin/mime
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
3 | - | ||
4 | -case `uname` in | ||
5 | - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; | ||
6 | -esac | ||
7 | - | ||
8 | -if [ -x "$basedir/node" ]; then | ||
9 | - "$basedir/node" "$basedir/../mime/cli.js" "$@" | ||
10 | - ret=$? | ||
11 | -else | ||
12 | - node "$basedir/../mime/cli.js" "$@" | ||
13 | - ret=$? | ||
14 | -fi | ||
15 | -exit $ret |
node_modules/.bin/mime.cmd
deleted
100644 → 0
node_modules/.bin/sshpk-conv
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
3 | - | ||
4 | -case `uname` in | ||
5 | - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; | ||
6 | -esac | ||
7 | - | ||
8 | -if [ -x "$basedir/node" ]; then | ||
9 | - "$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@" | ||
10 | - ret=$? | ||
11 | -else | ||
12 | - node "$basedir/../sshpk/bin/sshpk-conv" "$@" | ||
13 | - ret=$? | ||
14 | -fi | ||
15 | -exit $ret |
node_modules/.bin/sshpk-conv.cmd
deleted
100644 → 0
node_modules/.bin/sshpk-sign
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
3 | - | ||
4 | -case `uname` in | ||
5 | - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; | ||
6 | -esac | ||
7 | - | ||
8 | -if [ -x "$basedir/node" ]; then | ||
9 | - "$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@" | ||
10 | - ret=$? | ||
11 | -else | ||
12 | - node "$basedir/../sshpk/bin/sshpk-sign" "$@" | ||
13 | - ret=$? | ||
14 | -fi | ||
15 | -exit $ret |
node_modules/.bin/sshpk-sign.cmd
deleted
100644 → 0
node_modules/.bin/sshpk-verify
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
3 | - | ||
4 | -case `uname` in | ||
5 | - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; | ||
6 | -esac | ||
7 | - | ||
8 | -if [ -x "$basedir/node" ]; then | ||
9 | - "$basedir/node" "$basedir/../sshpk/bin/sshpk-verify" "$@" | ||
10 | - ret=$? | ||
11 | -else | ||
12 | - node "$basedir/../sshpk/bin/sshpk-verify" "$@" | ||
13 | - ret=$? | ||
14 | -fi | ||
15 | -exit $ret |
node_modules/.bin/sshpk-verify.cmd
deleted
100644 → 0
node_modules/.bin/uuid
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
3 | - | ||
4 | -case `uname` in | ||
5 | - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; | ||
6 | -esac | ||
7 | - | ||
8 | -if [ -x "$basedir/node" ]; then | ||
9 | - "$basedir/node" "$basedir/../uuid/bin/uuid" "$@" | ||
10 | - ret=$? | ||
11 | -else | ||
12 | - node "$basedir/../uuid/bin/uuid" "$@" | ||
13 | - ret=$? | ||
14 | -fi | ||
15 | -exit $ret |
node_modules/.bin/uuid.cmd
deleted
100644 → 0
node_modules/accepts/HISTORY.md
deleted
100644 → 0
1 | -1.3.4 / 2017-08-22 | ||
2 | -================== | ||
3 | - | ||
4 | - * deps: mime-types@~2.1.16 | ||
5 | - - deps: mime-db@~1.29.0 | ||
6 | - | ||
7 | -1.3.3 / 2016-05-02 | ||
8 | -================== | ||
9 | - | ||
10 | - * deps: mime-types@~2.1.11 | ||
11 | - - deps: mime-db@~1.23.0 | ||
12 | - * deps: negotiator@0.6.1 | ||
13 | - - perf: improve `Accept` parsing speed | ||
14 | - - perf: improve `Accept-Charset` parsing speed | ||
15 | - - perf: improve `Accept-Encoding` parsing speed | ||
16 | - - perf: improve `Accept-Language` parsing speed | ||
17 | - | ||
18 | -1.3.2 / 2016-03-08 | ||
19 | -================== | ||
20 | - | ||
21 | - * deps: mime-types@~2.1.10 | ||
22 | - - Fix extension of `application/dash+xml` | ||
23 | - - Update primary extension for `audio/mp4` | ||
24 | - - deps: mime-db@~1.22.0 | ||
25 | - | ||
26 | -1.3.1 / 2016-01-19 | ||
27 | -================== | ||
28 | - | ||
29 | - * deps: mime-types@~2.1.9 | ||
30 | - - deps: mime-db@~1.21.0 | ||
31 | - | ||
32 | -1.3.0 / 2015-09-29 | ||
33 | -================== | ||
34 | - | ||
35 | - * deps: mime-types@~2.1.7 | ||
36 | - - deps: mime-db@~1.19.0 | ||
37 | - * deps: negotiator@0.6.0 | ||
38 | - - Fix including type extensions in parameters in `Accept` parsing | ||
39 | - - Fix parsing `Accept` parameters with quoted equals | ||
40 | - - Fix parsing `Accept` parameters with quoted semicolons | ||
41 | - - Lazy-load modules from main entry point | ||
42 | - - perf: delay type concatenation until needed | ||
43 | - - perf: enable strict mode | ||
44 | - - perf: hoist regular expressions | ||
45 | - - perf: remove closures getting spec properties | ||
46 | - - perf: remove a closure from media type parsing | ||
47 | - - perf: remove property delete from media type parsing | ||
48 | - | ||
49 | -1.2.13 / 2015-09-06 | ||
50 | -=================== | ||
51 | - | ||
52 | - * deps: mime-types@~2.1.6 | ||
53 | - - deps: mime-db@~1.18.0 | ||
54 | - | ||
55 | -1.2.12 / 2015-07-30 | ||
56 | -=================== | ||
57 | - | ||
58 | - * deps: mime-types@~2.1.4 | ||
59 | - - deps: mime-db@~1.16.0 | ||
60 | - | ||
61 | -1.2.11 / 2015-07-16 | ||
62 | -=================== | ||
63 | - | ||
64 | - * deps: mime-types@~2.1.3 | ||
65 | - - deps: mime-db@~1.15.0 | ||
66 | - | ||
67 | -1.2.10 / 2015-07-01 | ||
68 | -=================== | ||
69 | - | ||
70 | - * deps: mime-types@~2.1.2 | ||
71 | - - deps: mime-db@~1.14.0 | ||
72 | - | ||
73 | -1.2.9 / 2015-06-08 | ||
74 | -================== | ||
75 | - | ||
76 | - * deps: mime-types@~2.1.1 | ||
77 | - - perf: fix deopt during mapping | ||
78 | - | ||
79 | -1.2.8 / 2015-06-07 | ||
80 | -================== | ||
81 | - | ||
82 | - * deps: mime-types@~2.1.0 | ||
83 | - - deps: mime-db@~1.13.0 | ||
84 | - * perf: avoid argument reassignment & argument slice | ||
85 | - * perf: avoid negotiator recursive construction | ||
86 | - * perf: enable strict mode | ||
87 | - * perf: remove unnecessary bitwise operator | ||
88 | - | ||
89 | -1.2.7 / 2015-05-10 | ||
90 | -================== | ||
91 | - | ||
92 | - * deps: negotiator@0.5.3 | ||
93 | - - Fix media type parameter matching to be case-insensitive | ||
94 | - | ||
95 | -1.2.6 / 2015-05-07 | ||
96 | -================== | ||
97 | - | ||
98 | - * deps: mime-types@~2.0.11 | ||
99 | - - deps: mime-db@~1.9.1 | ||
100 | - * deps: negotiator@0.5.2 | ||
101 | - - Fix comparing media types with quoted values | ||
102 | - - Fix splitting media types with quoted commas | ||
103 | - | ||
104 | -1.2.5 / 2015-03-13 | ||
105 | -================== | ||
106 | - | ||
107 | - * deps: mime-types@~2.0.10 | ||
108 | - - deps: mime-db@~1.8.0 | ||
109 | - | ||
110 | -1.2.4 / 2015-02-14 | ||
111 | -================== | ||
112 | - | ||
113 | - * Support Node.js 0.6 | ||
114 | - * deps: mime-types@~2.0.9 | ||
115 | - - deps: mime-db@~1.7.0 | ||
116 | - * deps: negotiator@0.5.1 | ||
117 | - - Fix preference sorting to be stable for long acceptable lists | ||
118 | - | ||
119 | -1.2.3 / 2015-01-31 | ||
120 | -================== | ||
121 | - | ||
122 | - * deps: mime-types@~2.0.8 | ||
123 | - - deps: mime-db@~1.6.0 | ||
124 | - | ||
125 | -1.2.2 / 2014-12-30 | ||
126 | -================== | ||
127 | - | ||
128 | - * deps: mime-types@~2.0.7 | ||
129 | - - deps: mime-db@~1.5.0 | ||
130 | - | ||
131 | -1.2.1 / 2014-12-30 | ||
132 | -================== | ||
133 | - | ||
134 | - * deps: mime-types@~2.0.5 | ||
135 | - - deps: mime-db@~1.3.1 | ||
136 | - | ||
137 | -1.2.0 / 2014-12-19 | ||
138 | -================== | ||
139 | - | ||
140 | - * deps: negotiator@0.5.0 | ||
141 | - - Fix list return order when large accepted list | ||
142 | - - Fix missing identity encoding when q=0 exists | ||
143 | - - Remove dynamic building of Negotiator class | ||
144 | - | ||
145 | -1.1.4 / 2014-12-10 | ||
146 | -================== | ||
147 | - | ||
148 | - * deps: mime-types@~2.0.4 | ||
149 | - - deps: mime-db@~1.3.0 | ||
150 | - | ||
151 | -1.1.3 / 2014-11-09 | ||
152 | -================== | ||
153 | - | ||
154 | - * deps: mime-types@~2.0.3 | ||
155 | - - deps: mime-db@~1.2.0 | ||
156 | - | ||
157 | -1.1.2 / 2014-10-14 | ||
158 | -================== | ||
159 | - | ||
160 | - * deps: negotiator@0.4.9 | ||
161 | - - Fix error when media type has invalid parameter | ||
162 | - | ||
163 | -1.1.1 / 2014-09-28 | ||
164 | -================== | ||
165 | - | ||
166 | - * deps: mime-types@~2.0.2 | ||
167 | - - deps: mime-db@~1.1.0 | ||
168 | - * deps: negotiator@0.4.8 | ||
169 | - - Fix all negotiations to be case-insensitive | ||
170 | - - Stable sort preferences of same quality according to client order | ||
171 | - | ||
172 | -1.1.0 / 2014-09-02 | ||
173 | -================== | ||
174 | - | ||
175 | - * update `mime-types` | ||
176 | - | ||
177 | -1.0.7 / 2014-07-04 | ||
178 | -================== | ||
179 | - | ||
180 | - * Fix wrong type returned from `type` when match after unknown extension | ||
181 | - | ||
182 | -1.0.6 / 2014-06-24 | ||
183 | -================== | ||
184 | - | ||
185 | - * deps: negotiator@0.4.7 | ||
186 | - | ||
187 | -1.0.5 / 2014-06-20 | ||
188 | -================== | ||
189 | - | ||
190 | - * fix crash when unknown extension given | ||
191 | - | ||
192 | -1.0.4 / 2014-06-19 | ||
193 | -================== | ||
194 | - | ||
195 | - * use `mime-types` | ||
196 | - | ||
197 | -1.0.3 / 2014-06-11 | ||
198 | -================== | ||
199 | - | ||
200 | - * deps: negotiator@0.4.6 | ||
201 | - - Order by specificity when quality is the same | ||
202 | - | ||
203 | -1.0.2 / 2014-05-29 | ||
204 | -================== | ||
205 | - | ||
206 | - * Fix interpretation when header not in request | ||
207 | - * deps: pin negotiator@0.4.5 | ||
208 | - | ||
209 | -1.0.1 / 2014-01-18 | ||
210 | -================== | ||
211 | - | ||
212 | - * Identity encoding isn't always acceptable | ||
213 | - * deps: negotiator@~0.4.0 | ||
214 | - | ||
215 | -1.0.0 / 2013-12-27 | ||
216 | -================== | ||
217 | - | ||
218 | - * Genesis |
node_modules/accepts/LICENSE
deleted
100644 → 0
1 | -(The MIT License) | ||
2 | - | ||
3 | -Copyright (c) 2014 Jonathan Ong <me@jongleberry.com> | ||
4 | -Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com> | ||
5 | - | ||
6 | -Permission is hereby granted, free of charge, to any person obtaining | ||
7 | -a copy of this software and associated documentation files (the | ||
8 | -'Software'), to deal in the Software without restriction, including | ||
9 | -without limitation the rights to use, copy, modify, merge, publish, | ||
10 | -distribute, sublicense, and/or sell copies of the Software, and to | ||
11 | -permit persons to whom the Software is furnished to do so, subject to | ||
12 | -the following conditions: | ||
13 | - | ||
14 | -The above copyright notice and this permission notice shall be | ||
15 | -included in all copies or substantial portions of the Software. | ||
16 | - | ||
17 | -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, | ||
18 | -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
19 | -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
20 | -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
21 | -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
22 | -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
23 | -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
node_modules/accepts/README.md
deleted
100644 → 0
1 | -# accepts | ||
2 | - | ||
3 | -[![NPM Version][npm-image]][npm-url] | ||
4 | -[![NPM Downloads][downloads-image]][downloads-url] | ||
5 | -[![Node.js Version][node-version-image]][node-version-url] | ||
6 | -[![Build Status][travis-image]][travis-url] | ||
7 | -[![Test Coverage][coveralls-image]][coveralls-url] | ||
8 | - | ||
9 | -Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). | ||
10 | -Extracted from [koa](https://www.npmjs.com/package/koa) for general use. | ||
11 | - | ||
12 | -In addition to negotiator, it allows: | ||
13 | - | ||
14 | -- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` | ||
15 | - as well as `('text/html', 'application/json')`. | ||
16 | -- Allows type shorthands such as `json`. | ||
17 | -- Returns `false` when no types match | ||
18 | -- Treats non-existent headers as `*` | ||
19 | - | ||
20 | -## Installation | ||
21 | - | ||
22 | -This is a [Node.js](https://nodejs.org/en/) module available through the | ||
23 | -[npm registry](https://www.npmjs.com/). Installation is done using the | ||
24 | -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): | ||
25 | - | ||
26 | -```sh | ||
27 | -$ npm install accepts | ||
28 | -``` | ||
29 | - | ||
30 | -## API | ||
31 | - | ||
32 | -<!-- eslint-disable no-unused-vars --> | ||
33 | - | ||
34 | -```js | ||
35 | -var accepts = require('accepts') | ||
36 | -``` | ||
37 | - | ||
38 | -### accepts(req) | ||
39 | - | ||
40 | -Create a new `Accepts` object for the given `req`. | ||
41 | - | ||
42 | -#### .charset(charsets) | ||
43 | - | ||
44 | -Return the first accepted charset. If nothing in `charsets` is accepted, | ||
45 | -then `false` is returned. | ||
46 | - | ||
47 | -#### .charsets() | ||
48 | - | ||
49 | -Return the charsets that the request accepts, in the order of the client's | ||
50 | -preference (most preferred first). | ||
51 | - | ||
52 | -#### .encoding(encodings) | ||
53 | - | ||
54 | -Return the first accepted encoding. If nothing in `encodings` is accepted, | ||
55 | -then `false` is returned. | ||
56 | - | ||
57 | -#### .encodings() | ||
58 | - | ||
59 | -Return the encodings that the request accepts, in the order of the client's | ||
60 | -preference (most preferred first). | ||
61 | - | ||
62 | -#### .language(languages) | ||
63 | - | ||
64 | -Return the first accepted language. If nothing in `languages` is accepted, | ||
65 | -then `false` is returned. | ||
66 | - | ||
67 | -#### .languages() | ||
68 | - | ||
69 | -Return the languages that the request accepts, in the order of the client's | ||
70 | -preference (most preferred first). | ||
71 | - | ||
72 | -#### .type(types) | ||
73 | - | ||
74 | -Return the first accepted type (and it is returned as the same text as what | ||
75 | -appears in the `types` array). If nothing in `types` is accepted, then `false` | ||
76 | -is returned. | ||
77 | - | ||
78 | -The `types` array can contain full MIME types or file extensions. Any value | ||
79 | -that is not a full MIME types is passed to `require('mime-types').lookup`. | ||
80 | - | ||
81 | -#### .types() | ||
82 | - | ||
83 | -Return the types that the request accepts, in the order of the client's | ||
84 | -preference (most preferred first). | ||
85 | - | ||
86 | -## Examples | ||
87 | - | ||
88 | -### Simple type negotiation | ||
89 | - | ||
90 | -This simple example shows how to use `accepts` to return a different typed | ||
91 | -respond body based on what the client wants to accept. The server lists it's | ||
92 | -preferences in order and will get back the best match between the client and | ||
93 | -server. | ||
94 | - | ||
95 | -```js | ||
96 | -var accepts = require('accepts') | ||
97 | -var http = require('http') | ||
98 | - | ||
99 | -function app (req, res) { | ||
100 | - var accept = accepts(req) | ||
101 | - | ||
102 | - // the order of this list is significant; should be server preferred order | ||
103 | - switch (accept.type(['json', 'html'])) { | ||
104 | - case 'json': | ||
105 | - res.setHeader('Content-Type', 'application/json') | ||
106 | - res.write('{"hello":"world!"}') | ||
107 | - break | ||
108 | - case 'html': | ||
109 | - res.setHeader('Content-Type', 'text/html') | ||
110 | - res.write('<b>hello, world!</b>') | ||
111 | - break | ||
112 | - default: | ||
113 | - // the fallback is text/plain, so no need to specify it above | ||
114 | - res.setHeader('Content-Type', 'text/plain') | ||
115 | - res.write('hello, world!') | ||
116 | - break | ||
117 | - } | ||
118 | - | ||
119 | - res.end() | ||
120 | -} | ||
121 | - | ||
122 | -http.createServer(app).listen(3000) | ||
123 | -``` | ||
124 | - | ||
125 | -You can test this out with the cURL program: | ||
126 | -```sh | ||
127 | -curl -I -H'Accept: text/html' http://localhost:3000/ | ||
128 | -``` | ||
129 | - | ||
130 | -## License | ||
131 | - | ||
132 | -[MIT](LICENSE) | ||
133 | - | ||
134 | -[npm-image]: https://img.shields.io/npm/v/accepts.svg | ||
135 | -[npm-url]: https://npmjs.org/package/accepts | ||
136 | -[node-version-image]: https://img.shields.io/node/v/accepts.svg | ||
137 | -[node-version-url]: https://nodejs.org/en/download/ | ||
138 | -[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg | ||
139 | -[travis-url]: https://travis-ci.org/jshttp/accepts | ||
140 | -[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg | ||
141 | -[coveralls-url]: https://coveralls.io/r/jshttp/accepts | ||
142 | -[downloads-image]: https://img.shields.io/npm/dm/accepts.svg | ||
143 | -[downloads-url]: https://npmjs.org/package/accepts |
node_modules/accepts/index.js
deleted
100644 → 0
1 | -/*! | ||
2 | - * accepts | ||
3 | - * Copyright(c) 2014 Jonathan Ong | ||
4 | - * Copyright(c) 2015 Douglas Christopher Wilson | ||
5 | - * MIT Licensed | ||
6 | - */ | ||
7 | - | ||
8 | -'use strict' | ||
9 | - | ||
10 | -/** | ||
11 | - * Module dependencies. | ||
12 | - * @private | ||
13 | - */ | ||
14 | - | ||
15 | -var Negotiator = require('negotiator') | ||
16 | -var mime = require('mime-types') | ||
17 | - | ||
18 | -/** | ||
19 | - * Module exports. | ||
20 | - * @public | ||
21 | - */ | ||
22 | - | ||
23 | -module.exports = Accepts | ||
24 | - | ||
25 | -/** | ||
26 | - * Create a new Accepts object for the given req. | ||
27 | - * | ||
28 | - * @param {object} req | ||
29 | - * @public | ||
30 | - */ | ||
31 | - | ||
32 | -function Accepts (req) { | ||
33 | - if (!(this instanceof Accepts)) { | ||
34 | - return new Accepts(req) | ||
35 | - } | ||
36 | - | ||
37 | - this.headers = req.headers | ||
38 | - this.negotiator = new Negotiator(req) | ||
39 | -} | ||
40 | - | ||
41 | -/** | ||
42 | - * Check if the given `type(s)` is acceptable, returning | ||
43 | - * the best match when true, otherwise `undefined`, in which | ||
44 | - * case you should respond with 406 "Not Acceptable". | ||
45 | - * | ||
46 | - * The `type` value may be a single mime type string | ||
47 | - * such as "application/json", the extension name | ||
48 | - * such as "json" or an array `["json", "html", "text/plain"]`. When a list | ||
49 | - * or array is given the _best_ match, if any is returned. | ||
50 | - * | ||
51 | - * Examples: | ||
52 | - * | ||
53 | - * // Accept: text/html | ||
54 | - * this.types('html'); | ||
55 | - * // => "html" | ||
56 | - * | ||
57 | - * // Accept: text/*, application/json | ||
58 | - * this.types('html'); | ||
59 | - * // => "html" | ||
60 | - * this.types('text/html'); | ||
61 | - * // => "text/html" | ||
62 | - * this.types('json', 'text'); | ||
63 | - * // => "json" | ||
64 | - * this.types('application/json'); | ||
65 | - * // => "application/json" | ||
66 | - * | ||
67 | - * // Accept: text/*, application/json | ||
68 | - * this.types('image/png'); | ||
69 | - * this.types('png'); | ||
70 | - * // => undefined | ||
71 | - * | ||
72 | - * // Accept: text/*;q=.5, application/json | ||
73 | - * this.types(['html', 'json']); | ||
74 | - * this.types('html', 'json'); | ||
75 | - * // => "json" | ||
76 | - * | ||
77 | - * @param {String|Array} types... | ||
78 | - * @return {String|Array|Boolean} | ||
79 | - * @public | ||
80 | - */ | ||
81 | - | ||
82 | -Accepts.prototype.type = | ||
83 | -Accepts.prototype.types = function (types_) { | ||
84 | - var types = types_ | ||
85 | - | ||
86 | - // support flattened arguments | ||
87 | - if (types && !Array.isArray(types)) { | ||
88 | - types = new Array(arguments.length) | ||
89 | - for (var i = 0; i < types.length; i++) { | ||
90 | - types[i] = arguments[i] | ||
91 | - } | ||
92 | - } | ||
93 | - | ||
94 | - // no types, return all requested types | ||
95 | - if (!types || types.length === 0) { | ||
96 | - return this.negotiator.mediaTypes() | ||
97 | - } | ||
98 | - | ||
99 | - // no accept header, return first given type | ||
100 | - if (!this.headers.accept) { | ||
101 | - return types[0] | ||
102 | - } | ||
103 | - | ||
104 | - var mimes = types.map(extToMime) | ||
105 | - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) | ||
106 | - var first = accepts[0] | ||
107 | - | ||
108 | - return first | ||
109 | - ? types[mimes.indexOf(first)] | ||
110 | - : false | ||
111 | -} | ||
112 | - | ||
113 | -/** | ||
114 | - * Return accepted encodings or best fit based on `encodings`. | ||
115 | - * | ||
116 | - * Given `Accept-Encoding: gzip, deflate` | ||
117 | - * an array sorted by quality is returned: | ||
118 | - * | ||
119 | - * ['gzip', 'deflate'] | ||
120 | - * | ||
121 | - * @param {String|Array} encodings... | ||
122 | - * @return {String|Array} | ||
123 | - * @public | ||
124 | - */ | ||
125 | - | ||
126 | -Accepts.prototype.encoding = | ||
127 | -Accepts.prototype.encodings = function (encodings_) { | ||
128 | - var encodings = encodings_ | ||
129 | - | ||
130 | - // support flattened arguments | ||
131 | - if (encodings && !Array.isArray(encodings)) { | ||
132 | - encodings = new Array(arguments.length) | ||
133 | - for (var i = 0; i < encodings.length; i++) { | ||
134 | - encodings[i] = arguments[i] | ||
135 | - } | ||
136 | - } | ||
137 | - | ||
138 | - // no encodings, return all requested encodings | ||
139 | - if (!encodings || encodings.length === 0) { | ||
140 | - return this.negotiator.encodings() | ||
141 | - } | ||
142 | - | ||
143 | - return this.negotiator.encodings(encodings)[0] || false | ||
144 | -} | ||
145 | - | ||
146 | -/** | ||
147 | - * Return accepted charsets or best fit based on `charsets`. | ||
148 | - * | ||
149 | - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` | ||
150 | - * an array sorted by quality is returned: | ||
151 | - * | ||
152 | - * ['utf-8', 'utf-7', 'iso-8859-1'] | ||
153 | - * | ||
154 | - * @param {String|Array} charsets... | ||
155 | - * @return {String|Array} | ||
156 | - * @public | ||
157 | - */ | ||
158 | - | ||
159 | -Accepts.prototype.charset = | ||
160 | -Accepts.prototype.charsets = function (charsets_) { | ||
161 | - var charsets = charsets_ | ||
162 | - | ||
163 | - // support flattened arguments | ||
164 | - if (charsets && !Array.isArray(charsets)) { | ||
165 | - charsets = new Array(arguments.length) | ||
166 | - for (var i = 0; i < charsets.length; i++) { | ||
167 | - charsets[i] = arguments[i] | ||
168 | - } | ||
169 | - } | ||
170 | - | ||
171 | - // no charsets, return all requested charsets | ||
172 | - if (!charsets || charsets.length === 0) { | ||
173 | - return this.negotiator.charsets() | ||
174 | - } | ||
175 | - | ||
176 | - return this.negotiator.charsets(charsets)[0] || false | ||
177 | -} | ||
178 | - | ||
179 | -/** | ||
180 | - * Return accepted languages or best fit based on `langs`. | ||
181 | - * | ||
182 | - * Given `Accept-Language: en;q=0.8, es, pt` | ||
183 | - * an array sorted by quality is returned: | ||
184 | - * | ||
185 | - * ['es', 'pt', 'en'] | ||
186 | - * | ||
187 | - * @param {String|Array} langs... | ||
188 | - * @return {Array|String} | ||
189 | - * @public | ||
190 | - */ | ||
191 | - | ||
192 | -Accepts.prototype.lang = | ||
193 | -Accepts.prototype.langs = | ||
194 | -Accepts.prototype.language = | ||
195 | -Accepts.prototype.languages = function (languages_) { | ||
196 | - var languages = languages_ | ||
197 | - | ||
198 | - // support flattened arguments | ||
199 | - if (languages && !Array.isArray(languages)) { | ||
200 | - languages = new Array(arguments.length) | ||
201 | - for (var i = 0; i < languages.length; i++) { | ||
202 | - languages[i] = arguments[i] | ||
203 | - } | ||
204 | - } | ||
205 | - | ||
206 | - // no languages, return all requested languages | ||
207 | - if (!languages || languages.length === 0) { | ||
208 | - return this.negotiator.languages() | ||
209 | - } | ||
210 | - | ||
211 | - return this.negotiator.languages(languages)[0] || false | ||
212 | -} | ||
213 | - | ||
214 | -/** | ||
215 | - * Convert extnames to mime. | ||
216 | - * | ||
217 | - * @param {String} type | ||
218 | - * @return {String} | ||
219 | - * @private | ||
220 | - */ | ||
221 | - | ||
222 | -function extToMime (type) { | ||
223 | - return type.indexOf('/') === -1 | ||
224 | - ? mime.lookup(type) | ||
225 | - : type | ||
226 | -} | ||
227 | - | ||
228 | -/** | ||
229 | - * Check if mime is valid. | ||
230 | - * | ||
231 | - * @param {String} type | ||
232 | - * @return {String} | ||
233 | - * @private | ||
234 | - */ | ||
235 | - | ||
236 | -function validMime (type) { | ||
237 | - return typeof type === 'string' | ||
238 | -} |
node_modules/accepts/package.json
deleted
100644 → 0
1 | -{ | ||
2 | - "_args": [ | ||
3 | - [ | ||
4 | - { | ||
5 | - "raw": "accepts@~1.3.3", | ||
6 | - "scope": null, | ||
7 | - "escapedName": "accepts", | ||
8 | - "name": "accepts", | ||
9 | - "rawSpec": "~1.3.3", | ||
10 | - "spec": ">=1.3.3 <1.4.0", | ||
11 | - "type": "range" | ||
12 | - }, | ||
13 | - "C:\\Users\\SangWonLee\\Desktop\\OSS\\Project2013104098\\node_modules\\errorhandler" | ||
14 | - ] | ||
15 | - ], | ||
16 | - "_from": "accepts@>=1.3.3 <1.4.0", | ||
17 | - "_id": "accepts@1.3.4", | ||
18 | - "_inCache": true, | ||
19 | - "_location": "/accepts", | ||
20 | - "_nodeVersion": "6.11.1", | ||
21 | - "_npmOperationalInternal": { | ||
22 | - "host": "s3://npm-registry-packages", | ||
23 | - "tmp": "tmp/accepts-1.3.4.tgz_1503455053008_0.43370609171688557" | ||
24 | - }, | ||
25 | - "_npmUser": { | ||
26 | - "name": "dougwilson", | ||
27 | - "email": "doug@somethingdoug.com" | ||
28 | - }, | ||
29 | - "_npmVersion": "3.10.10", | ||
30 | - "_phantomChildren": {}, | ||
31 | - "_requested": { | ||
32 | - "raw": "accepts@~1.3.3", | ||
33 | - "scope": null, | ||
34 | - "escapedName": "accepts", | ||
35 | - "name": "accepts", | ||
36 | - "rawSpec": "~1.3.3", | ||
37 | - "spec": ">=1.3.3 <1.4.0", | ||
38 | - "type": "range" | ||
39 | - }, | ||
40 | - "_requiredBy": [ | ||
41 | - "/errorhandler", | ||
42 | - "/express" | ||
43 | - ], | ||
44 | - "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", | ||
45 | - "_shasum": "86246758c7dd6d21a6474ff084a4740ec05eb21f", | ||
46 | - "_shrinkwrap": null, | ||
47 | - "_spec": "accepts@~1.3.3", | ||
48 | - "_where": "C:\\Users\\SangWonLee\\Desktop\\OSS\\Project2013104098\\node_modules\\errorhandler", | ||
49 | - "bugs": { | ||
50 | - "url": "https://github.com/jshttp/accepts/issues" | ||
51 | - }, | ||
52 | - "contributors": [ | ||
53 | - { | ||
54 | - "name": "Douglas Christopher Wilson", | ||
55 | - "email": "doug@somethingdoug.com" | ||
56 | - }, | ||
57 | - { | ||
58 | - "name": "Jonathan Ong", | ||
59 | - "email": "me@jongleberry.com", | ||
60 | - "url": "http://jongleberry.com" | ||
61 | - } | ||
62 | - ], | ||
63 | - "dependencies": { | ||
64 | - "mime-types": "~2.1.16", | ||
65 | - "negotiator": "0.6.1" | ||
66 | - }, | ||
67 | - "description": "Higher-level content negotiation", | ||
68 | - "devDependencies": { | ||
69 | - "eslint": "3.19.0", | ||
70 | - "eslint-config-standard": "10.2.1", | ||
71 | - "eslint-plugin-import": "2.7.0", | ||
72 | - "eslint-plugin-markdown": "1.0.0-beta.6", | ||
73 | - "eslint-plugin-node": "5.1.1", | ||
74 | - "eslint-plugin-promise": "3.5.0", | ||
75 | - "eslint-plugin-standard": "3.0.1", | ||
76 | - "istanbul": "0.4.5", | ||
77 | - "mocha": "~1.21.5" | ||
78 | - }, | ||
79 | - "directories": {}, | ||
80 | - "dist": { | ||
81 | - "shasum": "86246758c7dd6d21a6474ff084a4740ec05eb21f", | ||
82 | - "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz" | ||
83 | - }, | ||
84 | - "engines": { | ||
85 | - "node": ">= 0.6" | ||
86 | - }, | ||
87 | - "files": [ | ||
88 | - "LICENSE", | ||
89 | - "HISTORY.md", | ||
90 | - "index.js" | ||
91 | - ], | ||
92 | - "gitHead": "71ea430741d6eb5484b6c67c95924540a98186a5", | ||
93 | - "homepage": "https://github.com/jshttp/accepts#readme", | ||
94 | - "keywords": [ | ||
95 | - "content", | ||
96 | - "negotiation", | ||
97 | - "accept", | ||
98 | - "accepts" | ||
99 | - ], | ||
100 | - "license": "MIT", | ||
101 | - "maintainers": [ | ||
102 | - { | ||
103 | - "name": "dougwilson", | ||
104 | - "email": "doug@somethingdoug.com" | ||
105 | - } | ||
106 | - ], | ||
107 | - "name": "accepts", | ||
108 | - "optionalDependencies": {}, | ||
109 | - "readme": "ERROR: No README data found!", | ||
110 | - "repository": { | ||
111 | - "type": "git", | ||
112 | - "url": "git+https://github.com/jshttp/accepts.git" | ||
113 | - }, | ||
114 | - "scripts": { | ||
115 | - "lint": "eslint --plugin markdown --ext js,md .", | ||
116 | - "test": "mocha --reporter spec --check-leaks --bail test/", | ||
117 | - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", | ||
118 | - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" | ||
119 | - }, | ||
120 | - "version": "1.3.4" | ||
121 | -} |
node_modules/ajv/.tonic_example.js
deleted
100644 → 0
1 | -var Ajv = require('ajv'); | ||
2 | -var ajv = new Ajv({allErrors: true}); | ||
3 | - | ||
4 | -var schema = { | ||
5 | - "properties": { | ||
6 | - "foo": { "type": "string" }, | ||
7 | - "bar": { "type": "number", "maximum": 3 } | ||
8 | - } | ||
9 | -}; | ||
10 | - | ||
11 | -var validate = ajv.compile(schema); | ||
12 | - | ||
13 | -test({"foo": "abc", "bar": 2}); | ||
14 | -test({"foo": 2, "bar": 4}); | ||
15 | - | ||
16 | -function test(data) { | ||
17 | - var valid = validate(data); | ||
18 | - if (valid) console.log('Valid!'); | ||
19 | - else console.log('Invalid: ' + ajv.errorsText(validate.errors)); | ||
20 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
node_modules/ajv/LICENSE
deleted
100644 → 0
1 | -The MIT License (MIT) | ||
2 | - | ||
3 | -Copyright (c) 2015 Evgeny Poberezkin | ||
4 | - | ||
5 | -Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | -of this software and associated documentation files (the "Software"), to deal | ||
7 | -in the Software without restriction, including without limitation the rights | ||
8 | -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | -copies of the Software, and to permit persons to whom the Software is | ||
10 | -furnished to do so, subject to the following conditions: | ||
11 | - | ||
12 | -The above copyright notice and this permission notice shall be included in all | ||
13 | -copies or substantial portions of the Software. | ||
14 | - | ||
15 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
21 | -SOFTWARE. | ||
22 | - |
node_modules/ajv/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ajv/dist/ajv.bundle.js
deleted
100644 → 0
This diff could not be displayed because it is too large.
node_modules/ajv/dist/ajv.min.js
deleted
100644 → 0
This diff could not be displayed because it is too large.
node_modules/ajv/dist/ajv.min.js.map
deleted
100644 → 0
This diff could not be displayed because it is too large.
node_modules/ajv/dist/nodent.min.js
deleted
100644 → 0
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
node_modules/ajv/lib/$data.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | - | ||
3 | -var KEYWORDS = [ | ||
4 | - 'multipleOf', | ||
5 | - 'maximum', | ||
6 | - 'exclusiveMaximum', | ||
7 | - 'minimum', | ||
8 | - 'exclusiveMinimum', | ||
9 | - 'maxLength', | ||
10 | - 'minLength', | ||
11 | - 'pattern', | ||
12 | - 'additionalItems', | ||
13 | - 'maxItems', | ||
14 | - 'minItems', | ||
15 | - 'uniqueItems', | ||
16 | - 'maxProperties', | ||
17 | - 'minProperties', | ||
18 | - 'required', | ||
19 | - 'additionalProperties', | ||
20 | - 'enum', | ||
21 | - 'format', | ||
22 | - 'const' | ||
23 | -]; | ||
24 | - | ||
25 | -module.exports = function (metaSchema, keywordsJsonPointers) { | ||
26 | - for (var i=0; i<keywordsJsonPointers.length; i++) { | ||
27 | - metaSchema = JSON.parse(JSON.stringify(metaSchema)); | ||
28 | - var segments = keywordsJsonPointers[i].split('/'); | ||
29 | - var keywords = metaSchema; | ||
30 | - var j; | ||
31 | - for (j=1; j<segments.length; j++) | ||
32 | - keywords = keywords[segments[j]]; | ||
33 | - | ||
34 | - for (j=0; j<KEYWORDS.length; j++) { | ||
35 | - var key = KEYWORDS[j]; | ||
36 | - var schema = keywords[key]; | ||
37 | - if (schema) { | ||
38 | - keywords[key] = { | ||
39 | - anyOf: [ | ||
40 | - schema, | ||
41 | - { $ref: 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#' } | ||
42 | - ] | ||
43 | - }; | ||
44 | - } | ||
45 | - } | ||
46 | - } | ||
47 | - | ||
48 | - return metaSchema; | ||
49 | -}; |
node_modules/ajv/lib/ajv.d.ts
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/ajv.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/cache.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | - | ||
3 | - | ||
4 | -var Cache = module.exports = function Cache() { | ||
5 | - this._cache = {}; | ||
6 | -}; | ||
7 | - | ||
8 | - | ||
9 | -Cache.prototype.put = function Cache_put(key, value) { | ||
10 | - this._cache[key] = value; | ||
11 | -}; | ||
12 | - | ||
13 | - | ||
14 | -Cache.prototype.get = function Cache_get(key) { | ||
15 | - return this._cache[key]; | ||
16 | -}; | ||
17 | - | ||
18 | - | ||
19 | -Cache.prototype.del = function Cache_del(key) { | ||
20 | - delete this._cache[key]; | ||
21 | -}; | ||
22 | - | ||
23 | - | ||
24 | -Cache.prototype.clear = function Cache_clear() { | ||
25 | - this._cache = {}; | ||
26 | -}; |
1 | -'use strict'; | ||
2 | - | ||
3 | -//all requires must be explicit because browserify won't work with dynamic requires | ||
4 | -module.exports = { | ||
5 | - '$ref': require('../dotjs/ref'), | ||
6 | - allOf: require('../dotjs/allOf'), | ||
7 | - anyOf: require('../dotjs/anyOf'), | ||
8 | - const: require('../dotjs/const'), | ||
9 | - contains: require('../dotjs/contains'), | ||
10 | - dependencies: require('../dotjs/dependencies'), | ||
11 | - 'enum': require('../dotjs/enum'), | ||
12 | - format: require('../dotjs/format'), | ||
13 | - items: require('../dotjs/items'), | ||
14 | - maximum: require('../dotjs/_limit'), | ||
15 | - minimum: require('../dotjs/_limit'), | ||
16 | - maxItems: require('../dotjs/_limitItems'), | ||
17 | - minItems: require('../dotjs/_limitItems'), | ||
18 | - maxLength: require('../dotjs/_limitLength'), | ||
19 | - minLength: require('../dotjs/_limitLength'), | ||
20 | - maxProperties: require('../dotjs/_limitProperties'), | ||
21 | - minProperties: require('../dotjs/_limitProperties'), | ||
22 | - multipleOf: require('../dotjs/multipleOf'), | ||
23 | - not: require('../dotjs/not'), | ||
24 | - oneOf: require('../dotjs/oneOf'), | ||
25 | - pattern: require('../dotjs/pattern'), | ||
26 | - properties: require('../dotjs/properties'), | ||
27 | - propertyNames: require('../dotjs/propertyNames'), | ||
28 | - required: require('../dotjs/required'), | ||
29 | - uniqueItems: require('../dotjs/uniqueItems'), | ||
30 | - validate: require('../dotjs/validate') | ||
31 | -}; |
1 | -'use strict'; | ||
2 | - | ||
3 | -var MissingRefError = require('./error_classes').MissingRef; | ||
4 | - | ||
5 | -module.exports = compileAsync; | ||
6 | - | ||
7 | - | ||
8 | -/** | ||
9 | - * Creates validating function for passed schema with asynchronous loading of missing schemas. | ||
10 | - * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. | ||
11 | - * @this Ajv | ||
12 | - * @param {Object} schema schema object | ||
13 | - * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped | ||
14 | - * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function. | ||
15 | - * @return {Promise} promise that resolves with a validating function. | ||
16 | - */ | ||
17 | -function compileAsync(schema, meta, callback) { | ||
18 | - /* eslint no-shadow: 0 */ | ||
19 | - /* global Promise */ | ||
20 | - /* jshint validthis: true */ | ||
21 | - var self = this; | ||
22 | - if (typeof this._opts.loadSchema != 'function') | ||
23 | - throw new Error('options.loadSchema should be a function'); | ||
24 | - | ||
25 | - if (typeof meta == 'function') { | ||
26 | - callback = meta; | ||
27 | - meta = undefined; | ||
28 | - } | ||
29 | - | ||
30 | - var p = loadMetaSchemaOf(schema).then(function () { | ||
31 | - var schemaObj = self._addSchema(schema, undefined, meta); | ||
32 | - return schemaObj.validate || _compileAsync(schemaObj); | ||
33 | - }); | ||
34 | - | ||
35 | - if (callback) { | ||
36 | - p.then( | ||
37 | - function(v) { callback(null, v); }, | ||
38 | - callback | ||
39 | - ); | ||
40 | - } | ||
41 | - | ||
42 | - return p; | ||
43 | - | ||
44 | - | ||
45 | - function loadMetaSchemaOf(sch) { | ||
46 | - var $schema = sch.$schema; | ||
47 | - return $schema && !self.getSchema($schema) | ||
48 | - ? compileAsync.call(self, { $ref: $schema }, true) | ||
49 | - : Promise.resolve(); | ||
50 | - } | ||
51 | - | ||
52 | - | ||
53 | - function _compileAsync(schemaObj) { | ||
54 | - try { return self._compile(schemaObj); } | ||
55 | - catch(e) { | ||
56 | - if (e instanceof MissingRefError) return loadMissingSchema(e); | ||
57 | - throw e; | ||
58 | - } | ||
59 | - | ||
60 | - | ||
61 | - function loadMissingSchema(e) { | ||
62 | - var ref = e.missingSchema; | ||
63 | - if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved'); | ||
64 | - | ||
65 | - var schemaPromise = self._loadingSchemas[ref]; | ||
66 | - if (!schemaPromise) { | ||
67 | - schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref); | ||
68 | - schemaPromise.then(removePromise, removePromise); | ||
69 | - } | ||
70 | - | ||
71 | - return schemaPromise.then(function (sch) { | ||
72 | - if (!added(ref)) { | ||
73 | - return loadMetaSchemaOf(sch).then(function () { | ||
74 | - if (!added(ref)) self.addSchema(sch, ref, undefined, meta); | ||
75 | - }); | ||
76 | - } | ||
77 | - }).then(function() { | ||
78 | - return _compileAsync(schemaObj); | ||
79 | - }); | ||
80 | - | ||
81 | - function removePromise() { | ||
82 | - delete self._loadingSchemas[ref]; | ||
83 | - } | ||
84 | - | ||
85 | - function added(ref) { | ||
86 | - return self._refs[ref] || self._schemas[ref]; | ||
87 | - } | ||
88 | - } | ||
89 | - } | ||
90 | -} |
1 | -'use strict'; | ||
2 | - | ||
3 | -var resolve = require('./resolve'); | ||
4 | - | ||
5 | -module.exports = { | ||
6 | - Validation: errorSubclass(ValidationError), | ||
7 | - MissingRef: errorSubclass(MissingRefError) | ||
8 | -}; | ||
9 | - | ||
10 | - | ||
11 | -function ValidationError(errors) { | ||
12 | - this.message = 'validation failed'; | ||
13 | - this.errors = errors; | ||
14 | - this.ajv = this.validation = true; | ||
15 | -} | ||
16 | - | ||
17 | - | ||
18 | -MissingRefError.message = function (baseId, ref) { | ||
19 | - return 'can\'t resolve reference ' + ref + ' from id ' + baseId; | ||
20 | -}; | ||
21 | - | ||
22 | - | ||
23 | -function MissingRefError(baseId, ref, message) { | ||
24 | - this.message = message || MissingRefError.message(baseId, ref); | ||
25 | - this.missingRef = resolve.url(baseId, ref); | ||
26 | - this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); | ||
27 | -} | ||
28 | - | ||
29 | - | ||
30 | -function errorSubclass(Subclass) { | ||
31 | - Subclass.prototype = Object.create(Error.prototype); | ||
32 | - Subclass.prototype.constructor = Subclass; | ||
33 | - return Subclass; | ||
34 | -} |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | -'use strict'; | ||
2 | - | ||
3 | -var url = require('url') | ||
4 | - , equal = require('fast-deep-equal') | ||
5 | - , util = require('./util') | ||
6 | - , SchemaObject = require('./schema_obj') | ||
7 | - , traverse = require('json-schema-traverse'); | ||
8 | - | ||
9 | -module.exports = resolve; | ||
10 | - | ||
11 | -resolve.normalizeId = normalizeId; | ||
12 | -resolve.fullPath = getFullPath; | ||
13 | -resolve.url = resolveUrl; | ||
14 | -resolve.ids = resolveIds; | ||
15 | -resolve.inlineRef = inlineRef; | ||
16 | -resolve.schema = resolveSchema; | ||
17 | - | ||
18 | -/** | ||
19 | - * [resolve and compile the references ($ref)] | ||
20 | - * @this Ajv | ||
21 | - * @param {Function} compile reference to schema compilation funciton (localCompile) | ||
22 | - * @param {Object} root object with information about the root schema for the current schema | ||
23 | - * @param {String} ref reference to resolve | ||
24 | - * @return {Object|Function} schema object (if the schema can be inlined) or validation function | ||
25 | - */ | ||
26 | -function resolve(compile, root, ref) { | ||
27 | - /* jshint validthis: true */ | ||
28 | - var refVal = this._refs[ref]; | ||
29 | - if (typeof refVal == 'string') { | ||
30 | - if (this._refs[refVal]) refVal = this._refs[refVal]; | ||
31 | - else return resolve.call(this, compile, root, refVal); | ||
32 | - } | ||
33 | - | ||
34 | - refVal = refVal || this._schemas[ref]; | ||
35 | - if (refVal instanceof SchemaObject) { | ||
36 | - return inlineRef(refVal.schema, this._opts.inlineRefs) | ||
37 | - ? refVal.schema | ||
38 | - : refVal.validate || this._compile(refVal); | ||
39 | - } | ||
40 | - | ||
41 | - var res = resolveSchema.call(this, root, ref); | ||
42 | - var schema, v, baseId; | ||
43 | - if (res) { | ||
44 | - schema = res.schema; | ||
45 | - root = res.root; | ||
46 | - baseId = res.baseId; | ||
47 | - } | ||
48 | - | ||
49 | - if (schema instanceof SchemaObject) { | ||
50 | - v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); | ||
51 | - } else if (schema !== undefined) { | ||
52 | - v = inlineRef(schema, this._opts.inlineRefs) | ||
53 | - ? schema | ||
54 | - : compile.call(this, schema, root, undefined, baseId); | ||
55 | - } | ||
56 | - | ||
57 | - return v; | ||
58 | -} | ||
59 | - | ||
60 | - | ||
61 | -/** | ||
62 | - * Resolve schema, its root and baseId | ||
63 | - * @this Ajv | ||
64 | - * @param {Object} root root object with properties schema, refVal, refs | ||
65 | - * @param {String} ref reference to resolve | ||
66 | - * @return {Object} object with properties schema, root, baseId | ||
67 | - */ | ||
68 | -function resolveSchema(root, ref) { | ||
69 | - /* jshint validthis: true */ | ||
70 | - var p = url.parse(ref, false, true) | ||
71 | - , refPath = _getFullPath(p) | ||
72 | - , baseId = getFullPath(this._getId(root.schema)); | ||
73 | - if (refPath !== baseId) { | ||
74 | - var id = normalizeId(refPath); | ||
75 | - var refVal = this._refs[id]; | ||
76 | - if (typeof refVal == 'string') { | ||
77 | - return resolveRecursive.call(this, root, refVal, p); | ||
78 | - } else if (refVal instanceof SchemaObject) { | ||
79 | - if (!refVal.validate) this._compile(refVal); | ||
80 | - root = refVal; | ||
81 | - } else { | ||
82 | - refVal = this._schemas[id]; | ||
83 | - if (refVal instanceof SchemaObject) { | ||
84 | - if (!refVal.validate) this._compile(refVal); | ||
85 | - if (id == normalizeId(ref)) | ||
86 | - return { schema: refVal, root: root, baseId: baseId }; | ||
87 | - root = refVal; | ||
88 | - } else { | ||
89 | - return; | ||
90 | - } | ||
91 | - } | ||
92 | - if (!root.schema) return; | ||
93 | - baseId = getFullPath(this._getId(root.schema)); | ||
94 | - } | ||
95 | - return getJsonPointer.call(this, p, baseId, root.schema, root); | ||
96 | -} | ||
97 | - | ||
98 | - | ||
99 | -/* @this Ajv */ | ||
100 | -function resolveRecursive(root, ref, parsedRef) { | ||
101 | - /* jshint validthis: true */ | ||
102 | - var res = resolveSchema.call(this, root, ref); | ||
103 | - if (res) { | ||
104 | - var schema = res.schema; | ||
105 | - var baseId = res.baseId; | ||
106 | - root = res.root; | ||
107 | - var id = this._getId(schema); | ||
108 | - if (id) baseId = resolveUrl(baseId, id); | ||
109 | - return getJsonPointer.call(this, parsedRef, baseId, schema, root); | ||
110 | - } | ||
111 | -} | ||
112 | - | ||
113 | - | ||
114 | -var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); | ||
115 | -/* @this Ajv */ | ||
116 | -function getJsonPointer(parsedRef, baseId, schema, root) { | ||
117 | - /* jshint validthis: true */ | ||
118 | - parsedRef.hash = parsedRef.hash || ''; | ||
119 | - if (parsedRef.hash.slice(0,2) != '#/') return; | ||
120 | - var parts = parsedRef.hash.split('/'); | ||
121 | - | ||
122 | - for (var i = 1; i < parts.length; i++) { | ||
123 | - var part = parts[i]; | ||
124 | - if (part) { | ||
125 | - part = util.unescapeFragment(part); | ||
126 | - schema = schema[part]; | ||
127 | - if (schema === undefined) break; | ||
128 | - var id; | ||
129 | - if (!PREVENT_SCOPE_CHANGE[part]) { | ||
130 | - id = this._getId(schema); | ||
131 | - if (id) baseId = resolveUrl(baseId, id); | ||
132 | - if (schema.$ref) { | ||
133 | - var $ref = resolveUrl(baseId, schema.$ref); | ||
134 | - var res = resolveSchema.call(this, root, $ref); | ||
135 | - if (res) { | ||
136 | - schema = res.schema; | ||
137 | - root = res.root; | ||
138 | - baseId = res.baseId; | ||
139 | - } | ||
140 | - } | ||
141 | - } | ||
142 | - } | ||
143 | - } | ||
144 | - if (schema !== undefined && schema !== root.schema) | ||
145 | - return { schema: schema, root: root, baseId: baseId }; | ||
146 | -} | ||
147 | - | ||
148 | - | ||
149 | -var SIMPLE_INLINED = util.toHash([ | ||
150 | - 'type', 'format', 'pattern', | ||
151 | - 'maxLength', 'minLength', | ||
152 | - 'maxProperties', 'minProperties', | ||
153 | - 'maxItems', 'minItems', | ||
154 | - 'maximum', 'minimum', | ||
155 | - 'uniqueItems', 'multipleOf', | ||
156 | - 'required', 'enum' | ||
157 | -]); | ||
158 | -function inlineRef(schema, limit) { | ||
159 | - if (limit === false) return false; | ||
160 | - if (limit === undefined || limit === true) return checkNoRef(schema); | ||
161 | - else if (limit) return countKeys(schema) <= limit; | ||
162 | -} | ||
163 | - | ||
164 | - | ||
165 | -function checkNoRef(schema) { | ||
166 | - var item; | ||
167 | - if (Array.isArray(schema)) { | ||
168 | - for (var i=0; i<schema.length; i++) { | ||
169 | - item = schema[i]; | ||
170 | - if (typeof item == 'object' && !checkNoRef(item)) return false; | ||
171 | - } | ||
172 | - } else { | ||
173 | - for (var key in schema) { | ||
174 | - if (key == '$ref') return false; | ||
175 | - item = schema[key]; | ||
176 | - if (typeof item == 'object' && !checkNoRef(item)) return false; | ||
177 | - } | ||
178 | - } | ||
179 | - return true; | ||
180 | -} | ||
181 | - | ||
182 | - | ||
183 | -function countKeys(schema) { | ||
184 | - var count = 0, item; | ||
185 | - if (Array.isArray(schema)) { | ||
186 | - for (var i=0; i<schema.length; i++) { | ||
187 | - item = schema[i]; | ||
188 | - if (typeof item == 'object') count += countKeys(item); | ||
189 | - if (count == Infinity) return Infinity; | ||
190 | - } | ||
191 | - } else { | ||
192 | - for (var key in schema) { | ||
193 | - if (key == '$ref') return Infinity; | ||
194 | - if (SIMPLE_INLINED[key]) { | ||
195 | - count++; | ||
196 | - } else { | ||
197 | - item = schema[key]; | ||
198 | - if (typeof item == 'object') count += countKeys(item) + 1; | ||
199 | - if (count == Infinity) return Infinity; | ||
200 | - } | ||
201 | - } | ||
202 | - } | ||
203 | - return count; | ||
204 | -} | ||
205 | - | ||
206 | - | ||
207 | -function getFullPath(id, normalize) { | ||
208 | - if (normalize !== false) id = normalizeId(id); | ||
209 | - var p = url.parse(id, false, true); | ||
210 | - return _getFullPath(p); | ||
211 | -} | ||
212 | - | ||
213 | - | ||
214 | -function _getFullPath(p) { | ||
215 | - var protocolSeparator = p.protocol || p.href.slice(0,2) == '//' ? '//' : ''; | ||
216 | - return (p.protocol||'') + protocolSeparator + (p.host||'') + (p.path||'') + '#'; | ||
217 | -} | ||
218 | - | ||
219 | - | ||
220 | -var TRAILING_SLASH_HASH = /#\/?$/; | ||
221 | -function normalizeId(id) { | ||
222 | - return id ? id.replace(TRAILING_SLASH_HASH, '') : ''; | ||
223 | -} | ||
224 | - | ||
225 | - | ||
226 | -function resolveUrl(baseId, id) { | ||
227 | - id = normalizeId(id); | ||
228 | - return url.resolve(baseId, id); | ||
229 | -} | ||
230 | - | ||
231 | - | ||
232 | -/* @this Ajv */ | ||
233 | -function resolveIds(schema) { | ||
234 | - var schemaId = normalizeId(this._getId(schema)); | ||
235 | - var baseIds = {'': schemaId}; | ||
236 | - var fullPaths = {'': getFullPath(schemaId, false)}; | ||
237 | - var localRefs = {}; | ||
238 | - var self = this; | ||
239 | - | ||
240 | - traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { | ||
241 | - if (jsonPtr === '') return; | ||
242 | - var id = self._getId(sch); | ||
243 | - var baseId = baseIds[parentJsonPtr]; | ||
244 | - var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword; | ||
245 | - if (keyIndex !== undefined) | ||
246 | - fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex)); | ||
247 | - | ||
248 | - if (typeof id == 'string') { | ||
249 | - id = baseId = normalizeId(baseId ? url.resolve(baseId, id) : id); | ||
250 | - | ||
251 | - var refVal = self._refs[id]; | ||
252 | - if (typeof refVal == 'string') refVal = self._refs[refVal]; | ||
253 | - if (refVal && refVal.schema) { | ||
254 | - if (!equal(sch, refVal.schema)) | ||
255 | - throw new Error('id "' + id + '" resolves to more than one schema'); | ||
256 | - } else if (id != normalizeId(fullPath)) { | ||
257 | - if (id[0] == '#') { | ||
258 | - if (localRefs[id] && !equal(sch, localRefs[id])) | ||
259 | - throw new Error('id "' + id + '" resolves to more than one schema'); | ||
260 | - localRefs[id] = sch; | ||
261 | - } else { | ||
262 | - self._refs[id] = fullPath; | ||
263 | - } | ||
264 | - } | ||
265 | - } | ||
266 | - baseIds[jsonPtr] = baseId; | ||
267 | - fullPaths[jsonPtr] = fullPath; | ||
268 | - }); | ||
269 | - | ||
270 | - return localRefs; | ||
271 | -} |
1 | -'use strict'; | ||
2 | - | ||
3 | -var ruleModules = require('./_rules') | ||
4 | - , toHash = require('./util').toHash; | ||
5 | - | ||
6 | -module.exports = function rules() { | ||
7 | - var RULES = [ | ||
8 | - { type: 'number', | ||
9 | - rules: [ { 'maximum': ['exclusiveMaximum'] }, | ||
10 | - { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] }, | ||
11 | - { type: 'string', | ||
12 | - rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] }, | ||
13 | - { type: 'array', | ||
14 | - rules: [ 'maxItems', 'minItems', 'uniqueItems', 'contains', 'items' ] }, | ||
15 | - { type: 'object', | ||
16 | - rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames', | ||
17 | - { 'properties': ['additionalProperties', 'patternProperties'] } ] }, | ||
18 | - { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf' ] } | ||
19 | - ]; | ||
20 | - | ||
21 | - var ALL = [ 'type' ]; | ||
22 | - var KEYWORDS = [ | ||
23 | - 'additionalItems', '$schema', '$id', 'id', 'title', | ||
24 | - 'description', 'default', 'definitions' | ||
25 | - ]; | ||
26 | - var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; | ||
27 | - RULES.all = toHash(ALL); | ||
28 | - RULES.types = toHash(TYPES); | ||
29 | - | ||
30 | - RULES.forEach(function (group) { | ||
31 | - group.rules = group.rules.map(function (keyword) { | ||
32 | - var implKeywords; | ||
33 | - if (typeof keyword == 'object') { | ||
34 | - var key = Object.keys(keyword)[0]; | ||
35 | - implKeywords = keyword[key]; | ||
36 | - keyword = key; | ||
37 | - implKeywords.forEach(function (k) { | ||
38 | - ALL.push(k); | ||
39 | - RULES.all[k] = true; | ||
40 | - }); | ||
41 | - } | ||
42 | - ALL.push(keyword); | ||
43 | - var rule = RULES.all[keyword] = { | ||
44 | - keyword: keyword, | ||
45 | - code: ruleModules[keyword], | ||
46 | - implements: implKeywords | ||
47 | - }; | ||
48 | - return rule; | ||
49 | - }); | ||
50 | - | ||
51 | - if (group.type) RULES.types[group.type] = group; | ||
52 | - }); | ||
53 | - | ||
54 | - RULES.keywords = toHash(ALL.concat(KEYWORDS)); | ||
55 | - RULES.custom = {}; | ||
56 | - | ||
57 | - return RULES; | ||
58 | -}; |
1 | -'use strict'; | ||
2 | - | ||
3 | -// https://mathiasbynens.be/notes/javascript-encoding | ||
4 | -// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode | ||
5 | -module.exports = function ucs2length(str) { | ||
6 | - var length = 0 | ||
7 | - , len = str.length | ||
8 | - , pos = 0 | ||
9 | - , value; | ||
10 | - while (pos < len) { | ||
11 | - length++; | ||
12 | - value = str.charCodeAt(pos++); | ||
13 | - if (value >= 0xD800 && value <= 0xDBFF && pos < len) { | ||
14 | - // high surrogate, and there is a next character | ||
15 | - value = str.charCodeAt(pos); | ||
16 | - if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate | ||
17 | - } | ||
18 | - } | ||
19 | - return length; | ||
20 | -}; |
node_modules/ajv/lib/compile/util.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | - | ||
3 | - | ||
4 | -module.exports = { | ||
5 | - copy: copy, | ||
6 | - checkDataType: checkDataType, | ||
7 | - checkDataTypes: checkDataTypes, | ||
8 | - coerceToTypes: coerceToTypes, | ||
9 | - toHash: toHash, | ||
10 | - getProperty: getProperty, | ||
11 | - escapeQuotes: escapeQuotes, | ||
12 | - equal: require('fast-deep-equal'), | ||
13 | - ucs2length: require('./ucs2length'), | ||
14 | - varOccurences: varOccurences, | ||
15 | - varReplace: varReplace, | ||
16 | - cleanUpCode: cleanUpCode, | ||
17 | - finalCleanUpCode: finalCleanUpCode, | ||
18 | - schemaHasRules: schemaHasRules, | ||
19 | - schemaHasRulesExcept: schemaHasRulesExcept, | ||
20 | - toQuotedString: toQuotedString, | ||
21 | - getPathExpr: getPathExpr, | ||
22 | - getPath: getPath, | ||
23 | - getData: getData, | ||
24 | - unescapeFragment: unescapeFragment, | ||
25 | - unescapeJsonPointer: unescapeJsonPointer, | ||
26 | - escapeFragment: escapeFragment, | ||
27 | - escapeJsonPointer: escapeJsonPointer | ||
28 | -}; | ||
29 | - | ||
30 | - | ||
31 | -function copy(o, to) { | ||
32 | - to = to || {}; | ||
33 | - for (var key in o) to[key] = o[key]; | ||
34 | - return to; | ||
35 | -} | ||
36 | - | ||
37 | - | ||
38 | -function checkDataType(dataType, data, negate) { | ||
39 | - var EQUAL = negate ? ' !== ' : ' === ' | ||
40 | - , AND = negate ? ' || ' : ' && ' | ||
41 | - , OK = negate ? '!' : '' | ||
42 | - , NOT = negate ? '' : '!'; | ||
43 | - switch (dataType) { | ||
44 | - case 'null': return data + EQUAL + 'null'; | ||
45 | - case 'array': return OK + 'Array.isArray(' + data + ')'; | ||
46 | - case 'object': return '(' + OK + data + AND + | ||
47 | - 'typeof ' + data + EQUAL + '"object"' + AND + | ||
48 | - NOT + 'Array.isArray(' + data + '))'; | ||
49 | - case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + | ||
50 | - NOT + '(' + data + ' % 1)' + | ||
51 | - AND + data + EQUAL + data + ')'; | ||
52 | - default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; | ||
53 | - } | ||
54 | -} | ||
55 | - | ||
56 | - | ||
57 | -function checkDataTypes(dataTypes, data) { | ||
58 | - switch (dataTypes.length) { | ||
59 | - case 1: return checkDataType(dataTypes[0], data, true); | ||
60 | - default: | ||
61 | - var code = ''; | ||
62 | - var types = toHash(dataTypes); | ||
63 | - if (types.array && types.object) { | ||
64 | - code = types.null ? '(': '(!' + data + ' || '; | ||
65 | - code += 'typeof ' + data + ' !== "object")'; | ||
66 | - delete types.null; | ||
67 | - delete types.array; | ||
68 | - delete types.object; | ||
69 | - } | ||
70 | - if (types.number) delete types.integer; | ||
71 | - for (var t in types) | ||
72 | - code += (code ? ' && ' : '' ) + checkDataType(t, data, true); | ||
73 | - | ||
74 | - return code; | ||
75 | - } | ||
76 | -} | ||
77 | - | ||
78 | - | ||
79 | -var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); | ||
80 | -function coerceToTypes(optionCoerceTypes, dataTypes) { | ||
81 | - if (Array.isArray(dataTypes)) { | ||
82 | - var types = []; | ||
83 | - for (var i=0; i<dataTypes.length; i++) { | ||
84 | - var t = dataTypes[i]; | ||
85 | - if (COERCE_TO_TYPES[t]) types[types.length] = t; | ||
86 | - else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t; | ||
87 | - } | ||
88 | - if (types.length) return types; | ||
89 | - } else if (COERCE_TO_TYPES[dataTypes]) { | ||
90 | - return [dataTypes]; | ||
91 | - } else if (optionCoerceTypes === 'array' && dataTypes === 'array') { | ||
92 | - return ['array']; | ||
93 | - } | ||
94 | -} | ||
95 | - | ||
96 | - | ||
97 | -function toHash(arr) { | ||
98 | - var hash = {}; | ||
99 | - for (var i=0; i<arr.length; i++) hash[arr[i]] = true; | ||
100 | - return hash; | ||
101 | -} | ||
102 | - | ||
103 | - | ||
104 | -var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; | ||
105 | -var SINGLE_QUOTE = /'|\\/g; | ||
106 | -function getProperty(key) { | ||
107 | - return typeof key == 'number' | ||
108 | - ? '[' + key + ']' | ||
109 | - : IDENTIFIER.test(key) | ||
110 | - ? '.' + key | ||
111 | - : "['" + escapeQuotes(key) + "']"; | ||
112 | -} | ||
113 | - | ||
114 | - | ||
115 | -function escapeQuotes(str) { | ||
116 | - return str.replace(SINGLE_QUOTE, '\\$&') | ||
117 | - .replace(/\n/g, '\\n') | ||
118 | - .replace(/\r/g, '\\r') | ||
119 | - .replace(/\f/g, '\\f') | ||
120 | - .replace(/\t/g, '\\t'); | ||
121 | -} | ||
122 | - | ||
123 | - | ||
124 | -function varOccurences(str, dataVar) { | ||
125 | - dataVar += '[^0-9]'; | ||
126 | - var matches = str.match(new RegExp(dataVar, 'g')); | ||
127 | - return matches ? matches.length : 0; | ||
128 | -} | ||
129 | - | ||
130 | - | ||
131 | -function varReplace(str, dataVar, expr) { | ||
132 | - dataVar += '([^0-9])'; | ||
133 | - expr = expr.replace(/\$/g, '$$$$'); | ||
134 | - return str.replace(new RegExp(dataVar, 'g'), expr + '$1'); | ||
135 | -} | ||
136 | - | ||
137 | - | ||
138 | -var EMPTY_ELSE = /else\s*{\s*}/g | ||
139 | - , EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g | ||
140 | - , EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g; | ||
141 | -function cleanUpCode(out) { | ||
142 | - return out.replace(EMPTY_ELSE, '') | ||
143 | - .replace(EMPTY_IF_NO_ELSE, '') | ||
144 | - .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))'); | ||
145 | -} | ||
146 | - | ||
147 | - | ||
148 | -var ERRORS_REGEXP = /[^v.]errors/g | ||
149 | - , REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g | ||
150 | - , REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g | ||
151 | - , RETURN_VALID = 'return errors === 0;' | ||
152 | - , RETURN_TRUE = 'validate.errors = null; return true;' | ||
153 | - , RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/ | ||
154 | - , RETURN_DATA_ASYNC = 'return data;' | ||
155 | - , ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g | ||
156 | - , REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; | ||
157 | - | ||
158 | -function finalCleanUpCode(out, async) { | ||
159 | - var matches = out.match(ERRORS_REGEXP); | ||
160 | - if (matches && matches.length == 2) { | ||
161 | - out = async | ||
162 | - ? out.replace(REMOVE_ERRORS_ASYNC, '') | ||
163 | - .replace(RETURN_ASYNC, RETURN_DATA_ASYNC) | ||
164 | - : out.replace(REMOVE_ERRORS, '') | ||
165 | - .replace(RETURN_VALID, RETURN_TRUE); | ||
166 | - } | ||
167 | - | ||
168 | - matches = out.match(ROOTDATA_REGEXP); | ||
169 | - if (!matches || matches.length !== 3) return out; | ||
170 | - return out.replace(REMOVE_ROOTDATA, ''); | ||
171 | -} | ||
172 | - | ||
173 | - | ||
174 | -function schemaHasRules(schema, rules) { | ||
175 | - if (typeof schema == 'boolean') return !schema; | ||
176 | - for (var key in schema) if (rules[key]) return true; | ||
177 | -} | ||
178 | - | ||
179 | - | ||
180 | -function schemaHasRulesExcept(schema, rules, exceptKeyword) { | ||
181 | - if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not'; | ||
182 | - for (var key in schema) if (key != exceptKeyword && rules[key]) return true; | ||
183 | -} | ||
184 | - | ||
185 | - | ||
186 | -function toQuotedString(str) { | ||
187 | - return '\'' + escapeQuotes(str) + '\''; | ||
188 | -} | ||
189 | - | ||
190 | - | ||
191 | -function getPathExpr(currentPath, expr, jsonPointers, isNumber) { | ||
192 | - var path = jsonPointers // false by default | ||
193 | - ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')') | ||
194 | - : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\''); | ||
195 | - return joinPaths(currentPath, path); | ||
196 | -} | ||
197 | - | ||
198 | - | ||
199 | -function getPath(currentPath, prop, jsonPointers) { | ||
200 | - var path = jsonPointers // false by default | ||
201 | - ? toQuotedString('/' + escapeJsonPointer(prop)) | ||
202 | - : toQuotedString(getProperty(prop)); | ||
203 | - return joinPaths(currentPath, path); | ||
204 | -} | ||
205 | - | ||
206 | - | ||
207 | -var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; | ||
208 | -var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; | ||
209 | -function getData($data, lvl, paths) { | ||
210 | - var up, jsonPointer, data, matches; | ||
211 | - if ($data === '') return 'rootData'; | ||
212 | - if ($data[0] == '/') { | ||
213 | - if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data); | ||
214 | - jsonPointer = $data; | ||
215 | - data = 'rootData'; | ||
216 | - } else { | ||
217 | - matches = $data.match(RELATIVE_JSON_POINTER); | ||
218 | - if (!matches) throw new Error('Invalid JSON-pointer: ' + $data); | ||
219 | - up = +matches[1]; | ||
220 | - jsonPointer = matches[2]; | ||
221 | - if (jsonPointer == '#') { | ||
222 | - if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); | ||
223 | - return paths[lvl - up]; | ||
224 | - } | ||
225 | - | ||
226 | - if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); | ||
227 | - data = 'data' + ((lvl - up) || ''); | ||
228 | - if (!jsonPointer) return data; | ||
229 | - } | ||
230 | - | ||
231 | - var expr = data; | ||
232 | - var segments = jsonPointer.split('/'); | ||
233 | - for (var i=0; i<segments.length; i++) { | ||
234 | - var segment = segments[i]; | ||
235 | - if (segment) { | ||
236 | - data += getProperty(unescapeJsonPointer(segment)); | ||
237 | - expr += ' && ' + data; | ||
238 | - } | ||
239 | - } | ||
240 | - return expr; | ||
241 | -} | ||
242 | - | ||
243 | - | ||
244 | -function joinPaths (a, b) { | ||
245 | - if (a == '""') return b; | ||
246 | - return (a + ' + ' + b).replace(/' \+ '/g, ''); | ||
247 | -} | ||
248 | - | ||
249 | - | ||
250 | -function unescapeFragment(str) { | ||
251 | - return unescapeJsonPointer(decodeURIComponent(str)); | ||
252 | -} | ||
253 | - | ||
254 | - | ||
255 | -function escapeFragment(str) { | ||
256 | - return encodeURIComponent(escapeJsonPointer(str)); | ||
257 | -} | ||
258 | - | ||
259 | - | ||
260 | -function escapeJsonPointer(str) { | ||
261 | - return str.replace(/~/g, '~0').replace(/\//g, '~1'); | ||
262 | -} | ||
263 | - | ||
264 | - | ||
265 | -function unescapeJsonPointer(str) { | ||
266 | - return str.replace(/~1/g, '/').replace(/~0/g, '~'); | ||
267 | -} |
node_modules/ajv/lib/dot/_limit.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{## def.setExclusiveLimit: | ||
7 | - $exclusive = true; | ||
8 | - $errorKeyword = $exclusiveKeyword; | ||
9 | - $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; | ||
10 | -#}} | ||
11 | - | ||
12 | -{{ | ||
13 | - var $isMax = $keyword == 'maximum' | ||
14 | - , $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum' | ||
15 | - , $schemaExcl = it.schema[$exclusiveKeyword] | ||
16 | - , $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data | ||
17 | - , $op = $isMax ? '<' : '>' | ||
18 | - , $notOp = $isMax ? '>' : '<' | ||
19 | - , $errorKeyword = undefined; | ||
20 | -}} | ||
21 | - | ||
22 | -{{? $isDataExcl }} | ||
23 | - {{ | ||
24 | - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) | ||
25 | - , $exclusive = 'exclusive' + $lvl | ||
26 | - , $exclType = 'exclType' + $lvl | ||
27 | - , $exclIsNumber = 'exclIsNumber' + $lvl | ||
28 | - , $opExpr = 'op' + $lvl | ||
29 | - , $opStr = '\' + ' + $opExpr + ' + \''; | ||
30 | - }} | ||
31 | - var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; | ||
32 | - {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} | ||
33 | - | ||
34 | - var {{=$exclusive}}; | ||
35 | - var {{=$exclType}} = typeof {{=$schemaValueExcl}}; | ||
36 | - if ({{=$exclType}} != 'boolean' && {{=$exclType}} != 'undefined' && {{=$exclType}} != 'number') { | ||
37 | - {{ var $errorKeyword = $exclusiveKeyword; }} | ||
38 | - {{# def.error:'_exclusiveLimit' }} | ||
39 | - } else if ({{# def.$dataNotType:'number' }} | ||
40 | - {{=$exclType}} == 'number' | ||
41 | - ? ( | ||
42 | - ({{=$exclusive}} = {{=$schemaValue}} === undefined || {{=$schemaValueExcl}} {{=$op}}= {{=$schemaValue}}) | ||
43 | - ? {{=$data}} {{=$notOp}}= {{=$schemaValueExcl}} | ||
44 | - : {{=$data}} {{=$notOp}} {{=$schemaValue}} | ||
45 | - ) | ||
46 | - : ( | ||
47 | - ({{=$exclusive}} = {{=$schemaValueExcl}} === true) | ||
48 | - ? {{=$data}} {{=$notOp}}= {{=$schemaValue}} | ||
49 | - : {{=$data}} {{=$notOp}} {{=$schemaValue}} | ||
50 | - ) | ||
51 | - || {{=$data}} !== {{=$data}}) { | ||
52 | - var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; | ||
53 | -{{??}} | ||
54 | - {{ | ||
55 | - var $exclIsNumber = typeof $schemaExcl == 'number' | ||
56 | - , $opStr = $op; /*used in error*/ | ||
57 | - }} | ||
58 | - | ||
59 | - {{? $exclIsNumber && $isData }} | ||
60 | - {{ var $opExpr = '\'' + $opStr + '\''; /*used in error*/ }} | ||
61 | - if ({{# def.$dataNotType:'number' }} | ||
62 | - ( {{=$schemaValue}} === undefined | ||
63 | - || {{=$schemaExcl}} {{=$op}}= {{=$schemaValue}} | ||
64 | - ? {{=$data}} {{=$notOp}}= {{=$schemaExcl}} | ||
65 | - : {{=$data}} {{=$notOp}} {{=$schemaValue}} ) | ||
66 | - || {{=$data}} !== {{=$data}}) { | ||
67 | - {{??}} | ||
68 | - {{ | ||
69 | - if ($exclIsNumber && $schema === undefined) { | ||
70 | - {{# def.setExclusiveLimit }} | ||
71 | - $schemaValue = $schemaExcl; | ||
72 | - $notOp += '='; | ||
73 | - } else { | ||
74 | - if ($exclIsNumber) | ||
75 | - $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); | ||
76 | - | ||
77 | - if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { | ||
78 | - {{# def.setExclusiveLimit }} | ||
79 | - $notOp += '='; | ||
80 | - } else { | ||
81 | - $exclusive = false; | ||
82 | - $opStr += '='; | ||
83 | - } | ||
84 | - } | ||
85 | - | ||
86 | - var $opExpr = '\'' + $opStr + '\''; /*used in error*/ | ||
87 | - }} | ||
88 | - | ||
89 | - if ({{# def.$dataNotType:'number' }} | ||
90 | - {{=$data}} {{=$notOp}} {{=$schemaValue}} | ||
91 | - || {{=$data}} !== {{=$data}}) { | ||
92 | - {{?}} | ||
93 | -{{?}} | ||
94 | - {{ $errorKeyword = $errorKeyword || $keyword; }} | ||
95 | - {{# def.error:'_limit' }} | ||
96 | - } {{? $breakOnError }} else { {{?}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }} | ||
7 | -if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) { | ||
8 | - {{ var $errorKeyword = $keyword; }} | ||
9 | - {{# def.error:'_limitItems' }} | ||
10 | -} {{? $breakOnError }} else { {{?}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }} | ||
7 | -if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) { | ||
8 | - {{ var $errorKeyword = $keyword; }} | ||
9 | - {{# def.error:'_limitLength' }} | ||
10 | -} {{? $breakOnError }} else { {{?}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} | ||
7 | -if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { | ||
8 | - {{ var $errorKeyword = $keyword; }} | ||
9 | - {{# def.error:'_limitProperties' }} | ||
10 | -} {{? $breakOnError }} else { {{?}} |
node_modules/ajv/lib/dot/allOf.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.setupNextLevel }} | ||
5 | - | ||
6 | -{{ | ||
7 | - var $currentBaseId = $it.baseId | ||
8 | - , $allSchemasEmpty = true; | ||
9 | -}} | ||
10 | - | ||
11 | -{{~ $schema:$sch:$i }} | ||
12 | - {{? {{# def.nonEmptySchema:$sch }} }} | ||
13 | - {{ | ||
14 | - $allSchemasEmpty = false; | ||
15 | - $it.schema = $sch; | ||
16 | - $it.schemaPath = $schemaPath + '[' + $i + ']'; | ||
17 | - $it.errSchemaPath = $errSchemaPath + '/' + $i; | ||
18 | - }} | ||
19 | - | ||
20 | - {{# def.insertSubschemaCode }} | ||
21 | - | ||
22 | - {{# def.ifResultValid }} | ||
23 | - {{?}} | ||
24 | -{{~}} | ||
25 | - | ||
26 | -{{? $breakOnError }} | ||
27 | - {{? $allSchemasEmpty }} | ||
28 | - if (true) { | ||
29 | - {{??}} | ||
30 | - {{= $closingBraces.slice(0,-1) }} | ||
31 | - {{?}} | ||
32 | -{{?}} | ||
33 | - | ||
34 | -{{# def.cleanUp }} |
node_modules/ajv/lib/dot/anyOf.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.setupNextLevel }} | ||
5 | - | ||
6 | -{{ | ||
7 | - var $noEmptySchema = $schema.every(function($sch) { | ||
8 | - return {{# def.nonEmptySchema:$sch }}; | ||
9 | - }); | ||
10 | -}} | ||
11 | -{{? $noEmptySchema }} | ||
12 | - {{ var $currentBaseId = $it.baseId; }} | ||
13 | - var {{=$errs}} = errors; | ||
14 | - var {{=$valid}} = false; | ||
15 | - | ||
16 | - {{# def.setCompositeRule }} | ||
17 | - | ||
18 | - {{~ $schema:$sch:$i }} | ||
19 | - {{ | ||
20 | - $it.schema = $sch; | ||
21 | - $it.schemaPath = $schemaPath + '[' + $i + ']'; | ||
22 | - $it.errSchemaPath = $errSchemaPath + '/' + $i; | ||
23 | - }} | ||
24 | - | ||
25 | - {{# def.insertSubschemaCode }} | ||
26 | - | ||
27 | - {{=$valid}} = {{=$valid}} || {{=$nextValid}}; | ||
28 | - | ||
29 | - if (!{{=$valid}}) { | ||
30 | - {{ $closingBraces += '}'; }} | ||
31 | - {{~}} | ||
32 | - | ||
33 | - {{# def.resetCompositeRule }} | ||
34 | - | ||
35 | - {{= $closingBraces }} | ||
36 | - | ||
37 | - if (!{{=$valid}}) { | ||
38 | - {{# def.extraError:'anyOf' }} | ||
39 | - } else { | ||
40 | - {{# def.resetErrors }} | ||
41 | - {{? it.opts.allErrors }} } {{?}} | ||
42 | - | ||
43 | - {{# def.cleanUp }} | ||
44 | -{{??}} | ||
45 | - {{? $breakOnError }} | ||
46 | - if (true) { | ||
47 | - {{?}} | ||
48 | -{{?}} |
node_modules/ajv/lib/dot/coerce.def
deleted
100644 → 0
1 | -{{## def.coerceType: | ||
2 | - {{ | ||
3 | - var $dataType = 'dataType' + $lvl | ||
4 | - , $coerced = 'coerced' + $lvl; | ||
5 | - }} | ||
6 | - var {{=$dataType}} = typeof {{=$data}}; | ||
7 | - {{? it.opts.coerceTypes == 'array'}} | ||
8 | - if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array'; | ||
9 | - {{?}} | ||
10 | - | ||
11 | - var {{=$coerced}} = undefined; | ||
12 | - | ||
13 | - {{ var $bracesCoercion = ''; }} | ||
14 | - {{~ $coerceToTypes:$type:$i }} | ||
15 | - {{? $i }} | ||
16 | - if ({{=$coerced}} === undefined) { | ||
17 | - {{ $bracesCoercion += '}'; }} | ||
18 | - {{?}} | ||
19 | - | ||
20 | - {{? it.opts.coerceTypes == 'array' && $type != 'array' }} | ||
21 | - if ({{=$dataType}} == 'array' && {{=$data}}.length == 1) { | ||
22 | - {{=$coerced}} = {{=$data}} = {{=$data}}[0]; | ||
23 | - {{=$dataType}} = typeof {{=$data}}; | ||
24 | - /*if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array';*/ | ||
25 | - } | ||
26 | - {{?}} | ||
27 | - | ||
28 | - {{? $type == 'string' }} | ||
29 | - if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean') | ||
30 | - {{=$coerced}} = '' + {{=$data}}; | ||
31 | - else if ({{=$data}} === null) {{=$coerced}} = ''; | ||
32 | - {{?? $type == 'number' || $type == 'integer' }} | ||
33 | - if ({{=$dataType}} == 'boolean' || {{=$data}} === null | ||
34 | - || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}} | ||
35 | - {{? $type == 'integer' }} && !({{=$data}} % 1){{?}})) | ||
36 | - {{=$coerced}} = +{{=$data}}; | ||
37 | - {{?? $type == 'boolean' }} | ||
38 | - if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null) | ||
39 | - {{=$coerced}} = false; | ||
40 | - else if ({{=$data}} === 'true' || {{=$data}} === 1) | ||
41 | - {{=$coerced}} = true; | ||
42 | - {{?? $type == 'null' }} | ||
43 | - if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false) | ||
44 | - {{=$coerced}} = null; | ||
45 | - {{?? it.opts.coerceTypes == 'array' && $type == 'array' }} | ||
46 | - if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null) | ||
47 | - {{=$coerced}} = [{{=$data}}]; | ||
48 | - {{?}} | ||
49 | - {{~}} | ||
50 | - | ||
51 | - {{= $bracesCoercion }} | ||
52 | - | ||
53 | - if ({{=$coerced}} === undefined) { | ||
54 | - {{# def.error:'type' }} | ||
55 | - } else { | ||
56 | - {{# def.setParentData }} | ||
57 | - {{=$data}} = {{=$coerced}}; | ||
58 | - {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}} | ||
59 | - {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}}; | ||
60 | - } | ||
61 | -#}} |
node_modules/ajv/lib/dot/const.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{? !$isData }} | ||
7 | - var schema{{=$lvl}} = validate.schema{{=$schemaPath}}; | ||
8 | -{{?}} | ||
9 | -var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}}); | ||
10 | -{{# def.checkError:'const' }} | ||
11 | -{{? $breakOnError }} else { {{?}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.setupNextLevel }} | ||
5 | - | ||
6 | - | ||
7 | -{{ | ||
8 | - var $idx = 'i' + $lvl | ||
9 | - , $dataNxt = $it.dataLevel = it.dataLevel + 1 | ||
10 | - , $nextData = 'data' + $dataNxt | ||
11 | - , $currentBaseId = it.baseId | ||
12 | - , $nonEmptySchema = {{# def.nonEmptySchema:$schema }}; | ||
13 | -}} | ||
14 | - | ||
15 | -var {{=$errs}} = errors; | ||
16 | -var {{=$valid}}; | ||
17 | - | ||
18 | -{{? $nonEmptySchema }} | ||
19 | - {{# def.setCompositeRule }} | ||
20 | - | ||
21 | - {{ | ||
22 | - $it.schema = $schema; | ||
23 | - $it.schemaPath = $schemaPath; | ||
24 | - $it.errSchemaPath = $errSchemaPath; | ||
25 | - }} | ||
26 | - | ||
27 | - var {{=$nextValid}} = false; | ||
28 | - | ||
29 | - for (var {{=$idx}} = 0; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { | ||
30 | - {{ | ||
31 | - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); | ||
32 | - var $passData = $data + '[' + $idx + ']'; | ||
33 | - $it.dataPathArr[$dataNxt] = $idx; | ||
34 | - }} | ||
35 | - | ||
36 | - {{# def.generateSubschemaCode }} | ||
37 | - {{# def.optimizeValidate }} | ||
38 | - | ||
39 | - if ({{=$nextValid}}) break; | ||
40 | - } | ||
41 | - | ||
42 | - {{# def.resetCompositeRule }} | ||
43 | - {{= $closingBraces }} | ||
44 | - | ||
45 | - if (!{{=$nextValid}}) { | ||
46 | -{{??}} | ||
47 | - if ({{=$data}}.length == 0) { | ||
48 | -{{?}} | ||
49 | - | ||
50 | - {{# def.error:'contains' }} | ||
51 | - } else { | ||
52 | - {{? $nonEmptySchema }} | ||
53 | - {{# def.resetErrors }} | ||
54 | - {{?}} | ||
55 | - {{? it.opts.allErrors }} } {{?}} | ||
56 | - | ||
57 | -{{# def.cleanUp }} |
node_modules/ajv/lib/dot/custom.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{ | ||
7 | - var $rule = this | ||
8 | - , $definition = 'definition' + $lvl | ||
9 | - , $rDef = $rule.definition | ||
10 | - , $closingBraces = ''; | ||
11 | - var $validate = $rDef.validate; | ||
12 | - var $compile, $inline, $macro, $ruleValidate, $validateCode; | ||
13 | -}} | ||
14 | - | ||
15 | -{{? $isData && $rDef.$data }} | ||
16 | - {{ | ||
17 | - $validateCode = 'keywordValidate' + $lvl; | ||
18 | - var $validateSchema = $rDef.validateSchema; | ||
19 | - }} | ||
20 | - var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition; | ||
21 | - var {{=$validateCode}} = {{=$definition}}.validate; | ||
22 | -{{??}} | ||
23 | - {{ | ||
24 | - $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); | ||
25 | - if (!$ruleValidate) return; | ||
26 | - $schemaValue = 'validate.schema' + $schemaPath; | ||
27 | - $validateCode = $ruleValidate.code; | ||
28 | - $compile = $rDef.compile; | ||
29 | - $inline = $rDef.inline; | ||
30 | - $macro = $rDef.macro; | ||
31 | - }} | ||
32 | -{{?}} | ||
33 | - | ||
34 | -{{ | ||
35 | - var $ruleErrs = $validateCode + '.errors' | ||
36 | - , $i = 'i' + $lvl | ||
37 | - , $ruleErr = 'ruleErr' + $lvl | ||
38 | - , $asyncKeyword = $rDef.async; | ||
39 | - | ||
40 | - if ($asyncKeyword && !it.async) | ||
41 | - throw new Error('async keyword in sync schema'); | ||
42 | -}} | ||
43 | - | ||
44 | - | ||
45 | -{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}} | ||
46 | -var {{=$errs}} = errors; | ||
47 | -var {{=$valid}}; | ||
48 | - | ||
49 | -{{## def.callRuleValidate: | ||
50 | - {{=$validateCode}}.call( | ||
51 | - {{? it.opts.passContext }}this{{??}}self{{?}} | ||
52 | - {{? $compile || $rDef.schema === false }} | ||
53 | - , {{=$data}} | ||
54 | - {{??}} | ||
55 | - , {{=$schemaValue}} | ||
56 | - , {{=$data}} | ||
57 | - , validate.schema{{=it.schemaPath}} | ||
58 | - {{?}} | ||
59 | - , {{# def.dataPath }} | ||
60 | - {{# def.passParentData }} | ||
61 | - , rootData | ||
62 | - ) | ||
63 | -#}} | ||
64 | - | ||
65 | -{{## def.extendErrors:_inline: | ||
66 | - for (var {{=$i}}={{=$errs}}; {{=$i}}<errors; {{=$i}}++) { | ||
67 | - var {{=$ruleErr}} = vErrors[{{=$i}}]; | ||
68 | - if ({{=$ruleErr}}.dataPath === undefined) | ||
69 | - {{=$ruleErr}}.dataPath = (dataPath || '') + {{= it.errorPath }}; | ||
70 | - {{# _inline ? 'if (\{\{=$ruleErr\}\}.schemaPath === undefined) {' : '' }} | ||
71 | - {{=$ruleErr}}.schemaPath = "{{=$errSchemaPath}}"; | ||
72 | - {{# _inline ? '}' : '' }} | ||
73 | - {{? it.opts.verbose }} | ||
74 | - {{=$ruleErr}}.schema = {{=$schemaValue}}; | ||
75 | - {{=$ruleErr}}.data = {{=$data}}; | ||
76 | - {{?}} | ||
77 | - } | ||
78 | -#}} | ||
79 | - | ||
80 | - | ||
81 | -{{? $isData && $rDef.$data }} | ||
82 | - {{ $closingBraces += '}'; }} | ||
83 | - if ({{=$schemaValue}} === undefined) { | ||
84 | - {{=$valid}} = true; | ||
85 | - } else { | ||
86 | - {{? $validateSchema }} | ||
87 | - {{ $closingBraces += '}'; }} | ||
88 | - {{=$valid}} = {{=$definition}}.validateSchema({{=$schemaValue}}); | ||
89 | - if ({{=$valid}}) { | ||
90 | - {{?}} | ||
91 | -{{?}} | ||
92 | - | ||
93 | -{{? $inline }} | ||
94 | - {{? $rDef.statements }} | ||
95 | - {{= $ruleValidate.validate }} | ||
96 | - {{??}} | ||
97 | - {{=$valid}} = {{= $ruleValidate.validate }}; | ||
98 | - {{?}} | ||
99 | -{{?? $macro }} | ||
100 | - {{# def.setupNextLevel }} | ||
101 | - {{ | ||
102 | - $it.schema = $ruleValidate.validate; | ||
103 | - $it.schemaPath = ''; | ||
104 | - }} | ||
105 | - {{# def.setCompositeRule }} | ||
106 | - {{ var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); }} | ||
107 | - {{# def.resetCompositeRule }} | ||
108 | - {{= $code }} | ||
109 | -{{??}} | ||
110 | - {{# def.beginDefOut}} | ||
111 | - {{# def.callRuleValidate }} | ||
112 | - {{# def.storeDefOut:def_callRuleValidate }} | ||
113 | - | ||
114 | - {{? $rDef.errors === false }} | ||
115 | - {{=$valid}} = {{? $asyncKeyword }}{{=it.yieldAwait}}{{?}}{{= def_callRuleValidate }}; | ||
116 | - {{??}} | ||
117 | - {{? $asyncKeyword }} | ||
118 | - {{ $ruleErrs = 'customErrors' + $lvl; }} | ||
119 | - var {{=$ruleErrs}} = null; | ||
120 | - try { | ||
121 | - {{=$valid}} = {{=it.yieldAwait}}{{= def_callRuleValidate }}; | ||
122 | - } catch (e) { | ||
123 | - {{=$valid}} = false; | ||
124 | - if (e instanceof ValidationError) {{=$ruleErrs}} = e.errors; | ||
125 | - else throw e; | ||
126 | - } | ||
127 | - {{??}} | ||
128 | - {{=$ruleErrs}} = null; | ||
129 | - {{=$valid}} = {{= def_callRuleValidate }}; | ||
130 | - {{?}} | ||
131 | - {{?}} | ||
132 | -{{?}} | ||
133 | - | ||
134 | -{{? $rDef.modifying }} | ||
135 | - if ({{=$parentData}}) {{=$data}} = {{=$parentData}}[{{=$parentDataProperty}}]; | ||
136 | -{{?}} | ||
137 | - | ||
138 | -{{= $closingBraces }} | ||
139 | - | ||
140 | -{{## def.notValidationResult: | ||
141 | - {{? $rDef.valid === undefined }} | ||
142 | - !{{? $macro }}{{=$nextValid}}{{??}}{{=$valid}}{{?}} | ||
143 | - {{??}} | ||
144 | - {{= !$rDef.valid }} | ||
145 | - {{?}} | ||
146 | -#}} | ||
147 | - | ||
148 | -{{? $rDef.valid }} | ||
149 | - {{? $breakOnError }} if (true) { {{?}} | ||
150 | -{{??}} | ||
151 | - if ({{# def.notValidationResult }}) { | ||
152 | - {{ $errorKeyword = $rule.keyword; }} | ||
153 | - {{# def.beginDefOut}} | ||
154 | - {{# def.error:'custom' }} | ||
155 | - {{# def.storeDefOut:def_customError }} | ||
156 | - | ||
157 | - {{? $inline }} | ||
158 | - {{? $rDef.errors }} | ||
159 | - {{? $rDef.errors != 'full' }} | ||
160 | - {{# def.extendErrors:true }} | ||
161 | - {{?}} | ||
162 | - {{??}} | ||
163 | - {{? $rDef.errors === false}} | ||
164 | - {{= def_customError }} | ||
165 | - {{??}} | ||
166 | - if ({{=$errs}} == errors) { | ||
167 | - {{= def_customError }} | ||
168 | - } else { | ||
169 | - {{# def.extendErrors:true }} | ||
170 | - } | ||
171 | - {{?}} | ||
172 | - {{?}} | ||
173 | - {{?? $macro }} | ||
174 | - {{# def.extraError:'custom' }} | ||
175 | - {{??}} | ||
176 | - {{? $rDef.errors === false}} | ||
177 | - {{= def_customError }} | ||
178 | - {{??}} | ||
179 | - if (Array.isArray({{=$ruleErrs}})) { | ||
180 | - if (vErrors === null) vErrors = {{=$ruleErrs}}; | ||
181 | - else vErrors = vErrors.concat({{=$ruleErrs}}); | ||
182 | - errors = vErrors.length; | ||
183 | - {{# def.extendErrors:false }} | ||
184 | - } else { | ||
185 | - {{= def_customError }} | ||
186 | - } | ||
187 | - {{?}} | ||
188 | - {{?}} | ||
189 | - | ||
190 | - } {{? $breakOnError }} else { {{?}} | ||
191 | -{{?}} |
1 | -{{## def.assignDefault: | ||
2 | - if ({{=$passData}} === undefined) | ||
3 | - {{=$passData}} = {{? it.opts.useDefaults == 'shared' }} | ||
4 | - {{= it.useDefault($sch.default) }} | ||
5 | - {{??}} | ||
6 | - {{= JSON.stringify($sch.default) }} | ||
7 | - {{?}}; | ||
8 | -#}} | ||
9 | - | ||
10 | - | ||
11 | -{{## def.defaultProperties: | ||
12 | - {{ | ||
13 | - var $schema = it.schema.properties | ||
14 | - , $schemaKeys = Object.keys($schema); }} | ||
15 | - {{~ $schemaKeys:$propertyKey }} | ||
16 | - {{ var $sch = $schema[$propertyKey]; }} | ||
17 | - {{? $sch.default !== undefined }} | ||
18 | - {{ var $passData = $data + it.util.getProperty($propertyKey); }} | ||
19 | - {{# def.assignDefault }} | ||
20 | - {{?}} | ||
21 | - {{~}} | ||
22 | -#}} | ||
23 | - | ||
24 | - | ||
25 | -{{## def.defaultItems: | ||
26 | - {{~ it.schema.items:$sch:$i }} | ||
27 | - {{? $sch.default !== undefined }} | ||
28 | - {{ var $passData = $data + '[' + $i + ']'; }} | ||
29 | - {{# def.assignDefault }} | ||
30 | - {{?}} | ||
31 | - {{~}} | ||
32 | -#}} |
1 | -{{## def.setupKeyword: | ||
2 | - {{ | ||
3 | - var $lvl = it.level; | ||
4 | - var $dataLvl = it.dataLevel; | ||
5 | - var $schema = it.schema[$keyword]; | ||
6 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
7 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
8 | - var $breakOnError = !it.opts.allErrors; | ||
9 | - var $errorKeyword; | ||
10 | - | ||
11 | - var $data = 'data' + ($dataLvl || ''); | ||
12 | - var $valid = 'valid' + $lvl; | ||
13 | - var $errs = 'errs__' + $lvl; | ||
14 | - }} | ||
15 | -#}} | ||
16 | - | ||
17 | - | ||
18 | -{{## def.setCompositeRule: | ||
19 | - {{ | ||
20 | - var $wasComposite = it.compositeRule; | ||
21 | - it.compositeRule = $it.compositeRule = true; | ||
22 | - }} | ||
23 | -#}} | ||
24 | - | ||
25 | - | ||
26 | -{{## def.resetCompositeRule: | ||
27 | - {{ it.compositeRule = $it.compositeRule = $wasComposite; }} | ||
28 | -#}} | ||
29 | - | ||
30 | - | ||
31 | -{{## def.setupNextLevel: | ||
32 | - {{ | ||
33 | - var $it = it.util.copy(it); | ||
34 | - var $closingBraces = ''; | ||
35 | - $it.level++; | ||
36 | - var $nextValid = 'valid' + $it.level; | ||
37 | - }} | ||
38 | -#}} | ||
39 | - | ||
40 | - | ||
41 | -{{## def.ifValid: | ||
42 | - {{? $breakOnError }} | ||
43 | - if ({{=$valid}}) { | ||
44 | - {{ $closingBraces += '}'; }} | ||
45 | - {{?}} | ||
46 | -#}} | ||
47 | - | ||
48 | - | ||
49 | -{{## def.ifResultValid: | ||
50 | - {{? $breakOnError }} | ||
51 | - if ({{=$nextValid}}) { | ||
52 | - {{ $closingBraces += '}'; }} | ||
53 | - {{?}} | ||
54 | -#}} | ||
55 | - | ||
56 | - | ||
57 | -{{## def.elseIfValid: | ||
58 | - {{? $breakOnError }} | ||
59 | - {{ $closingBraces += '}'; }} | ||
60 | - else { | ||
61 | - {{?}} | ||
62 | -#}} | ||
63 | - | ||
64 | - | ||
65 | -{{## def.nonEmptySchema:_schema: | ||
66 | - it.util.schemaHasRules(_schema, it.RULES.all) | ||
67 | -#}} | ||
68 | - | ||
69 | - | ||
70 | -{{## def.strLength: | ||
71 | - {{? it.opts.unicode === false }} | ||
72 | - {{=$data}}.length | ||
73 | - {{??}} | ||
74 | - ucs2length({{=$data}}) | ||
75 | - {{?}} | ||
76 | -#}} | ||
77 | - | ||
78 | - | ||
79 | -{{## def.willOptimize: | ||
80 | - it.util.varOccurences($code, $nextData) < 2 | ||
81 | -#}} | ||
82 | - | ||
83 | - | ||
84 | -{{## def.generateSubschemaCode: | ||
85 | - {{ | ||
86 | - var $code = it.validate($it); | ||
87 | - $it.baseId = $currentBaseId; | ||
88 | - }} | ||
89 | -#}} | ||
90 | - | ||
91 | - | ||
92 | -{{## def.insertSubschemaCode: | ||
93 | - {{= it.validate($it) }} | ||
94 | - {{ $it.baseId = $currentBaseId; }} | ||
95 | -#}} | ||
96 | - | ||
97 | - | ||
98 | -{{## def._optimizeValidate: | ||
99 | - it.util.varReplace($code, $nextData, $passData) | ||
100 | -#}} | ||
101 | - | ||
102 | - | ||
103 | -{{## def.optimizeValidate: | ||
104 | - {{? {{# def.willOptimize}} }} | ||
105 | - {{= {{# def._optimizeValidate }} }} | ||
106 | - {{??}} | ||
107 | - var {{=$nextData}} = {{=$passData}}; | ||
108 | - {{= $code }} | ||
109 | - {{?}} | ||
110 | -#}} | ||
111 | - | ||
112 | - | ||
113 | -{{## def.cleanUp: {{ out = it.util.cleanUpCode(out); }} #}} | ||
114 | - | ||
115 | - | ||
116 | -{{## def.finalCleanUp: {{ out = it.util.finalCleanUpCode(out, $async); }} #}} | ||
117 | - | ||
118 | - | ||
119 | -{{## def.$data: | ||
120 | - {{ | ||
121 | - var $isData = it.opts.$data && $schema && $schema.$data | ||
122 | - , $schemaValue; | ||
123 | - }} | ||
124 | - {{? $isData }} | ||
125 | - var schema{{=$lvl}} = {{= it.util.getData($schema.$data, $dataLvl, it.dataPathArr) }}; | ||
126 | - {{ $schemaValue = 'schema' + $lvl; }} | ||
127 | - {{??}} | ||
128 | - {{ $schemaValue = $schema; }} | ||
129 | - {{?}} | ||
130 | -#}} | ||
131 | - | ||
132 | - | ||
133 | -{{## def.$dataNotType:_type: | ||
134 | - {{?$isData}} ({{=$schemaValue}} !== undefined && typeof {{=$schemaValue}} != _type) || {{?}} | ||
135 | -#}} | ||
136 | - | ||
137 | - | ||
138 | -{{## def.check$dataIsArray: | ||
139 | - if (schema{{=$lvl}} === undefined) {{=$valid}} = true; | ||
140 | - else if (!Array.isArray(schema{{=$lvl}})) {{=$valid}} = false; | ||
141 | - else { | ||
142 | -#}} | ||
143 | - | ||
144 | - | ||
145 | -{{## def.beginDefOut: | ||
146 | - {{ | ||
147 | - var $$outStack = $$outStack || []; | ||
148 | - $$outStack.push(out); | ||
149 | - out = ''; | ||
150 | - }} | ||
151 | -#}} | ||
152 | - | ||
153 | - | ||
154 | -{{## def.storeDefOut:_variable: | ||
155 | - {{ | ||
156 | - var _variable = out; | ||
157 | - out = $$outStack.pop(); | ||
158 | - }} | ||
159 | -#}} | ||
160 | - | ||
161 | - | ||
162 | -{{## def.dataPath:(dataPath || ''){{? it.errorPath != '""'}} + {{= it.errorPath }}{{?}}#}} | ||
163 | - | ||
164 | -{{## def.setParentData: | ||
165 | - {{ | ||
166 | - var $parentData = $dataLvl ? 'data' + (($dataLvl-1)||'') : 'parentData' | ||
167 | - , $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; | ||
168 | - }} | ||
169 | -#}} | ||
170 | - | ||
171 | -{{## def.passParentData: | ||
172 | - {{# def.setParentData }} | ||
173 | - , {{= $parentData }} | ||
174 | - , {{= $parentDataProperty }} | ||
175 | -#}} | ||
176 | - | ||
177 | - | ||
178 | -{{## def.iterateProperties: | ||
179 | - {{? $ownProperties }} | ||
180 | - {{=$dataProperties}} = {{=$dataProperties}} || Object.keys({{=$data}}); | ||
181 | - for (var {{=$idx}}=0; {{=$idx}}<{{=$dataProperties}}.length; {{=$idx}}++) { | ||
182 | - var {{=$key}} = {{=$dataProperties}}[{{=$idx}}]; | ||
183 | - {{??}} | ||
184 | - for (var {{=$key}} in {{=$data}}) { | ||
185 | - {{?}} | ||
186 | -#}} | ||
187 | - | ||
188 | - | ||
189 | -{{## def.noPropertyInData: | ||
190 | - {{=$useData}} === undefined | ||
191 | - {{? $ownProperties }} | ||
192 | - || !{{# def.isOwnProperty }} | ||
193 | - {{?}} | ||
194 | -#}} | ||
195 | - | ||
196 | - | ||
197 | -{{## def.isOwnProperty: | ||
198 | - Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($propertyKey)}}') | ||
199 | -#}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.missing }} | ||
4 | -{{# def.setupKeyword }} | ||
5 | -{{# def.setupNextLevel }} | ||
6 | - | ||
7 | - | ||
8 | -{{## def.propertyInData: | ||
9 | - {{=$data}}{{= it.util.getProperty($property) }} !== undefined | ||
10 | - {{? $ownProperties }} | ||
11 | - && Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($property)}}') | ||
12 | - {{?}} | ||
13 | -#}} | ||
14 | - | ||
15 | - | ||
16 | -{{ | ||
17 | - var $schemaDeps = {} | ||
18 | - , $propertyDeps = {} | ||
19 | - , $ownProperties = it.opts.ownProperties; | ||
20 | - | ||
21 | - for ($property in $schema) { | ||
22 | - var $sch = $schema[$property]; | ||
23 | - var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; | ||
24 | - $deps[$property] = $sch; | ||
25 | - } | ||
26 | -}} | ||
27 | - | ||
28 | -var {{=$errs}} = errors; | ||
29 | - | ||
30 | -{{ var $currentErrorPath = it.errorPath; }} | ||
31 | - | ||
32 | -var missing{{=$lvl}}; | ||
33 | -{{ for (var $property in $propertyDeps) { }} | ||
34 | - {{ $deps = $propertyDeps[$property]; }} | ||
35 | - {{? $deps.length }} | ||
36 | - if ({{# def.propertyInData }} | ||
37 | - {{? $breakOnError }} | ||
38 | - && ({{# def.checkMissingProperty:$deps }})) { | ||
39 | - {{# def.errorMissingProperty:'dependencies' }} | ||
40 | - {{??}} | ||
41 | - ) { | ||
42 | - {{~ $deps:$propertyKey }} | ||
43 | - {{# def.allErrorsMissingProperty:'dependencies' }} | ||
44 | - {{~}} | ||
45 | - {{?}} | ||
46 | - } {{# def.elseIfValid }} | ||
47 | - {{?}} | ||
48 | -{{ } }} | ||
49 | - | ||
50 | -{{ | ||
51 | - it.errorPath = $currentErrorPath; | ||
52 | - var $currentBaseId = $it.baseId; | ||
53 | -}} | ||
54 | - | ||
55 | - | ||
56 | -{{ for (var $property in $schemaDeps) { }} | ||
57 | - {{ var $sch = $schemaDeps[$property]; }} | ||
58 | - {{? {{# def.nonEmptySchema:$sch }} }} | ||
59 | - {{=$nextValid}} = true; | ||
60 | - | ||
61 | - if ({{# def.propertyInData }}) { | ||
62 | - {{ | ||
63 | - $it.schema = $sch; | ||
64 | - $it.schemaPath = $schemaPath + it.util.getProperty($property); | ||
65 | - $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); | ||
66 | - }} | ||
67 | - | ||
68 | - {{# def.insertSubschemaCode }} | ||
69 | - } | ||
70 | - | ||
71 | - {{# def.ifResultValid }} | ||
72 | - {{?}} | ||
73 | -{{ } }} | ||
74 | - | ||
75 | -{{? $breakOnError }} | ||
76 | - {{= $closingBraces }} | ||
77 | - if ({{=$errs}} == errors) { | ||
78 | -{{?}} | ||
79 | - | ||
80 | -{{# def.cleanUp }} |
node_modules/ajv/lib/dot/enum.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{ | ||
7 | - var $i = 'i' + $lvl | ||
8 | - , $vSchema = 'schema' + $lvl; | ||
9 | -}} | ||
10 | - | ||
11 | -{{? !$isData }} | ||
12 | - var {{=$vSchema}} = validate.schema{{=$schemaPath}}; | ||
13 | -{{?}} | ||
14 | -var {{=$valid}}; | ||
15 | - | ||
16 | -{{?$isData}}{{# def.check$dataIsArray }}{{?}} | ||
17 | - | ||
18 | -{{=$valid}} = false; | ||
19 | - | ||
20 | -for (var {{=$i}}=0; {{=$i}}<{{=$vSchema}}.length; {{=$i}}++) | ||
21 | - if (equal({{=$data}}, {{=$vSchema}}[{{=$i}}])) { | ||
22 | - {{=$valid}} = true; | ||
23 | - break; | ||
24 | - } | ||
25 | - | ||
26 | -{{? $isData }} } {{?}} | ||
27 | - | ||
28 | -{{# def.checkError:'enum' }} | ||
29 | - | ||
30 | -{{? $breakOnError }} else { {{?}} |
node_modules/ajv/lib/dot/errors.def
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | - | ||
3 | -{{## def._error:_rule: | ||
4 | - {{ 'istanbul ignore else'; }} | ||
5 | - {{? it.createErrors !== false }} | ||
6 | - { | ||
7 | - keyword: '{{= $errorKeyword || _rule }}' | ||
8 | - , dataPath: (dataPath || '') + {{= it.errorPath }} | ||
9 | - , schemaPath: {{=it.util.toQuotedString($errSchemaPath)}} | ||
10 | - , params: {{# def._errorParams[_rule] }} | ||
11 | - {{? it.opts.messages !== false }} | ||
12 | - , message: {{# def._errorMessages[_rule] }} | ||
13 | - {{?}} | ||
14 | - {{? it.opts.verbose }} | ||
15 | - , schema: {{# def._errorSchemas[_rule] }} | ||
16 | - , parentSchema: validate.schema{{=it.schemaPath}} | ||
17 | - , data: {{=$data}} | ||
18 | - {{?}} | ||
19 | - } | ||
20 | - {{??}} | ||
21 | - {} | ||
22 | - {{?}} | ||
23 | -#}} | ||
24 | - | ||
25 | - | ||
26 | -{{## def._addError:_rule: | ||
27 | - if (vErrors === null) vErrors = [err]; | ||
28 | - else vErrors.push(err); | ||
29 | - errors++; | ||
30 | -#}} | ||
31 | - | ||
32 | - | ||
33 | -{{## def.addError:_rule: | ||
34 | - var err = {{# def._error:_rule }}; | ||
35 | - {{# def._addError:_rule }} | ||
36 | -#}} | ||
37 | - | ||
38 | - | ||
39 | -{{## def.error:_rule: | ||
40 | - {{# def.beginDefOut}} | ||
41 | - {{# def._error:_rule }} | ||
42 | - {{# def.storeDefOut:__err }} | ||
43 | - | ||
44 | - {{? !it.compositeRule && $breakOnError }} | ||
45 | - {{ 'istanbul ignore if'; }} | ||
46 | - {{? it.async }} | ||
47 | - throw new ValidationError([{{=__err}}]); | ||
48 | - {{??}} | ||
49 | - validate.errors = [{{=__err}}]; | ||
50 | - return false; | ||
51 | - {{?}} | ||
52 | - {{??}} | ||
53 | - var err = {{=__err}}; | ||
54 | - {{# def._addError:_rule }} | ||
55 | - {{?}} | ||
56 | -#}} | ||
57 | - | ||
58 | - | ||
59 | -{{## def.extraError:_rule: | ||
60 | - {{# def.addError:_rule}} | ||
61 | - {{? !it.compositeRule && $breakOnError }} | ||
62 | - {{ 'istanbul ignore if'; }} | ||
63 | - {{? it.async }} | ||
64 | - throw new ValidationError(vErrors); | ||
65 | - {{??}} | ||
66 | - validate.errors = vErrors; | ||
67 | - return false; | ||
68 | - {{?}} | ||
69 | - {{?}} | ||
70 | -#}} | ||
71 | - | ||
72 | - | ||
73 | -{{## def.checkError:_rule: | ||
74 | - if (!{{=$valid}}) { | ||
75 | - {{# def.error:_rule }} | ||
76 | - } | ||
77 | -#}} | ||
78 | - | ||
79 | - | ||
80 | -{{## def.resetErrors: | ||
81 | - errors = {{=$errs}}; | ||
82 | - if (vErrors !== null) { | ||
83 | - if ({{=$errs}}) vErrors.length = {{=$errs}}; | ||
84 | - else vErrors = null; | ||
85 | - } | ||
86 | -#}} | ||
87 | - | ||
88 | - | ||
89 | -{{## def.concatSchema:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=$schema}}{{?}}#}} | ||
90 | -{{## def.appendSchema:{{?$isData}}' + {{=$schemaValue}}{{??}}{{=$schemaValue}}'{{?}}#}} | ||
91 | -{{## def.concatSchemaEQ:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=it.util.escapeQuotes($schema)}}{{?}}#}} | ||
92 | - | ||
93 | -{{## def._errorMessages = { | ||
94 | - 'false schema': "'boolean schema is false'", | ||
95 | - $ref: "'can\\\'t resolve reference {{=it.util.escapeQuotes($schema)}}'", | ||
96 | - additionalItems: "'should NOT have more than {{=$schema.length}} items'", | ||
97 | - additionalProperties: "'should NOT have additional properties'", | ||
98 | - anyOf: "'should match some schema in anyOf'", | ||
99 | - const: "'should be equal to constant'", | ||
100 | - contains: "'should contain a valid item'", | ||
101 | - dependencies: "'should have {{? $deps.length == 1 }}property {{= it.util.escapeQuotes($deps[0]) }}{{??}}properties {{= it.util.escapeQuotes($deps.join(\", \")) }}{{?}} when property {{= it.util.escapeQuotes($property) }} is present'", | ||
102 | - 'enum': "'should be equal to one of the allowed values'", | ||
103 | - format: "'should match format \"{{#def.concatSchemaEQ}}\"'", | ||
104 | - _limit: "'should be {{=$opStr}} {{#def.appendSchema}}", | ||
105 | - _exclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'", | ||
106 | - _limitItems: "'should NOT have {{?$keyword=='maxItems'}}more{{??}}less{{?}} than {{#def.concatSchema}} items'", | ||
107 | - _limitLength: "'should NOT be {{?$keyword=='maxLength'}}longer{{??}}shorter{{?}} than {{#def.concatSchema}} characters'", | ||
108 | - _limitProperties:"'should NOT have {{?$keyword=='maxProperties'}}more{{??}}less{{?}} than {{#def.concatSchema}} properties'", | ||
109 | - multipleOf: "'should be multiple of {{#def.appendSchema}}", | ||
110 | - not: "'should NOT be valid'", | ||
111 | - oneOf: "'should match exactly one schema in oneOf'", | ||
112 | - pattern: "'should match pattern \"{{#def.concatSchemaEQ}}\"'", | ||
113 | - patternGroups: "'should NOT have {{=$moreOrLess}} than {{=$limit}} properties matching pattern \"{{=it.util.escapeQuotes($pgProperty)}}\"'", | ||
114 | - propertyNames: "'property name \\'{{=$invalidName}}\\' is invalid'", | ||
115 | - required: "'{{? it.opts._errorDataPathProperty }}is a required property{{??}}should have required property \\'{{=$missingProperty}}\\'{{?}}'", | ||
116 | - type: "'should be {{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}'", | ||
117 | - uniqueItems: "'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'", | ||
118 | - custom: "'should pass \"{{=$rule.keyword}}\" keyword validation'", | ||
119 | - patternRequired: "'should have property matching pattern \\'{{=$missingPattern}}\\''", | ||
120 | - switch: "'should pass \"switch\" keyword validation'", | ||
121 | - _formatLimit: "'should be {{=$opStr}} \"{{#def.concatSchemaEQ}}\"'", | ||
122 | - _formatExclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'" | ||
123 | -} #}} | ||
124 | - | ||
125 | - | ||
126 | -{{## def.schemaRefOrVal: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=$schema}}{{?}} #}} | ||
127 | -{{## def.schemaRefOrQS: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} | ||
128 | - | ||
129 | -{{## def._errorSchemas = { | ||
130 | - 'false schema': "false", | ||
131 | - $ref: "{{=it.util.toQuotedString($schema)}}", | ||
132 | - additionalItems: "false", | ||
133 | - additionalProperties: "false", | ||
134 | - anyOf: "validate.schema{{=$schemaPath}}", | ||
135 | - const: "validate.schema{{=$schemaPath}}", | ||
136 | - contains: "validate.schema{{=$schemaPath}}", | ||
137 | - dependencies: "validate.schema{{=$schemaPath}}", | ||
138 | - 'enum': "validate.schema{{=$schemaPath}}", | ||
139 | - format: "{{#def.schemaRefOrQS}}", | ||
140 | - _limit: "{{#def.schemaRefOrVal}}", | ||
141 | - _exclusiveLimit: "validate.schema{{=$schemaPath}}", | ||
142 | - _limitItems: "{{#def.schemaRefOrVal}}", | ||
143 | - _limitLength: "{{#def.schemaRefOrVal}}", | ||
144 | - _limitProperties:"{{#def.schemaRefOrVal}}", | ||
145 | - multipleOf: "{{#def.schemaRefOrVal}}", | ||
146 | - not: "validate.schema{{=$schemaPath}}", | ||
147 | - oneOf: "validate.schema{{=$schemaPath}}", | ||
148 | - pattern: "{{#def.schemaRefOrQS}}", | ||
149 | - patternGroups: "validate.schema{{=$schemaPath}}", | ||
150 | - propertyNames: "validate.schema{{=$schemaPath}}", | ||
151 | - required: "validate.schema{{=$schemaPath}}", | ||
152 | - type: "validate.schema{{=$schemaPath}}", | ||
153 | - uniqueItems: "{{#def.schemaRefOrVal}}", | ||
154 | - custom: "validate.schema{{=$schemaPath}}", | ||
155 | - patternRequired: "validate.schema{{=$schemaPath}}", | ||
156 | - switch: "validate.schema{{=$schemaPath}}", | ||
157 | - _formatLimit: "{{#def.schemaRefOrQS}}", | ||
158 | - _formatExclusiveLimit: "validate.schema{{=$schemaPath}}" | ||
159 | -} #}} | ||
160 | - | ||
161 | - | ||
162 | -{{## def.schemaValueQS: {{?$isData}}{{=$schemaValue}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}} | ||
163 | - | ||
164 | -{{## def._errorParams = { | ||
165 | - 'false schema': "{}", | ||
166 | - $ref: "{ ref: '{{=it.util.escapeQuotes($schema)}}' }", | ||
167 | - additionalItems: "{ limit: {{=$schema.length}} }", | ||
168 | - additionalProperties: "{ additionalProperty: '{{=$additionalProperty}}' }", | ||
169 | - anyOf: "{}", | ||
170 | - const: "{}", | ||
171 | - contains: "{}", | ||
172 | - dependencies: "{ property: '{{= it.util.escapeQuotes($property) }}', missingProperty: '{{=$missingProperty}}', depsCount: {{=$deps.length}}, deps: '{{= it.util.escapeQuotes($deps.length==1 ? $deps[0] : $deps.join(\", \")) }}' }", | ||
173 | - 'enum': "{ allowedValues: schema{{=$lvl}} }", | ||
174 | - format: "{ format: {{#def.schemaValueQS}} }", | ||
175 | - _limit: "{ comparison: {{=$opExpr}}, limit: {{=$schemaValue}}, exclusive: {{=$exclusive}} }", | ||
176 | - _exclusiveLimit: "{}", | ||
177 | - _limitItems: "{ limit: {{=$schemaValue}} }", | ||
178 | - _limitLength: "{ limit: {{=$schemaValue}} }", | ||
179 | - _limitProperties:"{ limit: {{=$schemaValue}} }", | ||
180 | - multipleOf: "{ multipleOf: {{=$schemaValue}} }", | ||
181 | - not: "{}", | ||
182 | - oneOf: "{}", | ||
183 | - pattern: "{ pattern: {{#def.schemaValueQS}} }", | ||
184 | - patternGroups: "{ reason: '{{=$reason}}', limit: {{=$limit}}, pattern: '{{=it.util.escapeQuotes($pgProperty)}}' }", | ||
185 | - propertyNames: "{ propertyName: '{{=$invalidName}}' }", | ||
186 | - required: "{ missingProperty: '{{=$missingProperty}}' }", | ||
187 | - type: "{ type: '{{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}' }", | ||
188 | - uniqueItems: "{ i: i, j: j }", | ||
189 | - custom: "{ keyword: '{{=$rule.keyword}}' }", | ||
190 | - patternRequired: "{ missingPattern: '{{=$missingPattern}}' }", | ||
191 | - switch: "{ caseIndex: {{=$caseIndex}} }", | ||
192 | - _formatLimit: "{ comparison: {{=$opExpr}}, limit: {{#def.schemaValueQS}}, exclusive: {{=$exclusive}} }", | ||
193 | - _formatExclusiveLimit: "{}" | ||
194 | -} #}} |
node_modules/ajv/lib/dot/format.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | - | ||
5 | -{{## def.skipFormat: | ||
6 | - {{? $breakOnError }} if (true) { {{?}} | ||
7 | - {{ return out; }} | ||
8 | -#}} | ||
9 | - | ||
10 | -{{? it.opts.format === false }}{{# def.skipFormat }}{{?}} | ||
11 | - | ||
12 | - | ||
13 | -{{# def.$data }} | ||
14 | - | ||
15 | - | ||
16 | -{{## def.$dataCheckFormat: | ||
17 | - {{# def.$dataNotType:'string' }} | ||
18 | - ({{? $unknownFormats != 'ignore' }} | ||
19 | - ({{=$schemaValue}} && !{{=$format}} | ||
20 | - {{? $allowUnknown }} | ||
21 | - && self._opts.unknownFormats.indexOf({{=$schemaValue}}) == -1 | ||
22 | - {{?}}) || | ||
23 | - {{?}} | ||
24 | - ({{=$format}} && {{=$formatType}} == '{{=$ruleType}}' | ||
25 | - && !(typeof {{=$format}} == 'function' | ||
26 | - ? {{? it.async}} | ||
27 | - (async{{=$lvl}} ? {{=it.yieldAwait}} {{=$format}}({{=$data}}) : {{=$format}}({{=$data}})) | ||
28 | - {{??}} | ||
29 | - {{=$format}}({{=$data}}) | ||
30 | - {{?}} | ||
31 | - : {{=$format}}.test({{=$data}})))) | ||
32 | -#}} | ||
33 | - | ||
34 | -{{## def.checkFormat: | ||
35 | - {{ | ||
36 | - var $formatRef = 'formats' + it.util.getProperty($schema); | ||
37 | - if ($isObject) $formatRef += '.validate'; | ||
38 | - }} | ||
39 | - {{? typeof $format == 'function' }} | ||
40 | - {{=$formatRef}}({{=$data}}) | ||
41 | - {{??}} | ||
42 | - {{=$formatRef}}.test({{=$data}}) | ||
43 | - {{?}} | ||
44 | -#}} | ||
45 | - | ||
46 | - | ||
47 | -{{ | ||
48 | - var $unknownFormats = it.opts.unknownFormats | ||
49 | - , $allowUnknown = Array.isArray($unknownFormats); | ||
50 | -}} | ||
51 | - | ||
52 | -{{? $isData }} | ||
53 | - {{ | ||
54 | - var $format = 'format' + $lvl | ||
55 | - , $isObject = 'isObject' + $lvl | ||
56 | - , $formatType = 'formatType' + $lvl; | ||
57 | - }} | ||
58 | - var {{=$format}} = formats[{{=$schemaValue}}]; | ||
59 | - var {{=$isObject}} = typeof {{=$format}} == 'object' | ||
60 | - && !({{=$format}} instanceof RegExp) | ||
61 | - && {{=$format}}.validate; | ||
62 | - var {{=$formatType}} = {{=$isObject}} && {{=$format}}.type || 'string'; | ||
63 | - if ({{=$isObject}}) { | ||
64 | - {{? it.async}} | ||
65 | - var async{{=$lvl}} = {{=$format}}.async; | ||
66 | - {{?}} | ||
67 | - {{=$format}} = {{=$format}}.validate; | ||
68 | - } | ||
69 | - if ({{# def.$dataCheckFormat }}) { | ||
70 | -{{??}} | ||
71 | - {{ var $format = it.formats[$schema]; }} | ||
72 | - {{? !$format }} | ||
73 | - {{? $unknownFormats == 'ignore' }} | ||
74 | - {{ it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); }} | ||
75 | - {{# def.skipFormat }} | ||
76 | - {{?? $allowUnknown && $unknownFormats.indexOf($schema) >= 0 }} | ||
77 | - {{# def.skipFormat }} | ||
78 | - {{??}} | ||
79 | - {{ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); }} | ||
80 | - {{?}} | ||
81 | - {{?}} | ||
82 | - {{ | ||
83 | - var $isObject = typeof $format == 'object' | ||
84 | - && !($format instanceof RegExp) | ||
85 | - && $format.validate; | ||
86 | - var $formatType = $isObject && $format.type || 'string'; | ||
87 | - if ($isObject) { | ||
88 | - var $async = $format.async === true; | ||
89 | - $format = $format.validate; | ||
90 | - } | ||
91 | - }} | ||
92 | - {{? $formatType != $ruleType }} | ||
93 | - {{# def.skipFormat }} | ||
94 | - {{?}} | ||
95 | - {{? $async }} | ||
96 | - {{ | ||
97 | - if (!it.async) throw new Error('async format in sync schema'); | ||
98 | - var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; | ||
99 | - }} | ||
100 | - if (!({{=it.yieldAwait}} {{=$formatRef}}({{=$data}}))) { | ||
101 | - {{??}} | ||
102 | - if (!{{# def.checkFormat }}) { | ||
103 | - {{?}} | ||
104 | -{{?}} | ||
105 | - {{# def.error:'format' }} | ||
106 | - } {{? $breakOnError }} else { {{?}} |
node_modules/ajv/lib/dot/items.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.setupNextLevel }} | ||
5 | - | ||
6 | - | ||
7 | -{{## def.validateItems:startFrom: | ||
8 | - for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) { | ||
9 | - {{ | ||
10 | - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); | ||
11 | - var $passData = $data + '[' + $idx + ']'; | ||
12 | - $it.dataPathArr[$dataNxt] = $idx; | ||
13 | - }} | ||
14 | - | ||
15 | - {{# def.generateSubschemaCode }} | ||
16 | - {{# def.optimizeValidate }} | ||
17 | - | ||
18 | - {{? $breakOnError }} | ||
19 | - if (!{{=$nextValid}}) break; | ||
20 | - {{?}} | ||
21 | - } | ||
22 | -#}} | ||
23 | - | ||
24 | -{{ | ||
25 | - var $idx = 'i' + $lvl | ||
26 | - , $dataNxt = $it.dataLevel = it.dataLevel + 1 | ||
27 | - , $nextData = 'data' + $dataNxt | ||
28 | - , $currentBaseId = it.baseId; | ||
29 | -}} | ||
30 | - | ||
31 | -var {{=$errs}} = errors; | ||
32 | -var {{=$valid}}; | ||
33 | - | ||
34 | -{{? Array.isArray($schema) }} | ||
35 | - {{ /* 'items' is an array of schemas */}} | ||
36 | - {{ var $additionalItems = it.schema.additionalItems; }} | ||
37 | - {{? $additionalItems === false }} | ||
38 | - {{=$valid}} = {{=$data}}.length <= {{= $schema.length }}; | ||
39 | - {{ | ||
40 | - var $currErrSchemaPath = $errSchemaPath; | ||
41 | - $errSchemaPath = it.errSchemaPath + '/additionalItems'; | ||
42 | - }} | ||
43 | - {{# def.checkError:'additionalItems' }} | ||
44 | - {{ $errSchemaPath = $currErrSchemaPath; }} | ||
45 | - {{# def.elseIfValid}} | ||
46 | - {{?}} | ||
47 | - | ||
48 | - {{~ $schema:$sch:$i }} | ||
49 | - {{? {{# def.nonEmptySchema:$sch }} }} | ||
50 | - {{=$nextValid}} = true; | ||
51 | - | ||
52 | - if ({{=$data}}.length > {{=$i}}) { | ||
53 | - {{ | ||
54 | - var $passData = $data + '[' + $i + ']'; | ||
55 | - $it.schema = $sch; | ||
56 | - $it.schemaPath = $schemaPath + '[' + $i + ']'; | ||
57 | - $it.errSchemaPath = $errSchemaPath + '/' + $i; | ||
58 | - $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); | ||
59 | - $it.dataPathArr[$dataNxt] = $i; | ||
60 | - }} | ||
61 | - | ||
62 | - {{# def.generateSubschemaCode }} | ||
63 | - {{# def.optimizeValidate }} | ||
64 | - } | ||
65 | - | ||
66 | - {{# def.ifResultValid }} | ||
67 | - {{?}} | ||
68 | - {{~}} | ||
69 | - | ||
70 | - {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }} | ||
71 | - {{ | ||
72 | - $it.schema = $additionalItems; | ||
73 | - $it.schemaPath = it.schemaPath + '.additionalItems'; | ||
74 | - $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; | ||
75 | - }} | ||
76 | - {{=$nextValid}} = true; | ||
77 | - | ||
78 | - if ({{=$data}}.length > {{= $schema.length }}) { | ||
79 | - {{# def.validateItems: $schema.length }} | ||
80 | - } | ||
81 | - | ||
82 | - {{# def.ifResultValid }} | ||
83 | - {{?}} | ||
84 | - | ||
85 | -{{?? {{# def.nonEmptySchema:$schema }} }} | ||
86 | - {{ /* 'items' is a single schema */}} | ||
87 | - {{ | ||
88 | - $it.schema = $schema; | ||
89 | - $it.schemaPath = $schemaPath; | ||
90 | - $it.errSchemaPath = $errSchemaPath; | ||
91 | - }} | ||
92 | - {{# def.validateItems: 0 }} | ||
93 | -{{?}} | ||
94 | - | ||
95 | -{{? $breakOnError }} | ||
96 | - {{= $closingBraces }} | ||
97 | - if ({{=$errs}} == errors) { | ||
98 | -{{?}} | ||
99 | - | ||
100 | -{{# def.cleanUp }} |
node_modules/ajv/lib/dot/missing.def
deleted
100644 → 0
1 | -{{## def.checkMissingProperty:_properties: | ||
2 | - {{~ _properties:$propertyKey:$i }} | ||
3 | - {{?$i}} || {{?}} | ||
4 | - {{ | ||
5 | - var $prop = it.util.getProperty($propertyKey) | ||
6 | - , $useData = $data + $prop; | ||
7 | - }} | ||
8 | - ( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) ) | ||
9 | - {{~}} | ||
10 | -#}} | ||
11 | - | ||
12 | - | ||
13 | -{{## def.errorMissingProperty:_error: | ||
14 | - {{ | ||
15 | - var $propertyPath = 'missing' + $lvl | ||
16 | - , $missingProperty = '\' + ' + $propertyPath + ' + \''; | ||
17 | - if (it.opts._errorDataPathProperty) { | ||
18 | - it.errorPath = it.opts.jsonPointers | ||
19 | - ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) | ||
20 | - : $currentErrorPath + ' + ' + $propertyPath; | ||
21 | - } | ||
22 | - }} | ||
23 | - {{# def.error:_error }} | ||
24 | -#}} | ||
25 | - | ||
26 | - | ||
27 | -{{## def.allErrorsMissingProperty:_error: | ||
28 | - {{ | ||
29 | - var $prop = it.util.getProperty($propertyKey) | ||
30 | - , $missingProperty = it.util.escapeQuotes($propertyKey) | ||
31 | - , $useData = $data + $prop; | ||
32 | - if (it.opts._errorDataPathProperty) { | ||
33 | - it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); | ||
34 | - } | ||
35 | - }} | ||
36 | - if ({{# def.noPropertyInData }}) { | ||
37 | - {{# def.addError:_error }} | ||
38 | - } | ||
39 | -#}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -var division{{=$lvl}}; | ||
7 | -if ({{?$isData}} | ||
8 | - {{=$schemaValue}} !== undefined && ( | ||
9 | - typeof {{=$schemaValue}} != 'number' || | ||
10 | - {{?}} | ||
11 | - (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}}, | ||
12 | - {{? it.opts.multipleOfPrecision }} | ||
13 | - Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}} | ||
14 | - {{??}} | ||
15 | - division{{=$lvl}} !== parseInt(division{{=$lvl}}) | ||
16 | - {{?}} | ||
17 | - ) | ||
18 | - {{?$isData}} ) {{?}} ) { | ||
19 | - {{# def.error:'multipleOf' }} | ||
20 | -} {{? $breakOnError }} else { {{?}} |
node_modules/ajv/lib/dot/not.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.setupNextLevel }} | ||
5 | - | ||
6 | -{{? {{# def.nonEmptySchema:$schema }} }} | ||
7 | - {{ | ||
8 | - $it.schema = $schema; | ||
9 | - $it.schemaPath = $schemaPath; | ||
10 | - $it.errSchemaPath = $errSchemaPath; | ||
11 | - }} | ||
12 | - | ||
13 | - var {{=$errs}} = errors; | ||
14 | - | ||
15 | - {{# def.setCompositeRule }} | ||
16 | - | ||
17 | - {{ | ||
18 | - $it.createErrors = false; | ||
19 | - var $allErrorsOption; | ||
20 | - if ($it.opts.allErrors) { | ||
21 | - $allErrorsOption = $it.opts.allErrors; | ||
22 | - $it.opts.allErrors = false; | ||
23 | - } | ||
24 | - }} | ||
25 | - {{= it.validate($it) }} | ||
26 | - {{ | ||
27 | - $it.createErrors = true; | ||
28 | - if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; | ||
29 | - }} | ||
30 | - | ||
31 | - {{# def.resetCompositeRule }} | ||
32 | - | ||
33 | - if ({{=$nextValid}}) { | ||
34 | - {{# def.error:'not' }} | ||
35 | - } else { | ||
36 | - {{# def.resetErrors }} | ||
37 | - {{? it.opts.allErrors }} } {{?}} | ||
38 | -{{??}} | ||
39 | - {{# def.addError:'not' }} | ||
40 | - {{? $breakOnError}} | ||
41 | - if (false) { | ||
42 | - {{?}} | ||
43 | -{{?}} |
node_modules/ajv/lib/dot/oneOf.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.setupNextLevel }} | ||
5 | - | ||
6 | -var {{=$errs}} = errors; | ||
7 | -var prevValid{{=$lvl}} = false; | ||
8 | -var {{=$valid}} = false; | ||
9 | - | ||
10 | -{{ var $currentBaseId = $it.baseId; }} | ||
11 | -{{# def.setCompositeRule }} | ||
12 | - | ||
13 | -{{~ $schema:$sch:$i }} | ||
14 | - {{? {{# def.nonEmptySchema:$sch }} }} | ||
15 | - {{ | ||
16 | - $it.schema = $sch; | ||
17 | - $it.schemaPath = $schemaPath + '[' + $i + ']'; | ||
18 | - $it.errSchemaPath = $errSchemaPath + '/' + $i; | ||
19 | - }} | ||
20 | - | ||
21 | - {{# def.insertSubschemaCode }} | ||
22 | - {{??}} | ||
23 | - var {{=$nextValid}} = true; | ||
24 | - {{?}} | ||
25 | - | ||
26 | - {{? $i }} | ||
27 | - if ({{=$nextValid}} && prevValid{{=$lvl}}) | ||
28 | - {{=$valid}} = false; | ||
29 | - else { | ||
30 | - {{ $closingBraces += '}'; }} | ||
31 | - {{?}} | ||
32 | - | ||
33 | - if ({{=$nextValid}}) {{=$valid}} = prevValid{{=$lvl}} = true; | ||
34 | -{{~}} | ||
35 | - | ||
36 | -{{# def.resetCompositeRule }} | ||
37 | - | ||
38 | -{{= $closingBraces }} | ||
39 | - | ||
40 | -if (!{{=$valid}}) { | ||
41 | - {{# def.extraError:'oneOf' }} | ||
42 | -} else { | ||
43 | - {{# def.resetErrors }} | ||
44 | -{{? it.opts.allErrors }} } {{?}} |
node_modules/ajv/lib/dot/pattern.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | -{{ | ||
7 | - var $regexp = $isData | ||
8 | - ? '(new RegExp(' + $schemaValue + '))' | ||
9 | - : it.usePattern($schema); | ||
10 | -}} | ||
11 | - | ||
12 | -if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) { | ||
13 | - {{# def.error:'pattern' }} | ||
14 | -} {{? $breakOnError }} else { {{?}} |
This diff is collapsed. Click to expand it.
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.setupNextLevel }} | ||
5 | - | ||
6 | -{{? {{# def.nonEmptySchema:$schema }} }} | ||
7 | - {{ | ||
8 | - $it.schema = $schema; | ||
9 | - $it.schemaPath = $schemaPath; | ||
10 | - $it.errSchemaPath = $errSchemaPath; | ||
11 | - }} | ||
12 | - | ||
13 | - {{ | ||
14 | - var $key = 'key' + $lvl | ||
15 | - , $idx = 'idx' + $lvl | ||
16 | - , $i = 'i' + $lvl | ||
17 | - , $invalidName = '\' + ' + $key + ' + \'' | ||
18 | - , $dataNxt = $it.dataLevel = it.dataLevel + 1 | ||
19 | - , $nextData = 'data' + $dataNxt | ||
20 | - , $dataProperties = 'dataProperties' + $lvl | ||
21 | - , $ownProperties = it.opts.ownProperties | ||
22 | - , $currentBaseId = it.baseId; | ||
23 | - }} | ||
24 | - | ||
25 | - var {{=$errs}} = errors; | ||
26 | - | ||
27 | - {{? $ownProperties }} | ||
28 | - var {{=$dataProperties}} = undefined; | ||
29 | - {{?}} | ||
30 | - {{# def.iterateProperties }} | ||
31 | - var startErrs{{=$lvl}} = errors; | ||
32 | - | ||
33 | - {{ var $passData = $key; }} | ||
34 | - {{# def.setCompositeRule }} | ||
35 | - {{# def.generateSubschemaCode }} | ||
36 | - {{# def.optimizeValidate }} | ||
37 | - {{# def.resetCompositeRule }} | ||
38 | - | ||
39 | - if (!{{=$nextValid}}) { | ||
40 | - for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}<errors; {{=$i}}++) { | ||
41 | - vErrors[{{=$i}}].propertyName = {{=$key}}; | ||
42 | - } | ||
43 | - {{# def.extraError:'propertyNames' }} | ||
44 | - {{? $breakOnError }} break; {{?}} | ||
45 | - } | ||
46 | - } | ||
47 | -{{?}} | ||
48 | - | ||
49 | -{{? $breakOnError }} | ||
50 | - {{= $closingBraces }} | ||
51 | - if ({{=$errs}} == errors) { | ||
52 | -{{?}} | ||
53 | - | ||
54 | -{{# def.cleanUp }} |
node_modules/ajv/lib/dot/ref.jst
deleted
100644 → 0
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | - | ||
5 | -{{## def._validateRef:_v: | ||
6 | - {{? it.opts.passContext }} | ||
7 | - {{=_v}}.call(this, | ||
8 | - {{??}} | ||
9 | - {{=_v}}( | ||
10 | - {{?}} | ||
11 | - {{=$data}}, {{# def.dataPath }}{{# def.passParentData }}, rootData) | ||
12 | -#}} | ||
13 | - | ||
14 | -{{ var $async, $refCode; }} | ||
15 | -{{? $schema == '#' || $schema == '#/' }} | ||
16 | - {{ | ||
17 | - if (it.isRoot) { | ||
18 | - $async = it.async; | ||
19 | - $refCode = 'validate'; | ||
20 | - } else { | ||
21 | - $async = it.root.schema.$async === true; | ||
22 | - $refCode = 'root.refVal[0]'; | ||
23 | - } | ||
24 | - }} | ||
25 | -{{??}} | ||
26 | - {{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }} | ||
27 | - {{? $refVal === undefined }} | ||
28 | - {{ var $message = it.MissingRefError.message(it.baseId, $schema); }} | ||
29 | - {{? it.opts.missingRefs == 'fail' }} | ||
30 | - {{ it.logger.error($message); }} | ||
31 | - {{# def.error:'$ref' }} | ||
32 | - {{? $breakOnError }} if (false) { {{?}} | ||
33 | - {{?? it.opts.missingRefs == 'ignore' }} | ||
34 | - {{ it.logger.warn($message); }} | ||
35 | - {{? $breakOnError }} if (true) { {{?}} | ||
36 | - {{??}} | ||
37 | - {{ throw new it.MissingRefError(it.baseId, $schema, $message); }} | ||
38 | - {{?}} | ||
39 | - {{?? $refVal.inline }} | ||
40 | - {{# def.setupNextLevel }} | ||
41 | - {{ | ||
42 | - $it.schema = $refVal.schema; | ||
43 | - $it.schemaPath = ''; | ||
44 | - $it.errSchemaPath = $schema; | ||
45 | - }} | ||
46 | - {{ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); }} | ||
47 | - {{= $code }} | ||
48 | - {{? $breakOnError}} | ||
49 | - if ({{=$nextValid}}) { | ||
50 | - {{?}} | ||
51 | - {{??}} | ||
52 | - {{ | ||
53 | - $async = $refVal.$async === true; | ||
54 | - $refCode = $refVal.code; | ||
55 | - }} | ||
56 | - {{?}} | ||
57 | -{{?}} | ||
58 | - | ||
59 | -{{? $refCode }} | ||
60 | - {{# def.beginDefOut}} | ||
61 | - {{# def._validateRef:$refCode }} | ||
62 | - {{# def.storeDefOut:__callValidate }} | ||
63 | - | ||
64 | - {{? $async }} | ||
65 | - {{ if (!it.async) throw new Error('async schema referenced by sync schema'); }} | ||
66 | - {{? $breakOnError }} var {{=$valid}}; {{?}} | ||
67 | - try { | ||
68 | - {{=it.yieldAwait}} {{=__callValidate}}; | ||
69 | - {{? $breakOnError }} {{=$valid}} = true; {{?}} | ||
70 | - } catch (e) { | ||
71 | - if (!(e instanceof ValidationError)) throw e; | ||
72 | - if (vErrors === null) vErrors = e.errors; | ||
73 | - else vErrors = vErrors.concat(e.errors); | ||
74 | - errors = vErrors.length; | ||
75 | - {{? $breakOnError }} {{=$valid}} = false; {{?}} | ||
76 | - } | ||
77 | - {{? $breakOnError }} if ({{=$valid}}) { {{?}} | ||
78 | - {{??}} | ||
79 | - if (!{{=__callValidate}}) { | ||
80 | - if (vErrors === null) vErrors = {{=$refCode}}.errors; | ||
81 | - else vErrors = vErrors.concat({{=$refCode}}.errors); | ||
82 | - errors = vErrors.length; | ||
83 | - } {{? $breakOnError }} else { {{?}} | ||
84 | - {{?}} | ||
85 | -{{?}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.missing }} | ||
4 | -{{# def.setupKeyword }} | ||
5 | -{{# def.$data }} | ||
6 | - | ||
7 | -{{ var $vSchema = 'schema' + $lvl; }} | ||
8 | - | ||
9 | -{{## def.setupLoop: | ||
10 | - {{? !$isData }} | ||
11 | - var {{=$vSchema}} = validate.schema{{=$schemaPath}}; | ||
12 | - {{?}} | ||
13 | - | ||
14 | - {{ | ||
15 | - var $i = 'i' + $lvl | ||
16 | - , $propertyPath = 'schema' + $lvl + '[' + $i + ']' | ||
17 | - , $missingProperty = '\' + ' + $propertyPath + ' + \''; | ||
18 | - if (it.opts._errorDataPathProperty) { | ||
19 | - it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); | ||
20 | - } | ||
21 | - }} | ||
22 | -#}} | ||
23 | - | ||
24 | - | ||
25 | -{{## def.isRequiredOwnProperty: | ||
26 | - Object.prototype.hasOwnProperty.call({{=$data}}, {{=$vSchema}}[{{=$i}}]) | ||
27 | -#}} | ||
28 | - | ||
29 | - | ||
30 | -{{? !$isData }} | ||
31 | - {{? $schema.length < it.opts.loopRequired && | ||
32 | - it.schema.properties && Object.keys(it.schema.properties).length }} | ||
33 | - {{ var $required = []; }} | ||
34 | - {{~ $schema:$property }} | ||
35 | - {{ var $propertySch = it.schema.properties[$property]; }} | ||
36 | - {{? !($propertySch && {{# def.nonEmptySchema:$propertySch}}) }} | ||
37 | - {{ $required[$required.length] = $property; }} | ||
38 | - {{?}} | ||
39 | - {{~}} | ||
40 | - {{??}} | ||
41 | - {{ var $required = $schema; }} | ||
42 | - {{?}} | ||
43 | -{{?}} | ||
44 | - | ||
45 | - | ||
46 | -{{? $isData || $required.length }} | ||
47 | - {{ | ||
48 | - var $currentErrorPath = it.errorPath | ||
49 | - , $loopRequired = $isData || $required.length >= it.opts.loopRequired | ||
50 | - , $ownProperties = it.opts.ownProperties; | ||
51 | - }} | ||
52 | - | ||
53 | - {{? $breakOnError }} | ||
54 | - var missing{{=$lvl}}; | ||
55 | - {{? $loopRequired }} | ||
56 | - {{# def.setupLoop }} | ||
57 | - var {{=$valid}} = true; | ||
58 | - | ||
59 | - {{?$isData}}{{# def.check$dataIsArray }}{{?}} | ||
60 | - | ||
61 | - for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { | ||
62 | - {{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined | ||
63 | - {{? $ownProperties }} | ||
64 | - && {{# def.isRequiredOwnProperty }} | ||
65 | - {{?}}; | ||
66 | - if (!{{=$valid}}) break; | ||
67 | - } | ||
68 | - | ||
69 | - {{? $isData }} } {{?}} | ||
70 | - | ||
71 | - {{# def.checkError:'required' }} | ||
72 | - else { | ||
73 | - {{??}} | ||
74 | - if ({{# def.checkMissingProperty:$required }}) { | ||
75 | - {{# def.errorMissingProperty:'required' }} | ||
76 | - } else { | ||
77 | - {{?}} | ||
78 | - {{??}} | ||
79 | - {{? $loopRequired }} | ||
80 | - {{# def.setupLoop }} | ||
81 | - {{? $isData }} | ||
82 | - if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) { | ||
83 | - {{# def.addError:'required' }} | ||
84 | - } else if ({{=$vSchema}} !== undefined) { | ||
85 | - {{?}} | ||
86 | - | ||
87 | - for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { | ||
88 | - if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined | ||
89 | - {{? $ownProperties }} | ||
90 | - || !{{# def.isRequiredOwnProperty }} | ||
91 | - {{?}}) { | ||
92 | - {{# def.addError:'required' }} | ||
93 | - } | ||
94 | - } | ||
95 | - | ||
96 | - {{? $isData }} } {{?}} | ||
97 | - {{??}} | ||
98 | - {{~ $required:$propertyKey }} | ||
99 | - {{# def.allErrorsMissingProperty:'required' }} | ||
100 | - {{~}} | ||
101 | - {{?}} | ||
102 | - {{?}} | ||
103 | - | ||
104 | - {{ it.errorPath = $currentErrorPath; }} | ||
105 | - | ||
106 | -{{?? $breakOnError }} | ||
107 | - if (true) { | ||
108 | -{{?}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.setupKeyword }} | ||
4 | -{{# def.$data }} | ||
5 | - | ||
6 | - | ||
7 | -{{? ($schema || $isData) && it.opts.uniqueItems !== false }} | ||
8 | - {{? $isData }} | ||
9 | - var {{=$valid}}; | ||
10 | - if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined) | ||
11 | - {{=$valid}} = true; | ||
12 | - else if (typeof {{=$schemaValue}} != 'boolean') | ||
13 | - {{=$valid}} = false; | ||
14 | - else { | ||
15 | - {{?}} | ||
16 | - | ||
17 | - var {{=$valid}} = true; | ||
18 | - if ({{=$data}}.length > 1) { | ||
19 | - var i = {{=$data}}.length, j; | ||
20 | - outer: | ||
21 | - for (;i--;) { | ||
22 | - for (j = i; j--;) { | ||
23 | - if (equal({{=$data}}[i], {{=$data}}[j])) { | ||
24 | - {{=$valid}} = false; | ||
25 | - break outer; | ||
26 | - } | ||
27 | - } | ||
28 | - } | ||
29 | - } | ||
30 | - | ||
31 | - {{? $isData }} } {{?}} | ||
32 | - | ||
33 | - if (!{{=$valid}}) { | ||
34 | - {{# def.error:'uniqueItems' }} | ||
35 | - } {{? $breakOnError }} else { {{?}} | ||
36 | -{{??}} | ||
37 | - {{? $breakOnError }} if (true) { {{?}} | ||
38 | -{{?}} |
1 | -{{# def.definitions }} | ||
2 | -{{# def.errors }} | ||
3 | -{{# def.defaults }} | ||
4 | -{{# def.coerce }} | ||
5 | - | ||
6 | -{{ /** | ||
7 | - * schema compilation (render) time: | ||
8 | - * it = { schema, RULES, _validate, opts } | ||
9 | - * it.validate - this template function, | ||
10 | - * it is used recursively to generate code for subschemas | ||
11 | - * | ||
12 | - * runtime: | ||
13 | - * "validate" is a variable name to which this function will be assigned | ||
14 | - * validateRef etc. are defined in the parent scope in index.js | ||
15 | - */ }} | ||
16 | - | ||
17 | -{{ | ||
18 | - var $async = it.schema.$async === true | ||
19 | - , $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref') | ||
20 | - , $id = it.self._getId(it.schema); | ||
21 | -}} | ||
22 | - | ||
23 | -{{? it.isTop }} | ||
24 | - {{? $async }} | ||
25 | - {{ | ||
26 | - it.async = true; | ||
27 | - var $es7 = it.opts.async == 'es7'; | ||
28 | - it.yieldAwait = $es7 ? 'await' : 'yield'; | ||
29 | - }} | ||
30 | - {{?}} | ||
31 | - | ||
32 | - var validate = | ||
33 | - {{? $async }} | ||
34 | - {{? $es7 }} | ||
35 | - (async function | ||
36 | - {{??}} | ||
37 | - {{? it.opts.async != '*'}}co.wrap{{?}}(function* | ||
38 | - {{?}} | ||
39 | - {{??}} | ||
40 | - (function | ||
41 | - {{?}} | ||
42 | - (data, dataPath, parentData, parentDataProperty, rootData) { | ||
43 | - 'use strict'; | ||
44 | - {{? $id && (it.opts.sourceCode || it.opts.processCode) }} | ||
45 | - {{= '/\*# sourceURL=' + $id + ' */' }} | ||
46 | - {{?}} | ||
47 | -{{?}} | ||
48 | - | ||
49 | -{{? typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref) }} | ||
50 | - {{ var $keyword = 'false schema'; }} | ||
51 | - {{# def.setupKeyword }} | ||
52 | - {{? it.schema === false}} | ||
53 | - {{? it.isTop}} | ||
54 | - {{ $breakOnError = true; }} | ||
55 | - {{??}} | ||
56 | - var {{=$valid}} = false; | ||
57 | - {{?}} | ||
58 | - {{# def.error:'false schema' }} | ||
59 | - {{??}} | ||
60 | - {{? it.isTop}} | ||
61 | - {{? $async }} | ||
62 | - return data; | ||
63 | - {{??}} | ||
64 | - validate.errors = null; | ||
65 | - return true; | ||
66 | - {{?}} | ||
67 | - {{??}} | ||
68 | - var {{=$valid}} = true; | ||
69 | - {{?}} | ||
70 | - {{?}} | ||
71 | - | ||
72 | - {{? it.isTop}} | ||
73 | - }); | ||
74 | - return validate; | ||
75 | - {{?}} | ||
76 | - | ||
77 | - {{ return out; }} | ||
78 | -{{?}} | ||
79 | - | ||
80 | - | ||
81 | -{{? it.isTop }} | ||
82 | - {{ | ||
83 | - var $top = it.isTop | ||
84 | - , $lvl = it.level = 0 | ||
85 | - , $dataLvl = it.dataLevel = 0 | ||
86 | - , $data = 'data'; | ||
87 | - it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); | ||
88 | - it.baseId = it.baseId || it.rootId; | ||
89 | - delete it.isTop; | ||
90 | - | ||
91 | - it.dataPathArr = [undefined]; | ||
92 | - }} | ||
93 | - | ||
94 | - var vErrors = null; {{ /* don't edit, used in replace */ }} | ||
95 | - var errors = 0; {{ /* don't edit, used in replace */ }} | ||
96 | - if (rootData === undefined) rootData = data; {{ /* don't edit, used in replace */ }} | ||
97 | -{{??}} | ||
98 | - {{ | ||
99 | - var $lvl = it.level | ||
100 | - , $dataLvl = it.dataLevel | ||
101 | - , $data = 'data' + ($dataLvl || ''); | ||
102 | - | ||
103 | - if ($id) it.baseId = it.resolve.url(it.baseId, $id); | ||
104 | - | ||
105 | - if ($async && !it.async) throw new Error('async schema in sync schema'); | ||
106 | - }} | ||
107 | - | ||
108 | - var errs_{{=$lvl}} = errors; | ||
109 | -{{?}} | ||
110 | - | ||
111 | -{{ | ||
112 | - var $valid = 'valid' + $lvl | ||
113 | - , $breakOnError = !it.opts.allErrors | ||
114 | - , $closingBraces1 = '' | ||
115 | - , $closingBraces2 = ''; | ||
116 | - | ||
117 | - var $errorKeyword; | ||
118 | - var $typeSchema = it.schema.type | ||
119 | - , $typeIsArray = Array.isArray($typeSchema); | ||
120 | - | ||
121 | - if ($typeIsArray && $typeSchema.length == 1) { | ||
122 | - $typeSchema = $typeSchema[0]; | ||
123 | - $typeIsArray = false; | ||
124 | - } | ||
125 | -}} | ||
126 | - | ||
127 | -{{## def.checkType: | ||
128 | - {{ | ||
129 | - var $schemaPath = it.schemaPath + '.type' | ||
130 | - , $errSchemaPath = it.errSchemaPath + '/type' | ||
131 | - , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; | ||
132 | - }} | ||
133 | - | ||
134 | - if ({{= it.util[$method]($typeSchema, $data, true) }}) { | ||
135 | -#}} | ||
136 | - | ||
137 | -{{? it.schema.$ref && $refKeywords }} | ||
138 | - {{? it.opts.extendRefs == 'fail' }} | ||
139 | - {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); }} | ||
140 | - {{?? it.opts.extendRefs !== true }} | ||
141 | - {{ | ||
142 | - $refKeywords = false; | ||
143 | - it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); | ||
144 | - }} | ||
145 | - {{?}} | ||
146 | -{{?}} | ||
147 | - | ||
148 | -{{? $typeSchema }} | ||
149 | - {{? it.opts.coerceTypes }} | ||
150 | - {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }} | ||
151 | - {{?}} | ||
152 | - | ||
153 | - {{ var $rulesGroup = it.RULES.types[$typeSchema]; }} | ||
154 | - {{? $coerceToTypes || $typeIsArray || $rulesGroup === true || | ||
155 | - ($rulesGroup && !$shouldUseGroup($rulesGroup)) }} | ||
156 | - {{ | ||
157 | - var $schemaPath = it.schemaPath + '.type' | ||
158 | - , $errSchemaPath = it.errSchemaPath + '/type'; | ||
159 | - }} | ||
160 | - {{# def.checkType }} | ||
161 | - {{? $coerceToTypes }} | ||
162 | - {{# def.coerceType }} | ||
163 | - {{??}} | ||
164 | - {{# def.error:'type' }} | ||
165 | - {{?}} | ||
166 | - } | ||
167 | - {{?}} | ||
168 | -{{?}} | ||
169 | - | ||
170 | - | ||
171 | -{{? it.schema.$ref && !$refKeywords }} | ||
172 | - {{= it.RULES.all.$ref.code(it, '$ref') }} | ||
173 | - {{? $breakOnError }} | ||
174 | - } | ||
175 | - if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { | ||
176 | - {{ $closingBraces2 += '}'; }} | ||
177 | - {{?}} | ||
178 | -{{??}} | ||
179 | - {{? it.opts.v5 && it.schema.patternGroups }} | ||
180 | - {{ it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.'); }} | ||
181 | - {{?}} | ||
182 | - {{~ it.RULES:$rulesGroup }} | ||
183 | - {{? $shouldUseGroup($rulesGroup) }} | ||
184 | - {{? $rulesGroup.type }} | ||
185 | - if ({{= it.util.checkDataType($rulesGroup.type, $data) }}) { | ||
186 | - {{?}} | ||
187 | - {{? it.opts.useDefaults && !it.compositeRule }} | ||
188 | - {{? $rulesGroup.type == 'object' && it.schema.properties }} | ||
189 | - {{# def.defaultProperties }} | ||
190 | - {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }} | ||
191 | - {{# def.defaultItems }} | ||
192 | - {{?}} | ||
193 | - {{?}} | ||
194 | - {{~ $rulesGroup.rules:$rule }} | ||
195 | - {{? $shouldUseRule($rule) }} | ||
196 | - {{ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); }} | ||
197 | - {{? $code }} | ||
198 | - {{= $code }} | ||
199 | - {{? $breakOnError }} | ||
200 | - {{ $closingBraces1 += '}'; }} | ||
201 | - {{?}} | ||
202 | - {{?}} | ||
203 | - {{?}} | ||
204 | - {{~}} | ||
205 | - {{? $breakOnError }} | ||
206 | - {{= $closingBraces1 }} | ||
207 | - {{ $closingBraces1 = ''; }} | ||
208 | - {{?}} | ||
209 | - {{? $rulesGroup.type }} | ||
210 | - } | ||
211 | - {{? $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes }} | ||
212 | - else { | ||
213 | - {{ | ||
214 | - var $schemaPath = it.schemaPath + '.type' | ||
215 | - , $errSchemaPath = it.errSchemaPath + '/type'; | ||
216 | - }} | ||
217 | - {{# def.error:'type' }} | ||
218 | - } | ||
219 | - {{?}} | ||
220 | - {{?}} | ||
221 | - | ||
222 | - {{? $breakOnError }} | ||
223 | - if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { | ||
224 | - {{ $closingBraces2 += '}'; }} | ||
225 | - {{?}} | ||
226 | - {{?}} | ||
227 | - {{~}} | ||
228 | -{{?}} | ||
229 | - | ||
230 | -{{? $breakOnError }} {{= $closingBraces2 }} {{?}} | ||
231 | - | ||
232 | -{{? $top }} | ||
233 | - {{? $async }} | ||
234 | - if (errors === 0) return data; {{ /* don't edit, used in replace */ }} | ||
235 | - else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }} | ||
236 | - {{??}} | ||
237 | - validate.errors = vErrors; {{ /* don't edit, used in replace */ }} | ||
238 | - return errors === 0; {{ /* don't edit, used in replace */ }} | ||
239 | - {{?}} | ||
240 | - }); | ||
241 | - | ||
242 | - return validate; | ||
243 | -{{??}} | ||
244 | - var {{=$valid}} = errors === errs_{{=$lvl}}; | ||
245 | -{{?}} | ||
246 | - | ||
247 | -{{# def.cleanUp }} | ||
248 | - | ||
249 | -{{? $top }} | ||
250 | - {{# def.finalCleanUp }} | ||
251 | -{{?}} | ||
252 | - | ||
253 | -{{ | ||
254 | - function $shouldUseGroup($rulesGroup) { | ||
255 | - var rules = $rulesGroup.rules; | ||
256 | - for (var i=0; i < rules.length; i++) | ||
257 | - if ($shouldUseRule(rules[i])) | ||
258 | - return true; | ||
259 | - } | ||
260 | - | ||
261 | - function $shouldUseRule($rule) { | ||
262 | - return it.schema[$rule.keyword] !== undefined || | ||
263 | - ($rule.implements && $ruleImplementsSomeKeyword($rule)); | ||
264 | - } | ||
265 | - | ||
266 | - function $ruleImplementsSomeKeyword($rule) { | ||
267 | - var impl = $rule.implements; | ||
268 | - for (var i=0; i < impl.length; i++) | ||
269 | - if (it.schema[impl[i]] !== undefined) | ||
270 | - return true; | ||
271 | - } | ||
272 | -}} |
node_modules/ajv/lib/dotjs/README.md
deleted
100644 → 0
node_modules/ajv/lib/dotjs/_limit.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | -module.exports = function generate__limit(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $errorKeyword; | ||
11 | - var $data = 'data' + ($dataLvl || ''); | ||
12 | - var $isData = it.opts.$data && $schema && $schema.$data, | ||
13 | - $schemaValue; | ||
14 | - if ($isData) { | ||
15 | - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; | ||
16 | - $schemaValue = 'schema' + $lvl; | ||
17 | - } else { | ||
18 | - $schemaValue = $schema; | ||
19 | - } | ||
20 | - var $isMax = $keyword == 'maximum', | ||
21 | - $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', | ||
22 | - $schemaExcl = it.schema[$exclusiveKeyword], | ||
23 | - $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, | ||
24 | - $op = $isMax ? '<' : '>', | ||
25 | - $notOp = $isMax ? '>' : '<', | ||
26 | - $errorKeyword = undefined; | ||
27 | - if ($isDataExcl) { | ||
28 | - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), | ||
29 | - $exclusive = 'exclusive' + $lvl, | ||
30 | - $exclType = 'exclType' + $lvl, | ||
31 | - $exclIsNumber = 'exclIsNumber' + $lvl, | ||
32 | - $opExpr = 'op' + $lvl, | ||
33 | - $opStr = '\' + ' + $opExpr + ' + \''; | ||
34 | - out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; | ||
35 | - $schemaValueExcl = 'schemaExcl' + $lvl; | ||
36 | - out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; | ||
37 | - var $errorKeyword = $exclusiveKeyword; | ||
38 | - var $$outStack = $$outStack || []; | ||
39 | - $$outStack.push(out); | ||
40 | - out = ''; /* istanbul ignore else */ | ||
41 | - if (it.createErrors !== false) { | ||
42 | - out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; | ||
43 | - if (it.opts.messages !== false) { | ||
44 | - out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; | ||
45 | - } | ||
46 | - if (it.opts.verbose) { | ||
47 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
48 | - } | ||
49 | - out += ' } '; | ||
50 | - } else { | ||
51 | - out += ' {} '; | ||
52 | - } | ||
53 | - var __err = out; | ||
54 | - out = $$outStack.pop(); | ||
55 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
56 | - if (it.async) { | ||
57 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
58 | - } else { | ||
59 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
60 | - } | ||
61 | - } else { | ||
62 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
63 | - } | ||
64 | - out += ' } else if ( '; | ||
65 | - if ($isData) { | ||
66 | - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
67 | - } | ||
68 | - out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; | ||
69 | - } else { | ||
70 | - var $exclIsNumber = typeof $schemaExcl == 'number', | ||
71 | - $opStr = $op; | ||
72 | - if ($exclIsNumber && $isData) { | ||
73 | - var $opExpr = '\'' + $opStr + '\''; | ||
74 | - out += ' if ( '; | ||
75 | - if ($isData) { | ||
76 | - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
77 | - } | ||
78 | - out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; | ||
79 | - } else { | ||
80 | - if ($exclIsNumber && $schema === undefined) { | ||
81 | - $exclusive = true; | ||
82 | - $errorKeyword = $exclusiveKeyword; | ||
83 | - $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; | ||
84 | - $schemaValue = $schemaExcl; | ||
85 | - $notOp += '='; | ||
86 | - } else { | ||
87 | - if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); | ||
88 | - if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { | ||
89 | - $exclusive = true; | ||
90 | - $errorKeyword = $exclusiveKeyword; | ||
91 | - $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; | ||
92 | - $notOp += '='; | ||
93 | - } else { | ||
94 | - $exclusive = false; | ||
95 | - $opStr += '='; | ||
96 | - } | ||
97 | - } | ||
98 | - var $opExpr = '\'' + $opStr + '\''; | ||
99 | - out += ' if ( '; | ||
100 | - if ($isData) { | ||
101 | - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
102 | - } | ||
103 | - out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; | ||
104 | - } | ||
105 | - } | ||
106 | - $errorKeyword = $errorKeyword || $keyword; | ||
107 | - var $$outStack = $$outStack || []; | ||
108 | - $$outStack.push(out); | ||
109 | - out = ''; /* istanbul ignore else */ | ||
110 | - if (it.createErrors !== false) { | ||
111 | - out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; | ||
112 | - if (it.opts.messages !== false) { | ||
113 | - out += ' , message: \'should be ' + ($opStr) + ' '; | ||
114 | - if ($isData) { | ||
115 | - out += '\' + ' + ($schemaValue); | ||
116 | - } else { | ||
117 | - out += '' + ($schemaValue) + '\''; | ||
118 | - } | ||
119 | - } | ||
120 | - if (it.opts.verbose) { | ||
121 | - out += ' , schema: '; | ||
122 | - if ($isData) { | ||
123 | - out += 'validate.schema' + ($schemaPath); | ||
124 | - } else { | ||
125 | - out += '' + ($schema); | ||
126 | - } | ||
127 | - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
128 | - } | ||
129 | - out += ' } '; | ||
130 | - } else { | ||
131 | - out += ' {} '; | ||
132 | - } | ||
133 | - var __err = out; | ||
134 | - out = $$outStack.pop(); | ||
135 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
136 | - if (it.async) { | ||
137 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
138 | - } else { | ||
139 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
140 | - } | ||
141 | - } else { | ||
142 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
143 | - } | ||
144 | - out += ' } '; | ||
145 | - if ($breakOnError) { | ||
146 | - out += ' else { '; | ||
147 | - } | ||
148 | - return out; | ||
149 | -} |
1 | -'use strict'; | ||
2 | -module.exports = function generate__limitItems(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $errorKeyword; | ||
11 | - var $data = 'data' + ($dataLvl || ''); | ||
12 | - var $isData = it.opts.$data && $schema && $schema.$data, | ||
13 | - $schemaValue; | ||
14 | - if ($isData) { | ||
15 | - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; | ||
16 | - $schemaValue = 'schema' + $lvl; | ||
17 | - } else { | ||
18 | - $schemaValue = $schema; | ||
19 | - } | ||
20 | - var $op = $keyword == 'maxItems' ? '>' : '<'; | ||
21 | - out += 'if ( '; | ||
22 | - if ($isData) { | ||
23 | - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
24 | - } | ||
25 | - out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; | ||
26 | - var $errorKeyword = $keyword; | ||
27 | - var $$outStack = $$outStack || []; | ||
28 | - $$outStack.push(out); | ||
29 | - out = ''; /* istanbul ignore else */ | ||
30 | - if (it.createErrors !== false) { | ||
31 | - out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; | ||
32 | - if (it.opts.messages !== false) { | ||
33 | - out += ' , message: \'should NOT have '; | ||
34 | - if ($keyword == 'maxItems') { | ||
35 | - out += 'more'; | ||
36 | - } else { | ||
37 | - out += 'less'; | ||
38 | - } | ||
39 | - out += ' than '; | ||
40 | - if ($isData) { | ||
41 | - out += '\' + ' + ($schemaValue) + ' + \''; | ||
42 | - } else { | ||
43 | - out += '' + ($schema); | ||
44 | - } | ||
45 | - out += ' items\' '; | ||
46 | - } | ||
47 | - if (it.opts.verbose) { | ||
48 | - out += ' , schema: '; | ||
49 | - if ($isData) { | ||
50 | - out += 'validate.schema' + ($schemaPath); | ||
51 | - } else { | ||
52 | - out += '' + ($schema); | ||
53 | - } | ||
54 | - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
55 | - } | ||
56 | - out += ' } '; | ||
57 | - } else { | ||
58 | - out += ' {} '; | ||
59 | - } | ||
60 | - var __err = out; | ||
61 | - out = $$outStack.pop(); | ||
62 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
63 | - if (it.async) { | ||
64 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
65 | - } else { | ||
66 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
67 | - } | ||
68 | - } else { | ||
69 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
70 | - } | ||
71 | - out += '} '; | ||
72 | - if ($breakOnError) { | ||
73 | - out += ' else { '; | ||
74 | - } | ||
75 | - return out; | ||
76 | -} |
1 | -'use strict'; | ||
2 | -module.exports = function generate__limitLength(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $errorKeyword; | ||
11 | - var $data = 'data' + ($dataLvl || ''); | ||
12 | - var $isData = it.opts.$data && $schema && $schema.$data, | ||
13 | - $schemaValue; | ||
14 | - if ($isData) { | ||
15 | - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; | ||
16 | - $schemaValue = 'schema' + $lvl; | ||
17 | - } else { | ||
18 | - $schemaValue = $schema; | ||
19 | - } | ||
20 | - var $op = $keyword == 'maxLength' ? '>' : '<'; | ||
21 | - out += 'if ( '; | ||
22 | - if ($isData) { | ||
23 | - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
24 | - } | ||
25 | - if (it.opts.unicode === false) { | ||
26 | - out += ' ' + ($data) + '.length '; | ||
27 | - } else { | ||
28 | - out += ' ucs2length(' + ($data) + ') '; | ||
29 | - } | ||
30 | - out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; | ||
31 | - var $errorKeyword = $keyword; | ||
32 | - var $$outStack = $$outStack || []; | ||
33 | - $$outStack.push(out); | ||
34 | - out = ''; /* istanbul ignore else */ | ||
35 | - if (it.createErrors !== false) { | ||
36 | - out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; | ||
37 | - if (it.opts.messages !== false) { | ||
38 | - out += ' , message: \'should NOT be '; | ||
39 | - if ($keyword == 'maxLength') { | ||
40 | - out += 'longer'; | ||
41 | - } else { | ||
42 | - out += 'shorter'; | ||
43 | - } | ||
44 | - out += ' than '; | ||
45 | - if ($isData) { | ||
46 | - out += '\' + ' + ($schemaValue) + ' + \''; | ||
47 | - } else { | ||
48 | - out += '' + ($schema); | ||
49 | - } | ||
50 | - out += ' characters\' '; | ||
51 | - } | ||
52 | - if (it.opts.verbose) { | ||
53 | - out += ' , schema: '; | ||
54 | - if ($isData) { | ||
55 | - out += 'validate.schema' + ($schemaPath); | ||
56 | - } else { | ||
57 | - out += '' + ($schema); | ||
58 | - } | ||
59 | - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
60 | - } | ||
61 | - out += ' } '; | ||
62 | - } else { | ||
63 | - out += ' {} '; | ||
64 | - } | ||
65 | - var __err = out; | ||
66 | - out = $$outStack.pop(); | ||
67 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
68 | - if (it.async) { | ||
69 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
70 | - } else { | ||
71 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
72 | - } | ||
73 | - } else { | ||
74 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
75 | - } | ||
76 | - out += '} '; | ||
77 | - if ($breakOnError) { | ||
78 | - out += ' else { '; | ||
79 | - } | ||
80 | - return out; | ||
81 | -} |
1 | -'use strict'; | ||
2 | -module.exports = function generate__limitProperties(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $errorKeyword; | ||
11 | - var $data = 'data' + ($dataLvl || ''); | ||
12 | - var $isData = it.opts.$data && $schema && $schema.$data, | ||
13 | - $schemaValue; | ||
14 | - if ($isData) { | ||
15 | - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; | ||
16 | - $schemaValue = 'schema' + $lvl; | ||
17 | - } else { | ||
18 | - $schemaValue = $schema; | ||
19 | - } | ||
20 | - var $op = $keyword == 'maxProperties' ? '>' : '<'; | ||
21 | - out += 'if ( '; | ||
22 | - if ($isData) { | ||
23 | - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
24 | - } | ||
25 | - out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; | ||
26 | - var $errorKeyword = $keyword; | ||
27 | - var $$outStack = $$outStack || []; | ||
28 | - $$outStack.push(out); | ||
29 | - out = ''; /* istanbul ignore else */ | ||
30 | - if (it.createErrors !== false) { | ||
31 | - out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; | ||
32 | - if (it.opts.messages !== false) { | ||
33 | - out += ' , message: \'should NOT have '; | ||
34 | - if ($keyword == 'maxProperties') { | ||
35 | - out += 'more'; | ||
36 | - } else { | ||
37 | - out += 'less'; | ||
38 | - } | ||
39 | - out += ' than '; | ||
40 | - if ($isData) { | ||
41 | - out += '\' + ' + ($schemaValue) + ' + \''; | ||
42 | - } else { | ||
43 | - out += '' + ($schema); | ||
44 | - } | ||
45 | - out += ' properties\' '; | ||
46 | - } | ||
47 | - if (it.opts.verbose) { | ||
48 | - out += ' , schema: '; | ||
49 | - if ($isData) { | ||
50 | - out += 'validate.schema' + ($schemaPath); | ||
51 | - } else { | ||
52 | - out += '' + ($schema); | ||
53 | - } | ||
54 | - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
55 | - } | ||
56 | - out += ' } '; | ||
57 | - } else { | ||
58 | - out += ' {} '; | ||
59 | - } | ||
60 | - var __err = out; | ||
61 | - out = $$outStack.pop(); | ||
62 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
63 | - if (it.async) { | ||
64 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
65 | - } else { | ||
66 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
67 | - } | ||
68 | - } else { | ||
69 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
70 | - } | ||
71 | - out += '} '; | ||
72 | - if ($breakOnError) { | ||
73 | - out += ' else { '; | ||
74 | - } | ||
75 | - return out; | ||
76 | -} |
node_modules/ajv/lib/dotjs/allOf.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | -module.exports = function generate_allOf(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $schema = it.schema[$keyword]; | ||
5 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
6 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
7 | - var $breakOnError = !it.opts.allErrors; | ||
8 | - var $it = it.util.copy(it); | ||
9 | - var $closingBraces = ''; | ||
10 | - $it.level++; | ||
11 | - var $nextValid = 'valid' + $it.level; | ||
12 | - var $currentBaseId = $it.baseId, | ||
13 | - $allSchemasEmpty = true; | ||
14 | - var arr1 = $schema; | ||
15 | - if (arr1) { | ||
16 | - var $sch, $i = -1, | ||
17 | - l1 = arr1.length - 1; | ||
18 | - while ($i < l1) { | ||
19 | - $sch = arr1[$i += 1]; | ||
20 | - if (it.util.schemaHasRules($sch, it.RULES.all)) { | ||
21 | - $allSchemasEmpty = false; | ||
22 | - $it.schema = $sch; | ||
23 | - $it.schemaPath = $schemaPath + '[' + $i + ']'; | ||
24 | - $it.errSchemaPath = $errSchemaPath + '/' + $i; | ||
25 | - out += ' ' + (it.validate($it)) + ' '; | ||
26 | - $it.baseId = $currentBaseId; | ||
27 | - if ($breakOnError) { | ||
28 | - out += ' if (' + ($nextValid) + ') { '; | ||
29 | - $closingBraces += '}'; | ||
30 | - } | ||
31 | - } | ||
32 | - } | ||
33 | - } | ||
34 | - if ($breakOnError) { | ||
35 | - if ($allSchemasEmpty) { | ||
36 | - out += ' if (true) { '; | ||
37 | - } else { | ||
38 | - out += ' ' + ($closingBraces.slice(0, -1)) + ' '; | ||
39 | - } | ||
40 | - } | ||
41 | - out = it.util.cleanUpCode(out); | ||
42 | - return out; | ||
43 | -} |
node_modules/ajv/lib/dotjs/anyOf.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | -module.exports = function generate_anyOf(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $data = 'data' + ($dataLvl || ''); | ||
11 | - var $valid = 'valid' + $lvl; | ||
12 | - var $errs = 'errs__' + $lvl; | ||
13 | - var $it = it.util.copy(it); | ||
14 | - var $closingBraces = ''; | ||
15 | - $it.level++; | ||
16 | - var $nextValid = 'valid' + $it.level; | ||
17 | - var $noEmptySchema = $schema.every(function($sch) { | ||
18 | - return it.util.schemaHasRules($sch, it.RULES.all); | ||
19 | - }); | ||
20 | - if ($noEmptySchema) { | ||
21 | - var $currentBaseId = $it.baseId; | ||
22 | - out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; | ||
23 | - var $wasComposite = it.compositeRule; | ||
24 | - it.compositeRule = $it.compositeRule = true; | ||
25 | - var arr1 = $schema; | ||
26 | - if (arr1) { | ||
27 | - var $sch, $i = -1, | ||
28 | - l1 = arr1.length - 1; | ||
29 | - while ($i < l1) { | ||
30 | - $sch = arr1[$i += 1]; | ||
31 | - $it.schema = $sch; | ||
32 | - $it.schemaPath = $schemaPath + '[' + $i + ']'; | ||
33 | - $it.errSchemaPath = $errSchemaPath + '/' + $i; | ||
34 | - out += ' ' + (it.validate($it)) + ' '; | ||
35 | - $it.baseId = $currentBaseId; | ||
36 | - out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; | ||
37 | - $closingBraces += '}'; | ||
38 | - } | ||
39 | - } | ||
40 | - it.compositeRule = $it.compositeRule = $wasComposite; | ||
41 | - out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ | ||
42 | - if (it.createErrors !== false) { | ||
43 | - out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; | ||
44 | - if (it.opts.messages !== false) { | ||
45 | - out += ' , message: \'should match some schema in anyOf\' '; | ||
46 | - } | ||
47 | - if (it.opts.verbose) { | ||
48 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
49 | - } | ||
50 | - out += ' } '; | ||
51 | - } else { | ||
52 | - out += ' {} '; | ||
53 | - } | ||
54 | - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
55 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
56 | - if (it.async) { | ||
57 | - out += ' throw new ValidationError(vErrors); '; | ||
58 | - } else { | ||
59 | - out += ' validate.errors = vErrors; return false; '; | ||
60 | - } | ||
61 | - } | ||
62 | - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; | ||
63 | - if (it.opts.allErrors) { | ||
64 | - out += ' } '; | ||
65 | - } | ||
66 | - out = it.util.cleanUpCode(out); | ||
67 | - } else { | ||
68 | - if ($breakOnError) { | ||
69 | - out += ' if (true) { '; | ||
70 | - } | ||
71 | - } | ||
72 | - return out; | ||
73 | -} |
node_modules/ajv/lib/dotjs/const.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | -module.exports = function generate_const(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $data = 'data' + ($dataLvl || ''); | ||
11 | - var $valid = 'valid' + $lvl; | ||
12 | - var $isData = it.opts.$data && $schema && $schema.$data, | ||
13 | - $schemaValue; | ||
14 | - if ($isData) { | ||
15 | - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; | ||
16 | - $schemaValue = 'schema' + $lvl; | ||
17 | - } else { | ||
18 | - $schemaValue = $schema; | ||
19 | - } | ||
20 | - if (!$isData) { | ||
21 | - out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; | ||
22 | - } | ||
23 | - out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; | ||
24 | - var $$outStack = $$outStack || []; | ||
25 | - $$outStack.push(out); | ||
26 | - out = ''; /* istanbul ignore else */ | ||
27 | - if (it.createErrors !== false) { | ||
28 | - out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; | ||
29 | - if (it.opts.messages !== false) { | ||
30 | - out += ' , message: \'should be equal to constant\' '; | ||
31 | - } | ||
32 | - if (it.opts.verbose) { | ||
33 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
34 | - } | ||
35 | - out += ' } '; | ||
36 | - } else { | ||
37 | - out += ' {} '; | ||
38 | - } | ||
39 | - var __err = out; | ||
40 | - out = $$outStack.pop(); | ||
41 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
42 | - if (it.async) { | ||
43 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
44 | - } else { | ||
45 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
46 | - } | ||
47 | - } else { | ||
48 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
49 | - } | ||
50 | - out += ' }'; | ||
51 | - if ($breakOnError) { | ||
52 | - out += ' else { '; | ||
53 | - } | ||
54 | - return out; | ||
55 | -} |
1 | -'use strict'; | ||
2 | -module.exports = function generate_contains(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $data = 'data' + ($dataLvl || ''); | ||
11 | - var $valid = 'valid' + $lvl; | ||
12 | - var $errs = 'errs__' + $lvl; | ||
13 | - var $it = it.util.copy(it); | ||
14 | - var $closingBraces = ''; | ||
15 | - $it.level++; | ||
16 | - var $nextValid = 'valid' + $it.level; | ||
17 | - var $idx = 'i' + $lvl, | ||
18 | - $dataNxt = $it.dataLevel = it.dataLevel + 1, | ||
19 | - $nextData = 'data' + $dataNxt, | ||
20 | - $currentBaseId = it.baseId, | ||
21 | - $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all); | ||
22 | - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; | ||
23 | - if ($nonEmptySchema) { | ||
24 | - var $wasComposite = it.compositeRule; | ||
25 | - it.compositeRule = $it.compositeRule = true; | ||
26 | - $it.schema = $schema; | ||
27 | - $it.schemaPath = $schemaPath; | ||
28 | - $it.errSchemaPath = $errSchemaPath; | ||
29 | - out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; | ||
30 | - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); | ||
31 | - var $passData = $data + '[' + $idx + ']'; | ||
32 | - $it.dataPathArr[$dataNxt] = $idx; | ||
33 | - var $code = it.validate($it); | ||
34 | - $it.baseId = $currentBaseId; | ||
35 | - if (it.util.varOccurences($code, $nextData) < 2) { | ||
36 | - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; | ||
37 | - } else { | ||
38 | - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; | ||
39 | - } | ||
40 | - out += ' if (' + ($nextValid) + ') break; } '; | ||
41 | - it.compositeRule = $it.compositeRule = $wasComposite; | ||
42 | - out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; | ||
43 | - } else { | ||
44 | - out += ' if (' + ($data) + '.length == 0) {'; | ||
45 | - } | ||
46 | - var $$outStack = $$outStack || []; | ||
47 | - $$outStack.push(out); | ||
48 | - out = ''; /* istanbul ignore else */ | ||
49 | - if (it.createErrors !== false) { | ||
50 | - out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; | ||
51 | - if (it.opts.messages !== false) { | ||
52 | - out += ' , message: \'should contain a valid item\' '; | ||
53 | - } | ||
54 | - if (it.opts.verbose) { | ||
55 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
56 | - } | ||
57 | - out += ' } '; | ||
58 | - } else { | ||
59 | - out += ' {} '; | ||
60 | - } | ||
61 | - var __err = out; | ||
62 | - out = $$outStack.pop(); | ||
63 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
64 | - if (it.async) { | ||
65 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
66 | - } else { | ||
67 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
68 | - } | ||
69 | - } else { | ||
70 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
71 | - } | ||
72 | - out += ' } else { '; | ||
73 | - if ($nonEmptySchema) { | ||
74 | - out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; | ||
75 | - } | ||
76 | - if (it.opts.allErrors) { | ||
77 | - out += ' } '; | ||
78 | - } | ||
79 | - out = it.util.cleanUpCode(out); | ||
80 | - return out; | ||
81 | -} |
node_modules/ajv/lib/dotjs/custom.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | -module.exports = function generate_custom(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $errorKeyword; | ||
11 | - var $data = 'data' + ($dataLvl || ''); | ||
12 | - var $valid = 'valid' + $lvl; | ||
13 | - var $errs = 'errs__' + $lvl; | ||
14 | - var $isData = it.opts.$data && $schema && $schema.$data, | ||
15 | - $schemaValue; | ||
16 | - if ($isData) { | ||
17 | - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; | ||
18 | - $schemaValue = 'schema' + $lvl; | ||
19 | - } else { | ||
20 | - $schemaValue = $schema; | ||
21 | - } | ||
22 | - var $rule = this, | ||
23 | - $definition = 'definition' + $lvl, | ||
24 | - $rDef = $rule.definition, | ||
25 | - $closingBraces = ''; | ||
26 | - var $compile, $inline, $macro, $ruleValidate, $validateCode; | ||
27 | - if ($isData && $rDef.$data) { | ||
28 | - $validateCode = 'keywordValidate' + $lvl; | ||
29 | - var $validateSchema = $rDef.validateSchema; | ||
30 | - out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; | ||
31 | - } else { | ||
32 | - $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); | ||
33 | - if (!$ruleValidate) return; | ||
34 | - $schemaValue = 'validate.schema' + $schemaPath; | ||
35 | - $validateCode = $ruleValidate.code; | ||
36 | - $compile = $rDef.compile; | ||
37 | - $inline = $rDef.inline; | ||
38 | - $macro = $rDef.macro; | ||
39 | - } | ||
40 | - var $ruleErrs = $validateCode + '.errors', | ||
41 | - $i = 'i' + $lvl, | ||
42 | - $ruleErr = 'ruleErr' + $lvl, | ||
43 | - $asyncKeyword = $rDef.async; | ||
44 | - if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); | ||
45 | - if (!($inline || $macro)) { | ||
46 | - out += '' + ($ruleErrs) + ' = null;'; | ||
47 | - } | ||
48 | - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; | ||
49 | - if ($isData && $rDef.$data) { | ||
50 | - $closingBraces += '}'; | ||
51 | - out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; | ||
52 | - if ($validateSchema) { | ||
53 | - $closingBraces += '}'; | ||
54 | - out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; | ||
55 | - } | ||
56 | - } | ||
57 | - if ($inline) { | ||
58 | - if ($rDef.statements) { | ||
59 | - out += ' ' + ($ruleValidate.validate) + ' '; | ||
60 | - } else { | ||
61 | - out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; | ||
62 | - } | ||
63 | - } else if ($macro) { | ||
64 | - var $it = it.util.copy(it); | ||
65 | - var $closingBraces = ''; | ||
66 | - $it.level++; | ||
67 | - var $nextValid = 'valid' + $it.level; | ||
68 | - $it.schema = $ruleValidate.validate; | ||
69 | - $it.schemaPath = ''; | ||
70 | - var $wasComposite = it.compositeRule; | ||
71 | - it.compositeRule = $it.compositeRule = true; | ||
72 | - var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); | ||
73 | - it.compositeRule = $it.compositeRule = $wasComposite; | ||
74 | - out += ' ' + ($code); | ||
75 | - } else { | ||
76 | - var $$outStack = $$outStack || []; | ||
77 | - $$outStack.push(out); | ||
78 | - out = ''; | ||
79 | - out += ' ' + ($validateCode) + '.call( '; | ||
80 | - if (it.opts.passContext) { | ||
81 | - out += 'this'; | ||
82 | - } else { | ||
83 | - out += 'self'; | ||
84 | - } | ||
85 | - if ($compile || $rDef.schema === false) { | ||
86 | - out += ' , ' + ($data) + ' '; | ||
87 | - } else { | ||
88 | - out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; | ||
89 | - } | ||
90 | - out += ' , (dataPath || \'\')'; | ||
91 | - if (it.errorPath != '""') { | ||
92 | - out += ' + ' + (it.errorPath); | ||
93 | - } | ||
94 | - var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', | ||
95 | - $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; | ||
96 | - out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; | ||
97 | - var def_callRuleValidate = out; | ||
98 | - out = $$outStack.pop(); | ||
99 | - if ($rDef.errors === false) { | ||
100 | - out += ' ' + ($valid) + ' = '; | ||
101 | - if ($asyncKeyword) { | ||
102 | - out += '' + (it.yieldAwait); | ||
103 | - } | ||
104 | - out += '' + (def_callRuleValidate) + '; '; | ||
105 | - } else { | ||
106 | - if ($asyncKeyword) { | ||
107 | - $ruleErrs = 'customErrors' + $lvl; | ||
108 | - out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; | ||
109 | - } else { | ||
110 | - out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; | ||
111 | - } | ||
112 | - } | ||
113 | - } | ||
114 | - if ($rDef.modifying) { | ||
115 | - out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; | ||
116 | - } | ||
117 | - out += '' + ($closingBraces); | ||
118 | - if ($rDef.valid) { | ||
119 | - if ($breakOnError) { | ||
120 | - out += ' if (true) { '; | ||
121 | - } | ||
122 | - } else { | ||
123 | - out += ' if ( '; | ||
124 | - if ($rDef.valid === undefined) { | ||
125 | - out += ' !'; | ||
126 | - if ($macro) { | ||
127 | - out += '' + ($nextValid); | ||
128 | - } else { | ||
129 | - out += '' + ($valid); | ||
130 | - } | ||
131 | - } else { | ||
132 | - out += ' ' + (!$rDef.valid) + ' '; | ||
133 | - } | ||
134 | - out += ') { '; | ||
135 | - $errorKeyword = $rule.keyword; | ||
136 | - var $$outStack = $$outStack || []; | ||
137 | - $$outStack.push(out); | ||
138 | - out = ''; | ||
139 | - var $$outStack = $$outStack || []; | ||
140 | - $$outStack.push(out); | ||
141 | - out = ''; /* istanbul ignore else */ | ||
142 | - if (it.createErrors !== false) { | ||
143 | - out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; | ||
144 | - if (it.opts.messages !== false) { | ||
145 | - out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; | ||
146 | - } | ||
147 | - if (it.opts.verbose) { | ||
148 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
149 | - } | ||
150 | - out += ' } '; | ||
151 | - } else { | ||
152 | - out += ' {} '; | ||
153 | - } | ||
154 | - var __err = out; | ||
155 | - out = $$outStack.pop(); | ||
156 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
157 | - if (it.async) { | ||
158 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
159 | - } else { | ||
160 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
161 | - } | ||
162 | - } else { | ||
163 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
164 | - } | ||
165 | - var def_customError = out; | ||
166 | - out = $$outStack.pop(); | ||
167 | - if ($inline) { | ||
168 | - if ($rDef.errors) { | ||
169 | - if ($rDef.errors != 'full') { | ||
170 | - out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } '; | ||
171 | - if (it.opts.verbose) { | ||
172 | - out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; | ||
173 | - } | ||
174 | - out += ' } '; | ||
175 | - } | ||
176 | - } else { | ||
177 | - if ($rDef.errors === false) { | ||
178 | - out += ' ' + (def_customError) + ' '; | ||
179 | - } else { | ||
180 | - out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } '; | ||
181 | - if (it.opts.verbose) { | ||
182 | - out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; | ||
183 | - } | ||
184 | - out += ' } } '; | ||
185 | - } | ||
186 | - } | ||
187 | - } else if ($macro) { | ||
188 | - out += ' var err = '; /* istanbul ignore else */ | ||
189 | - if (it.createErrors !== false) { | ||
190 | - out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; | ||
191 | - if (it.opts.messages !== false) { | ||
192 | - out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; | ||
193 | - } | ||
194 | - if (it.opts.verbose) { | ||
195 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
196 | - } | ||
197 | - out += ' } '; | ||
198 | - } else { | ||
199 | - out += ' {} '; | ||
200 | - } | ||
201 | - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
202 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
203 | - if (it.async) { | ||
204 | - out += ' throw new ValidationError(vErrors); '; | ||
205 | - } else { | ||
206 | - out += ' validate.errors = vErrors; return false; '; | ||
207 | - } | ||
208 | - } | ||
209 | - } else { | ||
210 | - if ($rDef.errors === false) { | ||
211 | - out += ' ' + (def_customError) + ' '; | ||
212 | - } else { | ||
213 | - out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; '; | ||
214 | - if (it.opts.verbose) { | ||
215 | - out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; | ||
216 | - } | ||
217 | - out += ' } } else { ' + (def_customError) + ' } '; | ||
218 | - } | ||
219 | - } | ||
220 | - out += ' } '; | ||
221 | - if ($breakOnError) { | ||
222 | - out += ' else { '; | ||
223 | - } | ||
224 | - } | ||
225 | - return out; | ||
226 | -} |
1 | -'use strict'; | ||
2 | -module.exports = function generate_dependencies(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $data = 'data' + ($dataLvl || ''); | ||
11 | - var $errs = 'errs__' + $lvl; | ||
12 | - var $it = it.util.copy(it); | ||
13 | - var $closingBraces = ''; | ||
14 | - $it.level++; | ||
15 | - var $nextValid = 'valid' + $it.level; | ||
16 | - var $schemaDeps = {}, | ||
17 | - $propertyDeps = {}, | ||
18 | - $ownProperties = it.opts.ownProperties; | ||
19 | - for ($property in $schema) { | ||
20 | - var $sch = $schema[$property]; | ||
21 | - var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; | ||
22 | - $deps[$property] = $sch; | ||
23 | - } | ||
24 | - out += 'var ' + ($errs) + ' = errors;'; | ||
25 | - var $currentErrorPath = it.errorPath; | ||
26 | - out += 'var missing' + ($lvl) + ';'; | ||
27 | - for (var $property in $propertyDeps) { | ||
28 | - $deps = $propertyDeps[$property]; | ||
29 | - if ($deps.length) { | ||
30 | - out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; | ||
31 | - if ($ownProperties) { | ||
32 | - out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; | ||
33 | - } | ||
34 | - if ($breakOnError) { | ||
35 | - out += ' && ( '; | ||
36 | - var arr1 = $deps; | ||
37 | - if (arr1) { | ||
38 | - var $propertyKey, $i = -1, | ||
39 | - l1 = arr1.length - 1; | ||
40 | - while ($i < l1) { | ||
41 | - $propertyKey = arr1[$i += 1]; | ||
42 | - if ($i) { | ||
43 | - out += ' || '; | ||
44 | - } | ||
45 | - var $prop = it.util.getProperty($propertyKey), | ||
46 | - $useData = $data + $prop; | ||
47 | - out += ' ( ( ' + ($useData) + ' === undefined '; | ||
48 | - if ($ownProperties) { | ||
49 | - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; | ||
50 | - } | ||
51 | - out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; | ||
52 | - } | ||
53 | - } | ||
54 | - out += ')) { '; | ||
55 | - var $propertyPath = 'missing' + $lvl, | ||
56 | - $missingProperty = '\' + ' + $propertyPath + ' + \''; | ||
57 | - if (it.opts._errorDataPathProperty) { | ||
58 | - it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; | ||
59 | - } | ||
60 | - var $$outStack = $$outStack || []; | ||
61 | - $$outStack.push(out); | ||
62 | - out = ''; /* istanbul ignore else */ | ||
63 | - if (it.createErrors !== false) { | ||
64 | - out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; | ||
65 | - if (it.opts.messages !== false) { | ||
66 | - out += ' , message: \'should have '; | ||
67 | - if ($deps.length == 1) { | ||
68 | - out += 'property ' + (it.util.escapeQuotes($deps[0])); | ||
69 | - } else { | ||
70 | - out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); | ||
71 | - } | ||
72 | - out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; | ||
73 | - } | ||
74 | - if (it.opts.verbose) { | ||
75 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
76 | - } | ||
77 | - out += ' } '; | ||
78 | - } else { | ||
79 | - out += ' {} '; | ||
80 | - } | ||
81 | - var __err = out; | ||
82 | - out = $$outStack.pop(); | ||
83 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
84 | - if (it.async) { | ||
85 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
86 | - } else { | ||
87 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
88 | - } | ||
89 | - } else { | ||
90 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
91 | - } | ||
92 | - } else { | ||
93 | - out += ' ) { '; | ||
94 | - var arr2 = $deps; | ||
95 | - if (arr2) { | ||
96 | - var $propertyKey, i2 = -1, | ||
97 | - l2 = arr2.length - 1; | ||
98 | - while (i2 < l2) { | ||
99 | - $propertyKey = arr2[i2 += 1]; | ||
100 | - var $prop = it.util.getProperty($propertyKey), | ||
101 | - $missingProperty = it.util.escapeQuotes($propertyKey), | ||
102 | - $useData = $data + $prop; | ||
103 | - if (it.opts._errorDataPathProperty) { | ||
104 | - it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); | ||
105 | - } | ||
106 | - out += ' if ( ' + ($useData) + ' === undefined '; | ||
107 | - if ($ownProperties) { | ||
108 | - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; | ||
109 | - } | ||
110 | - out += ') { var err = '; /* istanbul ignore else */ | ||
111 | - if (it.createErrors !== false) { | ||
112 | - out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; | ||
113 | - if (it.opts.messages !== false) { | ||
114 | - out += ' , message: \'should have '; | ||
115 | - if ($deps.length == 1) { | ||
116 | - out += 'property ' + (it.util.escapeQuotes($deps[0])); | ||
117 | - } else { | ||
118 | - out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); | ||
119 | - } | ||
120 | - out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; | ||
121 | - } | ||
122 | - if (it.opts.verbose) { | ||
123 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
124 | - } | ||
125 | - out += ' } '; | ||
126 | - } else { | ||
127 | - out += ' {} '; | ||
128 | - } | ||
129 | - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; | ||
130 | - } | ||
131 | - } | ||
132 | - } | ||
133 | - out += ' } '; | ||
134 | - if ($breakOnError) { | ||
135 | - $closingBraces += '}'; | ||
136 | - out += ' else { '; | ||
137 | - } | ||
138 | - } | ||
139 | - } | ||
140 | - it.errorPath = $currentErrorPath; | ||
141 | - var $currentBaseId = $it.baseId; | ||
142 | - for (var $property in $schemaDeps) { | ||
143 | - var $sch = $schemaDeps[$property]; | ||
144 | - if (it.util.schemaHasRules($sch, it.RULES.all)) { | ||
145 | - out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; | ||
146 | - if ($ownProperties) { | ||
147 | - out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; | ||
148 | - } | ||
149 | - out += ') { '; | ||
150 | - $it.schema = $sch; | ||
151 | - $it.schemaPath = $schemaPath + it.util.getProperty($property); | ||
152 | - $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); | ||
153 | - out += ' ' + (it.validate($it)) + ' '; | ||
154 | - $it.baseId = $currentBaseId; | ||
155 | - out += ' } '; | ||
156 | - if ($breakOnError) { | ||
157 | - out += ' if (' + ($nextValid) + ') { '; | ||
158 | - $closingBraces += '}'; | ||
159 | - } | ||
160 | - } | ||
161 | - } | ||
162 | - if ($breakOnError) { | ||
163 | - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; | ||
164 | - } | ||
165 | - out = it.util.cleanUpCode(out); | ||
166 | - return out; | ||
167 | -} |
node_modules/ajv/lib/dotjs/enum.js
deleted
100644 → 0
1 | -'use strict'; | ||
2 | -module.exports = function generate_enum(it, $keyword, $ruleType) { | ||
3 | - var out = ' '; | ||
4 | - var $lvl = it.level; | ||
5 | - var $dataLvl = it.dataLevel; | ||
6 | - var $schema = it.schema[$keyword]; | ||
7 | - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); | ||
8 | - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
9 | - var $breakOnError = !it.opts.allErrors; | ||
10 | - var $data = 'data' + ($dataLvl || ''); | ||
11 | - var $valid = 'valid' + $lvl; | ||
12 | - var $isData = it.opts.$data && $schema && $schema.$data, | ||
13 | - $schemaValue; | ||
14 | - if ($isData) { | ||
15 | - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; | ||
16 | - $schemaValue = 'schema' + $lvl; | ||
17 | - } else { | ||
18 | - $schemaValue = $schema; | ||
19 | - } | ||
20 | - var $i = 'i' + $lvl, | ||
21 | - $vSchema = 'schema' + $lvl; | ||
22 | - if (!$isData) { | ||
23 | - out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; | ||
24 | - } | ||
25 | - out += 'var ' + ($valid) + ';'; | ||
26 | - if ($isData) { | ||
27 | - out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; | ||
28 | - } | ||
29 | - out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; | ||
30 | - if ($isData) { | ||
31 | - out += ' } '; | ||
32 | - } | ||
33 | - out += ' if (!' + ($valid) + ') { '; | ||
34 | - var $$outStack = $$outStack || []; | ||
35 | - $$outStack.push(out); | ||
36 | - out = ''; /* istanbul ignore else */ | ||
37 | - if (it.createErrors !== false) { | ||
38 | - out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; | ||
39 | - if (it.opts.messages !== false) { | ||
40 | - out += ' , message: \'should be equal to one of the allowed values\' '; | ||
41 | - } | ||
42 | - if (it.opts.verbose) { | ||
43 | - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
44 | - } | ||
45 | - out += ' } '; | ||
46 | - } else { | ||
47 | - out += ' {} '; | ||
48 | - } | ||
49 | - var __err = out; | ||
50 | - out = $$outStack.pop(); | ||
51 | - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ | ||
52 | - if (it.async) { | ||
53 | - out += ' throw new ValidationError([' + (__err) + ']); '; | ||
54 | - } else { | ||
55 | - out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
56 | - } | ||
57 | - } else { | ||
58 | - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
59 | - } | ||
60 | - out += ' }'; | ||
61 | - if ($breakOnError) { | ||
62 | - out += ' else { '; | ||
63 | - } | ||
64 | - return out; | ||
65 | -} |
node_modules/ajv/lib/dotjs/format.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/dotjs/items.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/dotjs/not.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/dotjs/oneOf.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/dotjs/ref.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/keyword.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ajv/lib/refs/$data.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ajv/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ajv/scripts/bundle.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ajv/scripts/info
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/array-flatten/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/array-flatten/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/asn1/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/lib/ber/errors.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/lib/ber/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/lib/ber/reader.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/lib/ber/types.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/lib/ber/writer.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asn1/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/assert-plus/AUTHORS
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/assert-plus/CHANGES.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/assert-plus/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/assert-plus/assert.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/asynckit/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/bench.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/lib/abort.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/lib/async.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/lib/defer.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/lib/iterate.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/asynckit/lib/state.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/asynckit/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/parallel.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/asynckit/serial.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/asynckit/stream.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws-sign2/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws-sign2/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws-sign2/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws-sign2/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/.tern-port
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/aws4.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/lru.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/aws4/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/bcrypt-pbkdf/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/bcrypt-pbkdf/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/body-parser/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/body-parser/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/body-parser/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/body-parser/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/body-parser/lib/read.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/boom/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/boom/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/boom/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/boom/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/bytes/History.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/bytes/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/bytes/Readme.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/bytes/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/bytes/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/caseless/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/caseless/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/caseless/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/caseless/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/caseless/test.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/co/History.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/co/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/co/Readme.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/co/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/co/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/combined-stream/License
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/content-type/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/content-type/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/content-type/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/content-type/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/cookie/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cookie/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cookie/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cookie/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cookie/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/core-util-is/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/core-util-is/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/core-util-is/test.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cryptiles/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cryptiles/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cryptiles/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/cryptiles/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/cryptiles/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/dashdash/CHANGES.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/dashdash/LICENSE.txt
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/dashdash/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/dashdash/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/.coveralls.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/.eslintrc
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/CHANGELOG.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/Makefile
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/component.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/karma.conf.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/node.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/src/browser.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/src/debug.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/debug/src/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/debug/src/node.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/delayed-stream/License
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/delayed-stream/Makefile
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/depd/History.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/depd/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/depd/Readme.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/depd/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/depd/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/destroy/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/destroy/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/destroy/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/destroy/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/lib/ec.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/lib/sec.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ecc-jsbn/test.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ee-first/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ee-first/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ee-first/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ee-first/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/Jakefile
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/ejs.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/ejs.min.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/lib/ejs.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/lib/utils.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ejs/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/encodeurl/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/encodeurl/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/encodeurl/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/encodeurl/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/encodeurl/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/errorhandler/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/errorhandler/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/errorhandler/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/errorhandler/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/escape-html/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/escape-html/Readme.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/escape-html/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/etag/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/etag/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/etag/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/etag/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/etag/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/express/History.md
deleted
100644 → 0
This diff could not be displayed because it is too large.
node_modules/express/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/express/Readme.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/express/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/express/lib/express.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/express/lib/request.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/express/lib/response.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/express/lib/utils.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/express/lib/view.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/express/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/.eslintrc
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/.jscs.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/CHANGELOG.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/component.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extend/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extsprintf/.gitmodules
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extsprintf/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extsprintf/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/extsprintf/Makefile
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/extsprintf/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/extsprintf/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/fast-deep-equal/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/finalhandler/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/finalhandler/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/finalhandler/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/finalhandler/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/forever-agent/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/forever-agent/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/forever-agent/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/form-data/License
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/form-data/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/form-data/README.md.bak
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/form-data/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/forwarded/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/forwarded/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/forwarded/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/forwarded/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/forwarded/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/fresh/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/fresh/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/fresh/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/fresh/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/fresh/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/getpass/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/getpass/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/getpass/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/getpass/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/getpass/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/getpass/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/har-schema/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/har-schema/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/har-schema/lib/har.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/har-schema/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/har-schema/lib/log.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/har-schema/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/har-validator/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/har-validator/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/hawk/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/client.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/dist/browser.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/lib/browser.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/lib/client.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/lib/crypto.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/lib/server.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/lib/utils.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hawk/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hoek/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hoek/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hoek/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hoek/lib/escape.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hoek/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/hoek/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/http-errors/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/http-errors/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/http-errors/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/http-errors/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/http-signature/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/http/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/iconv-lite/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/iconv-lite/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/iconv-lite/Changelog.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/iconv-lite/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/iconv-lite/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/iconv-lite/lib/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/iconv-lite/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/inherits/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/inherits/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/inherits/inherits.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/inherits/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/Cakefile
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/bower.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/ipaddr.min.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/lib/ipaddr.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/ipaddr.js/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/is-typedarray/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/is-typedarray/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/is-typedarray/test.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/is_js/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/is_js/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/is_js/is.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/is_js/is.min.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/is_js/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/.jshintrc
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/LICENSE.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/isstream.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/isstream/test.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsbn/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsbn/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsbn/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsbn/example.html
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsbn/example.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsbn/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsbn/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/json-schema/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/jsprim/CHANGES.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsprim/CONTRIBUTING.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsprim/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsprim/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsprim/lib/jsprim.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/jsprim/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/media-typer/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/media-typer/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/media-typer/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/media-typer/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/methods/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/methods/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/methods/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/methods/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/methods/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-db/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-db/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-db/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-db/db.json
deleted
100644 → 0
This diff could not be displayed because it is too large.
node_modules/mime-db/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-db/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-types/HISTORY.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-types/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-types/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-types/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime-types/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/build/build.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/build/test.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/cli.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/mime.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mime/types.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/.editorconfig
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/.jshintrc
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/.travis.yml
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/CHANGELOG.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/CONTRIBUTING.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/LICENSE.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/append.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/collect.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/combine.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/compact.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/contains.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/array/equals.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/every.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/filter.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/find.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/findIndex.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/findLast.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/array/flatten.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/forEach.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/groupBy.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/indexOf.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/indicesOf.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/insert.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/array/invoke.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/join.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/last.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/array/map.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/max.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/min.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/pick.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/pluck.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/range.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/reduce.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/array/reject.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/remove.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/removeAll.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/reverse.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/shuffle.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/slice.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/some.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/sort.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/sortBy.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/split.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/take.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/toLookup.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/union.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/unique.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/xor.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/array/zip.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/collection.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/collection/find.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/collection/map.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/collection/max.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/collection/min.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/collection/size.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/collection/some.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/date/diff.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/i18n/de-DE.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/i18n/en-US.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/i18n/pt-BR.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/i18n_.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/isLeapYear.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/isSame.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/parseIso.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/quarter.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/startOf.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/date/strftime.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/doc/array.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/collection.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/date.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/function.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/lang.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/math.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/number.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/object.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/queryString.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/random.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/string.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/doc/time.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/function.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/function/bind.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/function/func.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/function/prop.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/function/series.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/function/times.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/function/wrap.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/GLOBAL.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/clone.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/lang/ctorApply.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/deepClone.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/deepEquals.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/defaults.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/lang/is.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isArray.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isBoolean.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isDate.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isEmpty.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isFinite.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isFunction.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isInteger.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isKind.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isNaN.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isNull.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isNumber.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isObject.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isRegExp.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isString.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/lang/isnt.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/kindOf.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/toArray.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/toNumber.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/lang/toString.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/ceil.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/clamp.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/countSteps.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/floor.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/inRange.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/isNear.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/lerp.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/loop.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/map.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/norm.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/overflow.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/math/round.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/MAX_INT.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/number/MAX_UINT.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/MIN_INT.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/number/isNaN.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/nth.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/ordinal.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/pad.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/rol.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/ror.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/sign.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/toInt.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/toUInt.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/number/toUInt31.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/bindAll.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/contains.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/object/equals.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/every.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/fillIn.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/filter.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/find.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/flatten.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/forIn.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/forOwn.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/object/get.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/has.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/hasOwn.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/keys.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/map.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/matches.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/max.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/merge.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/min.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/mixIn.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/object/omit.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/pick.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/pluck.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/reduce.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/reject.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/result.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/set.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/size.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/some.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/unset.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/object/values.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/queryString.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/random.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/choice.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/guid.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/rand.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/randBit.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/randBool.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/randHex.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/randInt.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/random/randSign.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/random/random.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/every.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/find.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/join.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/last.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/map.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/max.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/min.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/pick.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/pluck.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/range.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/slice.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/some.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/sort.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/split.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/take.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/union.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/xor.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/array/zip.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/collection.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/date.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/date/diff.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/date/i18n_.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/date/isSame.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/function.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
node_modules/mout/src/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
node_modules/mout/src/lang.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment