Showing
1000 changed files
with
3910 additions
and
780 deletions
Too many changes to show.
To preserve performance only 1000 of 1000+ files are displayed.
1 | const express = require('express'); | 1 | const express = require('express'); |
2 | +const path = require('path'); | ||
3 | +const foodapi = require('./foodapi'); | ||
4 | + | ||
5 | +//module - 변수 전달 | ||
6 | +const {variable1, variable2} = require('./moduleEx'); | ||
7 | +//module - 함수 전달 | ||
8 | +const md = require("./moduleEx2"); | ||
9 | + | ||
2 | const app = express(); | 10 | const app = express(); |
3 | 11 | ||
4 | app.set('port',process.env.PORT||3000); | 12 | app.set('port',process.env.PORT||3000); |
5 | 13 | ||
6 | app.get('/',(req,res)=>{ | 14 | app.get('/',(req,res)=>{ |
7 | - res.send("Food Adtv Info Service"); | 15 | + // node js가 응답 |
16 | + //res.send("Food Adtv Info Service"); | ||
17 | + | ||
18 | + // HTML이 응답 | ||
19 | + res.sendFile(path.join(__dirname,'/main.html')); | ||
8 | }); | 20 | }); |
9 | 21 | ||
10 | app.listen(app.get('port'),()=>{ | 22 | app.listen(app.get('port'),()=>{ | ... | ... |
express/foodapi.js
0 → 100644
1 | +let request = require('request'); | ||
2 | + | ||
3 | +// REST API 경로 & 요청 메시지 | ||
4 | +const url = 'http://apis.data.go.kr/1470000/FoodAdtvInfoService/getFoodAdtvInfoList'; | ||
5 | +const queryParams = '?' + encodeURIComponent('ServiceKey') + '=ofY2ppOq5kBqT5jYPaGsW%2BEy7OR5a1bf5Z9PHvqNKvwO5DSCaU2x2qCj%2FoXnuB1YVbMTlErkHWSMEsR5b7isrw%3D%3D'; /* Service Key*/ | ||
6 | +queryParams += '&' + encodeURIComponent('prdlst_cd') + '=' + encodeURIComponent('C0118010300000'); /* */ | ||
7 | +queryParams += '&' + encodeURIComponent('pc_kor_nm') + '=' + encodeURIComponent('과.채음료'); /* */ | ||
8 | +queryParams += '&' + encodeURIComponent('pageNo') + '=' + encodeURIComponent('1'); /* */ | ||
9 | +queryParams += '&' + encodeURIComponent('numOfRows') + '=' + encodeURIComponent('3'); /* */ | ||
10 | + | ||
11 | +/* | ||
12 | +예제코드 | ||
13 | +request({ | ||
14 | + url: url + queryParams, | ||
15 | + method: 'GET' | ||
16 | +}, function (error, response, body) { | ||
17 | + //console.log('Status', response.statusCode); | ||
18 | + //console.log('Headers', JSON.stringify(response.headers)); | ||
19 | + //console.log('Reponse received', body); | ||
20 | +}); | ||
21 | +*/ | ||
22 | + | ||
23 | +// module.exports.이름 = 함수; |
express/main.html
0 → 100644
express/moduleEx.js
0 → 100644
express/moduleEx2.js
0 → 100644
express/node_modules/.bin/rc
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
3 | - | ||
4 | -case `uname` in | ||
5 | - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; | ||
6 | -esac | ||
7 | - | ||
8 | -if [ -x "$basedir/node" ]; then | ||
9 | - "$basedir/node" "$basedir/../rc/cli.js" "$@" | ||
10 | - ret=$? | ||
11 | -else | ||
12 | - node "$basedir/../rc/cli.js" "$@" | ||
13 | - ret=$? | ||
14 | -fi | ||
15 | -exit $ret |
express/node_modules/.bin/rc.cmd
deleted
100644 → 0
1 | -@ECHO off | ||
2 | -SETLOCAL | ||
3 | -CALL :find_dp0 | ||
4 | - | ||
5 | -IF EXIST "%dp0%\node.exe" ( | ||
6 | - SET "_prog=%dp0%\node.exe" | ||
7 | -) ELSE ( | ||
8 | - SET "_prog=node" | ||
9 | - SET PATHEXT=%PATHEXT:;.JS;=;% | ||
10 | -) | ||
11 | - | ||
12 | -"%_prog%" "%dp0%\..\rc\cli.js" %* | ||
13 | -ENDLOCAL | ||
14 | -EXIT /b %errorlevel% | ||
15 | -:find_dp0 | ||
16 | -SET dp0=%~dp0 | ||
17 | -EXIT /b |
express/node_modules/.bin/rc.ps1
deleted
100644 → 0
1 | -#!/usr/bin/env pwsh | ||
2 | -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent | ||
3 | - | ||
4 | -$exe="" | ||
5 | -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ||
6 | - # Fix case when both the Windows and Linux builds of Node | ||
7 | - # are installed in the same directory | ||
8 | - $exe=".exe" | ||
9 | -} | ||
10 | -$ret=0 | ||
11 | -if (Test-Path "$basedir/node$exe") { | ||
12 | - & "$basedir/node$exe" "$basedir/../rc/cli.js" $args | ||
13 | - $ret=$LASTEXITCODE | ||
14 | -} else { | ||
15 | - & "node$exe" "$basedir/../rc/cli.js" $args | ||
16 | - $ret=$LASTEXITCODE | ||
17 | -} | ||
18 | -exit $ret |
express/node_modules/.bin/semver
deleted
100644 → 0
1 | -#!/bin/sh | ||
2 | -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") | ||
3 | - | ||
4 | -case `uname` in | ||
5 | - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; | ||
6 | -esac | ||
7 | - | ||
8 | -if [ -x "$basedir/node" ]; then | ||
9 | - "$basedir/node" "$basedir/../semver/bin/semver" "$@" | ||
10 | - ret=$? | ||
11 | -else | ||
12 | - node "$basedir/../semver/bin/semver" "$@" | ||
13 | - ret=$? | ||
14 | -fi | ||
15 | -exit $ret |
express/node_modules/.bin/semver.cmd
deleted
100644 → 0
1 | -@ECHO off | ||
2 | -SETLOCAL | ||
3 | -CALL :find_dp0 | ||
4 | - | ||
5 | -IF EXIST "%dp0%\node.exe" ( | ||
6 | - SET "_prog=%dp0%\node.exe" | ||
7 | -) ELSE ( | ||
8 | - SET "_prog=node" | ||
9 | - SET PATHEXT=%PATHEXT:;.JS;=;% | ||
10 | -) | ||
11 | - | ||
12 | -"%_prog%" "%dp0%\..\semver\bin\semver" %* | ||
13 | -ENDLOCAL | ||
14 | -EXIT /b %errorlevel% | ||
15 | -:find_dp0 | ||
16 | -SET dp0=%~dp0 | ||
17 | -EXIT /b |
express/node_modules/.bin/semver.ps1
deleted
100644 → 0
1 | -#!/usr/bin/env pwsh | ||
2 | -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent | ||
3 | - | ||
4 | -$exe="" | ||
5 | -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ||
6 | - # Fix case when both the Windows and Linux builds of Node | ||
7 | - # are installed in the same directory | ||
8 | - $exe=".exe" | ||
9 | -} | ||
10 | -$ret=0 | ||
11 | -if (Test-Path "$basedir/node$exe") { | ||
12 | - & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args | ||
13 | - $ret=$LASTEXITCODE | ||
14 | -} else { | ||
15 | - & "node$exe" "$basedir/../semver/bin/semver" $args | ||
16 | - $ret=$LASTEXITCODE | ||
17 | -} | ||
18 | -exit $ret |
... | @@ -6,10 +6,10 @@ case `uname` in | ... | @@ -6,10 +6,10 @@ case `uname` in |
6 | esac | 6 | esac |
7 | 7 | ||
8 | if [ -x "$basedir/node" ]; then | 8 | if [ -x "$basedir/node" ]; then |
9 | - "$basedir/node" "$basedir/../is-ci/bin.js" "$@" | 9 | + "$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@" |
10 | ret=$? | 10 | ret=$? |
11 | else | 11 | else |
12 | - node "$basedir/../is-ci/bin.js" "$@" | 12 | + node "$basedir/../sshpk/bin/sshpk-conv" "$@" |
13 | ret=$? | 13 | ret=$? |
14 | fi | 14 | fi |
15 | exit $ret | 15 | exit $ret | ... | ... |
... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( | ... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( |
9 | SET PATHEXT=%PATHEXT:;.JS;=;% | 9 | SET PATHEXT=%PATHEXT:;.JS;=;% |
10 | ) | 10 | ) |
11 | 11 | ||
12 | -"%_prog%" "%dp0%\..\is-ci\bin.js" %* | 12 | +"%_prog%" "%dp0%\..\sshpk\bin\sshpk-conv" %* |
13 | ENDLOCAL | 13 | ENDLOCAL |
14 | EXIT /b %errorlevel% | 14 | EXIT /b %errorlevel% |
15 | :find_dp0 | 15 | :find_dp0 | ... | ... |
... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { |
9 | } | 9 | } |
10 | $ret=0 | 10 | $ret=0 |
11 | if (Test-Path "$basedir/node$exe") { | 11 | if (Test-Path "$basedir/node$exe") { |
12 | - & "$basedir/node$exe" "$basedir/../is-ci/bin.js" $args | 12 | + & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args |
13 | $ret=$LASTEXITCODE | 13 | $ret=$LASTEXITCODE |
14 | } else { | 14 | } else { |
15 | - & "node$exe" "$basedir/../is-ci/bin.js" $args | 15 | + & "node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args |
16 | $ret=$LASTEXITCODE | 16 | $ret=$LASTEXITCODE |
17 | } | 17 | } |
18 | exit $ret | 18 | exit $ret | ... | ... |
... | @@ -6,10 +6,10 @@ case `uname` in | ... | @@ -6,10 +6,10 @@ case `uname` in |
6 | esac | 6 | esac |
7 | 7 | ||
8 | if [ -x "$basedir/node" ]; then | 8 | if [ -x "$basedir/node" ]; then |
9 | - "$basedir/node" "$basedir/../nodemon/bin/nodemon.js" "$@" | 9 | + "$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@" |
10 | ret=$? | 10 | ret=$? |
11 | else | 11 | else |
12 | - node "$basedir/../nodemon/bin/nodemon.js" "$@" | 12 | + node "$basedir/../sshpk/bin/sshpk-sign" "$@" |
13 | ret=$? | 13 | ret=$? |
14 | fi | 14 | fi |
15 | exit $ret | 15 | exit $ret | ... | ... |
... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( | ... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( |
9 | SET PATHEXT=%PATHEXT:;.JS;=;% | 9 | SET PATHEXT=%PATHEXT:;.JS;=;% |
10 | ) | 10 | ) |
11 | 11 | ||
12 | -"%_prog%" "%dp0%\..\nodemon\bin\nodemon.js" %* | 12 | +"%_prog%" "%dp0%\..\sshpk\bin\sshpk-sign" %* |
13 | ENDLOCAL | 13 | ENDLOCAL |
14 | EXIT /b %errorlevel% | 14 | EXIT /b %errorlevel% |
15 | :find_dp0 | 15 | :find_dp0 | ... | ... |
... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { |
9 | } | 9 | } |
10 | $ret=0 | 10 | $ret=0 |
11 | if (Test-Path "$basedir/node$exe") { | 11 | if (Test-Path "$basedir/node$exe") { |
12 | - & "$basedir/node$exe" "$basedir/../nodemon/bin/nodemon.js" $args | 12 | + & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args |
13 | $ret=$LASTEXITCODE | 13 | $ret=$LASTEXITCODE |
14 | } else { | 14 | } else { |
15 | - & "node$exe" "$basedir/../nodemon/bin/nodemon.js" $args | 15 | + & "node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args |
16 | $ret=$LASTEXITCODE | 16 | $ret=$LASTEXITCODE |
17 | } | 17 | } |
18 | exit $ret | 18 | exit $ret | ... | ... |
... | @@ -6,10 +6,10 @@ case `uname` in | ... | @@ -6,10 +6,10 @@ case `uname` in |
6 | esac | 6 | esac |
7 | 7 | ||
8 | if [ -x "$basedir/node" ]; then | 8 | if [ -x "$basedir/node" ]; then |
9 | - "$basedir/node" "$basedir/../touch/bin/nodetouch.js" "$@" | 9 | + "$basedir/node" "$basedir/../sshpk/bin/sshpk-verify" "$@" |
10 | ret=$? | 10 | ret=$? |
11 | else | 11 | else |
12 | - node "$basedir/../touch/bin/nodetouch.js" "$@" | 12 | + node "$basedir/../sshpk/bin/sshpk-verify" "$@" |
13 | ret=$? | 13 | ret=$? |
14 | fi | 14 | fi |
15 | exit $ret | 15 | exit $ret | ... | ... |
... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( | ... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( |
9 | SET PATHEXT=%PATHEXT:;.JS;=;% | 9 | SET PATHEXT=%PATHEXT:;.JS;=;% |
10 | ) | 10 | ) |
11 | 11 | ||
12 | -"%_prog%" "%dp0%\..\touch\bin\nodetouch.js" %* | 12 | +"%_prog%" "%dp0%\..\sshpk\bin\sshpk-verify" %* |
13 | ENDLOCAL | 13 | ENDLOCAL |
14 | EXIT /b %errorlevel% | 14 | EXIT /b %errorlevel% |
15 | :find_dp0 | 15 | :find_dp0 | ... | ... |
... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { |
9 | } | 9 | } |
10 | $ret=0 | 10 | $ret=0 |
11 | if (Test-Path "$basedir/node$exe") { | 11 | if (Test-Path "$basedir/node$exe") { |
12 | - & "$basedir/node$exe" "$basedir/../touch/bin/nodetouch.js" $args | 12 | + & "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args |
13 | $ret=$LASTEXITCODE | 13 | $ret=$LASTEXITCODE |
14 | } else { | 14 | } else { |
15 | - & "node$exe" "$basedir/../touch/bin/nodetouch.js" $args | 15 | + & "node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args |
16 | $ret=$LASTEXITCODE | 16 | $ret=$LASTEXITCODE |
17 | } | 17 | } |
18 | exit $ret | 18 | exit $ret | ... | ... |
... | @@ -6,10 +6,10 @@ case `uname` in | ... | @@ -6,10 +6,10 @@ case `uname` in |
6 | esac | 6 | esac |
7 | 7 | ||
8 | if [ -x "$basedir/node" ]; then | 8 | if [ -x "$basedir/node" ]; then |
9 | - "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@" | 9 | + "$basedir/node" "$basedir/../uuid/bin/uuid" "$@" |
10 | ret=$? | 10 | ret=$? |
11 | else | 11 | else |
12 | - node "$basedir/../nopt/bin/nopt.js" "$@" | 12 | + node "$basedir/../uuid/bin/uuid" "$@" |
13 | ret=$? | 13 | ret=$? |
14 | fi | 14 | fi |
15 | exit $ret | 15 | exit $ret | ... | ... |
... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( | ... | @@ -9,7 +9,7 @@ IF EXIST "%dp0%\node.exe" ( |
9 | SET PATHEXT=%PATHEXT:;.JS;=;% | 9 | SET PATHEXT=%PATHEXT:;.JS;=;% |
10 | ) | 10 | ) |
11 | 11 | ||
12 | -"%_prog%" "%dp0%\..\nopt\bin\nopt.js" %* | 12 | +"%_prog%" "%dp0%\..\uuid\bin\uuid" %* |
13 | ENDLOCAL | 13 | ENDLOCAL |
14 | EXIT /b %errorlevel% | 14 | EXIT /b %errorlevel% |
15 | :find_dp0 | 15 | :find_dp0 | ... | ... |
... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ... | @@ -9,10 +9,10 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { |
9 | } | 9 | } |
10 | $ret=0 | 10 | $ret=0 |
11 | if (Test-Path "$basedir/node$exe") { | 11 | if (Test-Path "$basedir/node$exe") { |
12 | - & "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args | 12 | + & "$basedir/node$exe" "$basedir/../uuid/bin/uuid" $args |
13 | $ret=$LASTEXITCODE | 13 | $ret=$LASTEXITCODE |
14 | } else { | 14 | } else { |
15 | - & "node$exe" "$basedir/../nopt/bin/nopt.js" $args | 15 | + & "node$exe" "$basedir/../uuid/bin/uuid" $args |
16 | $ret=$LASTEXITCODE | 16 | $ret=$LASTEXITCODE |
17 | } | 17 | } |
18 | exit $ret | 18 | exit $ret | ... | ... |
1 | -/// <reference types="node" /> | ||
2 | -/// <reference lib="es2016" /> | ||
3 | -/// <reference lib="es2017.sharedmemory" /> | ||
4 | -/// <reference lib="esnext.asynciterable" /> | ||
5 | -/// <reference lib="dom" /> | ||
6 | -declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; | ||
7 | -declare type Primitive = null | undefined | string | number | boolean | Symbol; | ||
8 | -export interface ArrayLike { | ||
9 | - length: number; | ||
10 | -} | ||
11 | -export interface Class<T = unknown> { | ||
12 | - new (...args: any[]): T; | ||
13 | -} | ||
14 | -declare type DomElement = object & { | ||
15 | - nodeType: 1; | ||
16 | - nodeName: string; | ||
17 | -}; | ||
18 | -declare type NodeStream = object & { | ||
19 | - pipe: Function; | ||
20 | -}; | ||
21 | -export declare const enum TypeName { | ||
22 | - null = "null", | ||
23 | - boolean = "boolean", | ||
24 | - undefined = "undefined", | ||
25 | - string = "string", | ||
26 | - number = "number", | ||
27 | - symbol = "symbol", | ||
28 | - Function = "Function", | ||
29 | - GeneratorFunction = "GeneratorFunction", | ||
30 | - AsyncFunction = "AsyncFunction", | ||
31 | - Observable = "Observable", | ||
32 | - Array = "Array", | ||
33 | - Buffer = "Buffer", | ||
34 | - Object = "Object", | ||
35 | - RegExp = "RegExp", | ||
36 | - Date = "Date", | ||
37 | - Error = "Error", | ||
38 | - Map = "Map", | ||
39 | - Set = "Set", | ||
40 | - WeakMap = "WeakMap", | ||
41 | - WeakSet = "WeakSet", | ||
42 | - Int8Array = "Int8Array", | ||
43 | - Uint8Array = "Uint8Array", | ||
44 | - Uint8ClampedArray = "Uint8ClampedArray", | ||
45 | - Int16Array = "Int16Array", | ||
46 | - Uint16Array = "Uint16Array", | ||
47 | - Int32Array = "Int32Array", | ||
48 | - Uint32Array = "Uint32Array", | ||
49 | - Float32Array = "Float32Array", | ||
50 | - Float64Array = "Float64Array", | ||
51 | - ArrayBuffer = "ArrayBuffer", | ||
52 | - SharedArrayBuffer = "SharedArrayBuffer", | ||
53 | - DataView = "DataView", | ||
54 | - Promise = "Promise", | ||
55 | - URL = "URL" | ||
56 | -} | ||
57 | -declare function is(value: unknown): TypeName; | ||
58 | -declare namespace is { | ||
59 | - const undefined: (value: unknown) => value is undefined; | ||
60 | - const string: (value: unknown) => value is string; | ||
61 | - const number: (value: unknown) => value is number; | ||
62 | - const function_: (value: unknown) => value is Function; | ||
63 | - const null_: (value: unknown) => value is null; | ||
64 | - const class_: (value: unknown) => value is Class<unknown>; | ||
65 | - const boolean: (value: unknown) => value is boolean; | ||
66 | - const symbol: (value: unknown) => value is Symbol; | ||
67 | - const numericString: (value: unknown) => boolean; | ||
68 | - const array: (arg: any) => arg is any[]; | ||
69 | - const buffer: (input: unknown) => input is Buffer; | ||
70 | - const nullOrUndefined: (value: unknown) => value is null | undefined; | ||
71 | - const object: (value: unknown) => value is object; | ||
72 | - const iterable: (value: unknown) => value is IterableIterator<unknown>; | ||
73 | - const asyncIterable: (value: unknown) => value is AsyncIterableIterator<unknown>; | ||
74 | - const generator: (value: unknown) => value is Generator; | ||
75 | - const nativePromise: (value: unknown) => value is Promise<unknown>; | ||
76 | - const promise: (value: unknown) => value is Promise<unknown>; | ||
77 | - const generatorFunction: (value: unknown) => value is GeneratorFunction; | ||
78 | - const asyncFunction: (value: unknown) => value is Function; | ||
79 | - const boundFunction: (value: unknown) => value is Function; | ||
80 | - const regExp: (value: unknown) => value is RegExp; | ||
81 | - const date: (value: unknown) => value is Date; | ||
82 | - const error: (value: unknown) => value is Error; | ||
83 | - const map: (value: unknown) => value is Map<unknown, unknown>; | ||
84 | - const set: (value: unknown) => value is Set<unknown>; | ||
85 | - const weakMap: (value: unknown) => value is WeakMap<object, unknown>; | ||
86 | - const weakSet: (value: unknown) => value is WeakSet<object>; | ||
87 | - const int8Array: (value: unknown) => value is Int8Array; | ||
88 | - const uint8Array: (value: unknown) => value is Uint8Array; | ||
89 | - const uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray; | ||
90 | - const int16Array: (value: unknown) => value is Int16Array; | ||
91 | - const uint16Array: (value: unknown) => value is Uint16Array; | ||
92 | - const int32Array: (value: unknown) => value is Int32Array; | ||
93 | - const uint32Array: (value: unknown) => value is Uint32Array; | ||
94 | - const float32Array: (value: unknown) => value is Float32Array; | ||
95 | - const float64Array: (value: unknown) => value is Float64Array; | ||
96 | - const arrayBuffer: (value: unknown) => value is ArrayBuffer; | ||
97 | - const sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer; | ||
98 | - const dataView: (value: unknown) => value is DataView; | ||
99 | - const directInstanceOf: <T>(instance: unknown, klass: Class<T>) => instance is T; | ||
100 | - const urlInstance: (value: unknown) => value is URL; | ||
101 | - const urlString: (value: unknown) => boolean; | ||
102 | - const truthy: (value: unknown) => boolean; | ||
103 | - const falsy: (value: unknown) => boolean; | ||
104 | - const nan: (value: unknown) => boolean; | ||
105 | - const primitive: (value: unknown) => value is Primitive; | ||
106 | - const integer: (value: unknown) => value is number; | ||
107 | - const safeInteger: (value: unknown) => value is number; | ||
108 | - const plainObject: (value: unknown) => boolean; | ||
109 | - const typedArray: (value: unknown) => value is TypedArray; | ||
110 | - const arrayLike: (value: unknown) => value is ArrayLike; | ||
111 | - const inRange: (value: number, range: number | number[]) => boolean; | ||
112 | - const domElement: (value: unknown) => value is DomElement; | ||
113 | - const observable: (value: unknown) => boolean; | ||
114 | - const nodeStream: (value: unknown) => value is NodeStream; | ||
115 | - const infinite: (value: unknown) => boolean; | ||
116 | - const even: (value: number) => boolean; | ||
117 | - const odd: (value: number) => boolean; | ||
118 | - const emptyArray: (value: unknown) => boolean; | ||
119 | - const nonEmptyArray: (value: unknown) => boolean; | ||
120 | - const emptyString: (value: unknown) => boolean; | ||
121 | - const nonEmptyString: (value: unknown) => boolean; | ||
122 | - const emptyStringOrWhitespace: (value: unknown) => boolean; | ||
123 | - const emptyObject: (value: unknown) => boolean; | ||
124 | - const nonEmptyObject: (value: unknown) => boolean; | ||
125 | - const emptySet: (value: unknown) => boolean; | ||
126 | - const nonEmptySet: (value: unknown) => boolean; | ||
127 | - const emptyMap: (value: unknown) => boolean; | ||
128 | - const nonEmptyMap: (value: unknown) => boolean; | ||
129 | - const any: (predicate: unknown, ...values: unknown[]) => boolean; | ||
130 | - const all: (predicate: unknown, ...values: unknown[]) => boolean; | ||
131 | -} | ||
132 | -export default is; |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | -{ | ||
2 | - "_from": "@sindresorhus/is@^0.14.0", | ||
3 | - "_id": "@sindresorhus/is@0.14.0", | ||
4 | - "_inBundle": false, | ||
5 | - "_integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", | ||
6 | - "_location": "/@sindresorhus/is", | ||
7 | - "_phantomChildren": {}, | ||
8 | - "_requested": { | ||
9 | - "type": "range", | ||
10 | - "registry": true, | ||
11 | - "raw": "@sindresorhus/is@^0.14.0", | ||
12 | - "name": "@sindresorhus/is", | ||
13 | - "escapedName": "@sindresorhus%2fis", | ||
14 | - "scope": "@sindresorhus", | ||
15 | - "rawSpec": "^0.14.0", | ||
16 | - "saveSpec": null, | ||
17 | - "fetchSpec": "^0.14.0" | ||
18 | - }, | ||
19 | - "_requiredBy": [ | ||
20 | - "/got" | ||
21 | - ], | ||
22 | - "_resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", | ||
23 | - "_shasum": "9fb3a3cf3132328151f353de4632e01e52102bea", | ||
24 | - "_spec": "@sindresorhus/is@^0.14.0", | ||
25 | - "_where": "C:\\Users\\10120\\Desktop\\OSS PJ\\project\\express\\node_modules\\got", | ||
26 | - "author": { | ||
27 | - "name": "Sindre Sorhus", | ||
28 | - "email": "sindresorhus@gmail.com", | ||
29 | - "url": "sindresorhus.com" | ||
30 | - }, | ||
31 | - "bugs": { | ||
32 | - "url": "https://github.com/sindresorhus/is/issues" | ||
33 | - }, | ||
34 | - "bundleDependencies": false, | ||
35 | - "deprecated": false, | ||
36 | - "description": "Type check values: `is.string('🦄') //=> true`", | ||
37 | - "devDependencies": { | ||
38 | - "@sindresorhus/tsconfig": "^0.1.0", | ||
39 | - "@types/jsdom": "^11.12.0", | ||
40 | - "@types/node": "^10.12.10", | ||
41 | - "@types/tempy": "^0.2.0", | ||
42 | - "@types/zen-observable": "^0.8.0", | ||
43 | - "ava": "^0.25.0", | ||
44 | - "del-cli": "^1.1.0", | ||
45 | - "jsdom": "^11.6.2", | ||
46 | - "rxjs": "^6.3.3", | ||
47 | - "tempy": "^0.2.1", | ||
48 | - "tslint": "^5.9.1", | ||
49 | - "tslint-xo": "^0.10.0", | ||
50 | - "typescript": "^3.2.1", | ||
51 | - "zen-observable": "^0.8.8" | ||
52 | - }, | ||
53 | - "engines": { | ||
54 | - "node": ">=6" | ||
55 | - }, | ||
56 | - "files": [ | ||
57 | - "dist" | ||
58 | - ], | ||
59 | - "homepage": "https://github.com/sindresorhus/is#readme", | ||
60 | - "keywords": [ | ||
61 | - "type", | ||
62 | - "types", | ||
63 | - "is", | ||
64 | - "check", | ||
65 | - "checking", | ||
66 | - "validate", | ||
67 | - "validation", | ||
68 | - "utility", | ||
69 | - "util", | ||
70 | - "typeof", | ||
71 | - "instanceof", | ||
72 | - "object", | ||
73 | - "assert", | ||
74 | - "assertion", | ||
75 | - "test", | ||
76 | - "kind", | ||
77 | - "primitive", | ||
78 | - "verify", | ||
79 | - "compare" | ||
80 | - ], | ||
81 | - "license": "MIT", | ||
82 | - "main": "dist/index.js", | ||
83 | - "name": "@sindresorhus/is", | ||
84 | - "repository": { | ||
85 | - "type": "git", | ||
86 | - "url": "git+https://github.com/sindresorhus/is.git" | ||
87 | - }, | ||
88 | - "scripts": { | ||
89 | - "build": "del dist && tsc", | ||
90 | - "lint": "tslint --format stylish --project .", | ||
91 | - "prepublish": "npm run build && del dist/tests", | ||
92 | - "test": "npm run lint && npm run build && ava dist/tests" | ||
93 | - }, | ||
94 | - "types": "dist/index.d.ts", | ||
95 | - "version": "0.14.0" | ||
96 | -} |
This diff is collapsed. Click to expand it.
1 | -# http-timer | ||
2 | -> Timings for HTTP requests | ||
3 | - | ||
4 | -[![Build Status](https://travis-ci.org/szmarczak/http-timer.svg?branch=master)](https://travis-ci.org/szmarczak/http-timer) | ||
5 | -[![Coverage Status](https://coveralls.io/repos/github/szmarczak/http-timer/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/http-timer?branch=master) | ||
6 | -[![install size](https://packagephobia.now.sh/badge?p=@szmarczak/http-timer)](https://packagephobia.now.sh/result?p=@szmarczak/http-timer) | ||
7 | - | ||
8 | -Inspired by the [`request` package](https://github.com/request/request). | ||
9 | - | ||
10 | -## Usage | ||
11 | -```js | ||
12 | -'use strict'; | ||
13 | -const https = require('https'); | ||
14 | -const timer = require('@szmarczak/http-timer'); | ||
15 | - | ||
16 | -const request = https.get('https://httpbin.org/anything'); | ||
17 | -const timings = timer(request); | ||
18 | - | ||
19 | -request.on('response', response => { | ||
20 | - response.on('data', () => {}); // Consume the data somehow | ||
21 | - response.on('end', () => { | ||
22 | - console.log(timings); | ||
23 | - }); | ||
24 | -}); | ||
25 | - | ||
26 | -// { start: 1535708511443, | ||
27 | -// socket: 1535708511444, | ||
28 | -// lookup: 1535708511444, | ||
29 | -// connect: 1535708511582, | ||
30 | -// upload: 1535708511887, | ||
31 | -// response: 1535708512037, | ||
32 | -// end: 1535708512040, | ||
33 | -// phases: | ||
34 | -// { wait: 1, | ||
35 | -// dns: 0, | ||
36 | -// tcp: 138, | ||
37 | -// request: 305, | ||
38 | -// firstByte: 150, | ||
39 | -// download: 3, | ||
40 | -// total: 597 } } | ||
41 | -``` | ||
42 | - | ||
43 | -## API | ||
44 | - | ||
45 | -### timer(request) | ||
46 | - | ||
47 | -Returns: `Object` | ||
48 | - | ||
49 | -- `start` - Time when the request started. | ||
50 | -- `socket` - Time when a socket was assigned to the request. | ||
51 | -- `lookup` - Time when the DNS lookup finished. | ||
52 | -- `connect` - Time when the socket successfully connected. | ||
53 | -- `upload` - Time when the request finished uploading. | ||
54 | -- `response` - Time when the request fired the `response` event. | ||
55 | -- `end` - Time when the response fired the `end` event. | ||
56 | -- `error` - Time when the request fired the `error` event. | ||
57 | -- `phases` | ||
58 | - - `wait` - `timings.socket - timings.start` | ||
59 | - - `dns` - `timings.lookup - timings.socket` | ||
60 | - - `tcp` - `timings.connect - timings.lookup` | ||
61 | - - `request` - `timings.upload - timings.connect` | ||
62 | - - `firstByte` - `timings.response - timings.upload` | ||
63 | - - `download` - `timings.end - timings.response` | ||
64 | - - `total` - `timings.end - timings.start` or `timings.error - timings.start` | ||
65 | - | ||
66 | -**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch. | ||
67 | - | ||
68 | -## License | ||
69 | - | ||
70 | -MIT |
1 | -{ | ||
2 | - "_from": "@szmarczak/http-timer@^1.1.2", | ||
3 | - "_id": "@szmarczak/http-timer@1.1.2", | ||
4 | - "_inBundle": false, | ||
5 | - "_integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", | ||
6 | - "_location": "/@szmarczak/http-timer", | ||
7 | - "_phantomChildren": {}, | ||
8 | - "_requested": { | ||
9 | - "type": "range", | ||
10 | - "registry": true, | ||
11 | - "raw": "@szmarczak/http-timer@^1.1.2", | ||
12 | - "name": "@szmarczak/http-timer", | ||
13 | - "escapedName": "@szmarczak%2fhttp-timer", | ||
14 | - "scope": "@szmarczak", | ||
15 | - "rawSpec": "^1.1.2", | ||
16 | - "saveSpec": null, | ||
17 | - "fetchSpec": "^1.1.2" | ||
18 | - }, | ||
19 | - "_requiredBy": [ | ||
20 | - "/got" | ||
21 | - ], | ||
22 | - "_resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", | ||
23 | - "_shasum": "b1665e2c461a2cd92f4c1bbf50d5454de0d4b421", | ||
24 | - "_spec": "@szmarczak/http-timer@^1.1.2", | ||
25 | - "_where": "C:\\Users\\10120\\Desktop\\OSS PJ\\project\\express\\node_modules\\got", | ||
26 | - "author": { | ||
27 | - "name": "Szymon Marczak" | ||
28 | - }, | ||
29 | - "bugs": { | ||
30 | - "url": "https://github.com/szmarczak/http-timer/issues" | ||
31 | - }, | ||
32 | - "bundleDependencies": false, | ||
33 | - "dependencies": { | ||
34 | - "defer-to-connect": "^1.0.1" | ||
35 | - }, | ||
36 | - "deprecated": false, | ||
37 | - "description": "Timings for HTTP requests", | ||
38 | - "devDependencies": { | ||
39 | - "ava": "^0.25.0", | ||
40 | - "coveralls": "^3.0.2", | ||
41 | - "nyc": "^12.0.2", | ||
42 | - "p-event": "^2.1.0", | ||
43 | - "xo": "^0.22.0" | ||
44 | - }, | ||
45 | - "engines": { | ||
46 | - "node": ">=6" | ||
47 | - }, | ||
48 | - "files": [ | ||
49 | - "source" | ||
50 | - ], | ||
51 | - "homepage": "https://github.com/szmarczak/http-timer#readme", | ||
52 | - "keywords": [ | ||
53 | - "http", | ||
54 | - "https", | ||
55 | - "timer", | ||
56 | - "timings" | ||
57 | - ], | ||
58 | - "license": "MIT", | ||
59 | - "main": "source", | ||
60 | - "name": "@szmarczak/http-timer", | ||
61 | - "repository": { | ||
62 | - "type": "git", | ||
63 | - "url": "git+https://github.com/szmarczak/http-timer.git" | ||
64 | - }, | ||
65 | - "scripts": { | ||
66 | - "coveralls": "nyc report --reporter=text-lcov | coveralls", | ||
67 | - "test": "xo && nyc ava" | ||
68 | - }, | ||
69 | - "version": "1.1.2", | ||
70 | - "xo": { | ||
71 | - "rules": { | ||
72 | - "unicorn/filename-case": "camelCase" | ||
73 | - } | ||
74 | - } | ||
75 | -} |
1 | -'use strict'; | ||
2 | -const deferToConnect = require('defer-to-connect'); | ||
3 | - | ||
4 | -module.exports = request => { | ||
5 | - const timings = { | ||
6 | - start: Date.now(), | ||
7 | - socket: null, | ||
8 | - lookup: null, | ||
9 | - connect: null, | ||
10 | - upload: null, | ||
11 | - response: null, | ||
12 | - end: null, | ||
13 | - error: null, | ||
14 | - phases: { | ||
15 | - wait: null, | ||
16 | - dns: null, | ||
17 | - tcp: null, | ||
18 | - request: null, | ||
19 | - firstByte: null, | ||
20 | - download: null, | ||
21 | - total: null | ||
22 | - } | ||
23 | - }; | ||
24 | - | ||
25 | - const handleError = origin => { | ||
26 | - const emit = origin.emit.bind(origin); | ||
27 | - origin.emit = (event, ...args) => { | ||
28 | - // Catches the `error` event | ||
29 | - if (event === 'error') { | ||
30 | - timings.error = Date.now(); | ||
31 | - timings.phases.total = timings.error - timings.start; | ||
32 | - | ||
33 | - origin.emit = emit; | ||
34 | - } | ||
35 | - | ||
36 | - // Saves the original behavior | ||
37 | - return emit(event, ...args); | ||
38 | - }; | ||
39 | - }; | ||
40 | - | ||
41 | - let uploadFinished = false; | ||
42 | - const onUpload = () => { | ||
43 | - timings.upload = Date.now(); | ||
44 | - timings.phases.request = timings.upload - timings.connect; | ||
45 | - }; | ||
46 | - | ||
47 | - handleError(request); | ||
48 | - | ||
49 | - request.once('socket', socket => { | ||
50 | - timings.socket = Date.now(); | ||
51 | - timings.phases.wait = timings.socket - timings.start; | ||
52 | - | ||
53 | - const lookupListener = () => { | ||
54 | - timings.lookup = Date.now(); | ||
55 | - timings.phases.dns = timings.lookup - timings.socket; | ||
56 | - }; | ||
57 | - | ||
58 | - socket.once('lookup', lookupListener); | ||
59 | - | ||
60 | - deferToConnect(socket, () => { | ||
61 | - timings.connect = Date.now(); | ||
62 | - | ||
63 | - if (timings.lookup === null) { | ||
64 | - socket.removeListener('lookup', lookupListener); | ||
65 | - timings.lookup = timings.connect; | ||
66 | - timings.phases.dns = timings.lookup - timings.socket; | ||
67 | - } | ||
68 | - | ||
69 | - timings.phases.tcp = timings.connect - timings.lookup; | ||
70 | - | ||
71 | - if (uploadFinished && !timings.upload) { | ||
72 | - onUpload(); | ||
73 | - } | ||
74 | - }); | ||
75 | - }); | ||
76 | - | ||
77 | - request.once('finish', () => { | ||
78 | - uploadFinished = true; | ||
79 | - | ||
80 | - if (timings.connect) { | ||
81 | - onUpload(); | ||
82 | - } | ||
83 | - }); | ||
84 | - | ||
85 | - request.once('response', response => { | ||
86 | - timings.response = Date.now(); | ||
87 | - timings.phases.firstByte = timings.response - timings.upload; | ||
88 | - | ||
89 | - handleError(response); | ||
90 | - | ||
91 | - response.once('end', () => { | ||
92 | - timings.end = Date.now(); | ||
93 | - timings.phases.download = timings.end - timings.response; | ||
94 | - timings.phases.total = timings.end - timings.start; | ||
95 | - }); | ||
96 | - }); | ||
97 | - | ||
98 | - return timings; | ||
99 | -}; |
express/node_modules/abbrev/LICENSE
deleted
100644 → 0
1 | -This software is dual-licensed under the ISC and MIT licenses. | ||
2 | -You may use this software under EITHER of the following licenses. | ||
3 | - | ||
4 | ----------- | ||
5 | - | ||
6 | -The ISC License | ||
7 | - | ||
8 | -Copyright (c) Isaac Z. Schlueter and Contributors | ||
9 | - | ||
10 | -Permission to use, copy, modify, and/or distribute this software for any | ||
11 | -purpose with or without fee is hereby granted, provided that the above | ||
12 | -copyright notice and this permission notice appear in all copies. | ||
13 | - | ||
14 | -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
15 | -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
16 | -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
17 | -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
18 | -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
19 | -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR | ||
20 | -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
21 | - | ||
22 | ----------- | ||
23 | - | ||
24 | -Copyright Isaac Z. Schlueter and Contributors | ||
25 | -All rights reserved. | ||
26 | - | ||
27 | -Permission is hereby granted, free of charge, to any person | ||
28 | -obtaining a copy of this software and associated documentation | ||
29 | -files (the "Software"), to deal in the Software without | ||
30 | -restriction, including without limitation the rights to use, | ||
31 | -copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
32 | -copies of the Software, and to permit persons to whom the | ||
33 | -Software is furnished to do so, subject to the following | ||
34 | -conditions: | ||
35 | - | ||
36 | -The above copyright notice and this permission notice shall be | ||
37 | -included in all copies or substantial portions of the Software. | ||
38 | - | ||
39 | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
40 | -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
41 | -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
42 | -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
43 | -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
44 | -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
45 | -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
46 | -OTHER DEALINGS IN THE SOFTWARE. |
1 | -# abbrev-js | ||
2 | - | ||
3 | -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). | ||
4 | - | ||
5 | -Usage: | ||
6 | - | ||
7 | - var abbrev = require("abbrev"); | ||
8 | - abbrev("foo", "fool", "folding", "flop"); | ||
9 | - | ||
10 | - // returns: | ||
11 | - { fl: 'flop' | ||
12 | - , flo: 'flop' | ||
13 | - , flop: 'flop' | ||
14 | - , fol: 'folding' | ||
15 | - , fold: 'folding' | ||
16 | - , foldi: 'folding' | ||
17 | - , foldin: 'folding' | ||
18 | - , folding: 'folding' | ||
19 | - , foo: 'foo' | ||
20 | - , fool: 'fool' | ||
21 | - } | ||
22 | - | ||
23 | -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. |
1 | -module.exports = exports = abbrev.abbrev = abbrev | ||
2 | - | ||
3 | -abbrev.monkeyPatch = monkeyPatch | ||
4 | - | ||
5 | -function monkeyPatch () { | ||
6 | - Object.defineProperty(Array.prototype, 'abbrev', { | ||
7 | - value: function () { return abbrev(this) }, | ||
8 | - enumerable: false, configurable: true, writable: true | ||
9 | - }) | ||
10 | - | ||
11 | - Object.defineProperty(Object.prototype, 'abbrev', { | ||
12 | - value: function () { return abbrev(Object.keys(this)) }, | ||
13 | - enumerable: false, configurable: true, writable: true | ||
14 | - }) | ||
15 | -} | ||
16 | - | ||
17 | -function abbrev (list) { | ||
18 | - if (arguments.length !== 1 || !Array.isArray(list)) { | ||
19 | - list = Array.prototype.slice.call(arguments, 0) | ||
20 | - } | ||
21 | - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { | ||
22 | - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) | ||
23 | - } | ||
24 | - | ||
25 | - // sort them lexicographically, so that they're next to their nearest kin | ||
26 | - args = args.sort(lexSort) | ||
27 | - | ||
28 | - // walk through each, seeing how much it has in common with the next and previous | ||
29 | - var abbrevs = {} | ||
30 | - , prev = "" | ||
31 | - for (var i = 0, l = args.length ; i < l ; i ++) { | ||
32 | - var current = args[i] | ||
33 | - , next = args[i + 1] || "" | ||
34 | - , nextMatches = true | ||
35 | - , prevMatches = true | ||
36 | - if (current === next) continue | ||
37 | - for (var j = 0, cl = current.length ; j < cl ; j ++) { | ||
38 | - var curChar = current.charAt(j) | ||
39 | - nextMatches = nextMatches && curChar === next.charAt(j) | ||
40 | - prevMatches = prevMatches && curChar === prev.charAt(j) | ||
41 | - if (!nextMatches && !prevMatches) { | ||
42 | - j ++ | ||
43 | - break | ||
44 | - } | ||
45 | - } | ||
46 | - prev = current | ||
47 | - if (j === cl) { | ||
48 | - abbrevs[current] = current | ||
49 | - continue | ||
50 | - } | ||
51 | - for (var a = current.substr(0, j) ; j <= cl ; j ++) { | ||
52 | - abbrevs[a] = current | ||
53 | - a += current.charAt(j) | ||
54 | - } | ||
55 | - } | ||
56 | - return abbrevs | ||
57 | -} | ||
58 | - | ||
59 | -function lexSort (a, b) { | ||
60 | - return a === b ? 0 : a > b ? 1 : -1 | ||
61 | -} |
1 | -{ | ||
2 | - "_from": "abbrev@1", | ||
3 | - "_id": "abbrev@1.1.1", | ||
4 | - "_inBundle": false, | ||
5 | - "_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", | ||
6 | - "_location": "/abbrev", | ||
7 | - "_phantomChildren": {}, | ||
8 | - "_requested": { | ||
9 | - "type": "range", | ||
10 | - "registry": true, | ||
11 | - "raw": "abbrev@1", | ||
12 | - "name": "abbrev", | ||
13 | - "escapedName": "abbrev", | ||
14 | - "rawSpec": "1", | ||
15 | - "saveSpec": null, | ||
16 | - "fetchSpec": "1" | ||
17 | - }, | ||
18 | - "_requiredBy": [ | ||
19 | - "/nopt" | ||
20 | - ], | ||
21 | - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", | ||
22 | - "_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8", | ||
23 | - "_spec": "abbrev@1", | ||
24 | - "_where": "C:\\Users\\10120\\Desktop\\OSS PJ\\project\\express\\node_modules\\nopt", | ||
25 | - "author": { | ||
26 | - "name": "Isaac Z. Schlueter", | ||
27 | - "email": "i@izs.me" | ||
28 | - }, | ||
29 | - "bugs": { | ||
30 | - "url": "https://github.com/isaacs/abbrev-js/issues" | ||
31 | - }, | ||
32 | - "bundleDependencies": false, | ||
33 | - "deprecated": false, | ||
34 | - "description": "Like ruby's abbrev module, but in js", | ||
35 | - "devDependencies": { | ||
36 | - "tap": "^10.1" | ||
37 | - }, | ||
38 | - "files": [ | ||
39 | - "abbrev.js" | ||
40 | - ], | ||
41 | - "homepage": "https://github.com/isaacs/abbrev-js#readme", | ||
42 | - "license": "ISC", | ||
43 | - "main": "abbrev.js", | ||
44 | - "name": "abbrev", | ||
45 | - "repository": { | ||
46 | - "type": "git", | ||
47 | - "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" | ||
48 | - }, | ||
49 | - "scripts": { | ||
50 | - "postpublish": "git push origin --all; git push origin --tags", | ||
51 | - "postversion": "npm publish", | ||
52 | - "preversion": "npm test", | ||
53 | - "test": "tap test.js --100" | ||
54 | - }, | ||
55 | - "version": "1.1.1" | ||
56 | -} |
express/node_modules/ajv/.tonic_example.js
0 → 100644
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 |
1 | The MIT License (MIT) | 1 | The MIT License (MIT) |
2 | 2 | ||
3 | -Copyright (c) 2016-2018 Thomas Watson Steen | 3 | +Copyright (c) 2015-2017 Evgeny Poberezkin |
4 | 4 | ||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | 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 | 6 | of this software and associated documentation files (the "Software"), to deal |
... | @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ... | @@ -19,3 +19,4 @@ 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, | 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 | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
21 | SOFTWARE. | 21 | SOFTWARE. |
22 | + | ... | ... |
express/node_modules/ajv/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/dist/ajv.bundle.js
0 → 100644
This diff could not be displayed because it is too large.
express/node_modules/ajv/dist/ajv.min.js
0 → 100644
This diff could not be displayed because it is too large.
express/node_modules/ajv/dist/ajv.min.js.map
0 → 100644
This diff could not be displayed because it is too large.
express/node_modules/ajv/lib/ajv.d.ts
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/ajv.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/cache.js
0 → 100644
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 | +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 URI = require('uri-js') | ||
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 = URI.parse(ref) | ||
71 | + , refPath = _getFullPath(p) | ||
72 | + , baseId = getFullPath(this._getId(root.schema)); | ||
73 | + if (Object.keys(root.schema).length === 0 || 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.fragment = parsedRef.fragment || ''; | ||
119 | + if (parsedRef.fragment.slice(0,1) != '/') return; | ||
120 | + var parts = parsedRef.fragment.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 = URI.parse(id); | ||
210 | + return _getFullPath(p); | ||
211 | +} | ||
212 | + | ||
213 | + | ||
214 | +function _getFullPath(p) { | ||
215 | + return URI.serialize(p).split('#')[0] + '#'; | ||
216 | +} | ||
217 | + | ||
218 | + | ||
219 | +var TRAILING_SLASH_HASH = /#\/?$/; | ||
220 | +function normalizeId(id) { | ||
221 | + return id ? id.replace(TRAILING_SLASH_HASH, '') : ''; | ||
222 | +} | ||
223 | + | ||
224 | + | ||
225 | +function resolveUrl(baseId, id) { | ||
226 | + id = normalizeId(id); | ||
227 | + return URI.resolve(baseId, id); | ||
228 | +} | ||
229 | + | ||
230 | + | ||
231 | +/* @this Ajv */ | ||
232 | +function resolveIds(schema) { | ||
233 | + var schemaId = normalizeId(this._getId(schema)); | ||
234 | + var baseIds = {'': schemaId}; | ||
235 | + var fullPaths = {'': getFullPath(schemaId, false)}; | ||
236 | + var localRefs = {}; | ||
237 | + var self = this; | ||
238 | + | ||
239 | + traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { | ||
240 | + if (jsonPtr === '') return; | ||
241 | + var id = self._getId(sch); | ||
242 | + var baseId = baseIds[parentJsonPtr]; | ||
243 | + var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword; | ||
244 | + if (keyIndex !== undefined) | ||
245 | + fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex)); | ||
246 | + | ||
247 | + if (typeof id == 'string') { | ||
248 | + id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id); | ||
249 | + | ||
250 | + var refVal = self._refs[id]; | ||
251 | + if (typeof refVal == 'string') refVal = self._refs[refVal]; | ||
252 | + if (refVal && refVal.schema) { | ||
253 | + if (!equal(sch, refVal.schema)) | ||
254 | + throw new Error('id "' + id + '" resolves to more than one schema'); | ||
255 | + } else if (id != normalizeId(fullPath)) { | ||
256 | + if (id[0] == '#') { | ||
257 | + if (localRefs[id] && !equal(sch, localRefs[id])) | ||
258 | + throw new Error('id "' + id + '" resolves to more than one schema'); | ||
259 | + localRefs[id] = sch; | ||
260 | + } else { | ||
261 | + self._refs[id] = fullPath; | ||
262 | + } | ||
263 | + } | ||
264 | + } | ||
265 | + baseIds[jsonPtr] = baseId; | ||
266 | + fullPaths[jsonPtr] = fullPath; | ||
267 | + }); | ||
268 | + | ||
269 | + return localRefs; | ||
270 | +} |
1 | +'use strict'; | ||
2 | + | ||
3 | +var ruleModules = require('../dotjs') | ||
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', 'items', 'contains', 'uniqueItems' ] }, | ||
15 | + { type: 'object', | ||
16 | + rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames', | ||
17 | + { 'properties': ['additionalProperties', 'patternProperties'] } ] }, | ||
18 | + { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] } | ||
19 | + ]; | ||
20 | + | ||
21 | + var ALL = [ 'type', '$comment' ]; | ||
22 | + var KEYWORDS = [ | ||
23 | + '$schema', '$id', 'id', '$data', '$async', 'title', | ||
24 | + 'description', 'default', 'definitions', | ||
25 | + 'examples', 'readOnly', 'writeOnly', | ||
26 | + 'contentMediaType', 'contentEncoding', | ||
27 | + 'additionalItems', 'then', 'else' | ||
28 | + ]; | ||
29 | + var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; | ||
30 | + RULES.all = toHash(ALL); | ||
31 | + RULES.types = toHash(TYPES); | ||
32 | + | ||
33 | + RULES.forEach(function (group) { | ||
34 | + group.rules = group.rules.map(function (keyword) { | ||
35 | + var implKeywords; | ||
36 | + if (typeof keyword == 'object') { | ||
37 | + var key = Object.keys(keyword)[0]; | ||
38 | + implKeywords = keyword[key]; | ||
39 | + keyword = key; | ||
40 | + implKeywords.forEach(function (k) { | ||
41 | + ALL.push(k); | ||
42 | + RULES.all[k] = true; | ||
43 | + }); | ||
44 | + } | ||
45 | + ALL.push(keyword); | ||
46 | + var rule = RULES.all[keyword] = { | ||
47 | + keyword: keyword, | ||
48 | + code: ruleModules[keyword], | ||
49 | + implements: implKeywords | ||
50 | + }; | ||
51 | + return rule; | ||
52 | + }); | ||
53 | + | ||
54 | + RULES.all.$comment = { | ||
55 | + keyword: '$comment', | ||
56 | + code: ruleModules.$comment | ||
57 | + }; | ||
58 | + | ||
59 | + if (group.type) RULES.types[group.type] = group; | ||
60 | + }); | ||
61 | + | ||
62 | + RULES.keywords = toHash(ALL.concat(KEYWORDS)); | ||
63 | + RULES.custom = {}; | ||
64 | + | ||
65 | + return RULES; | ||
66 | +}; |
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 | +}; |
express/node_modules/ajv/lib/compile/util.js
0 → 100644
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 | + schemaHasRules: schemaHasRules, | ||
17 | + schemaHasRulesExcept: schemaHasRulesExcept, | ||
18 | + schemaUnknownRules: schemaUnknownRules, | ||
19 | + toQuotedString: toQuotedString, | ||
20 | + getPathExpr: getPathExpr, | ||
21 | + getPath: getPath, | ||
22 | + getData: getData, | ||
23 | + unescapeFragment: unescapeFragment, | ||
24 | + unescapeJsonPointer: unescapeJsonPointer, | ||
25 | + escapeFragment: escapeFragment, | ||
26 | + escapeJsonPointer: escapeJsonPointer | ||
27 | +}; | ||
28 | + | ||
29 | + | ||
30 | +function copy(o, to) { | ||
31 | + to = to || {}; | ||
32 | + for (var key in o) to[key] = o[key]; | ||
33 | + return to; | ||
34 | +} | ||
35 | + | ||
36 | + | ||
37 | +function checkDataType(dataType, data, strictNumbers, negate) { | ||
38 | + var EQUAL = negate ? ' !== ' : ' === ' | ||
39 | + , AND = negate ? ' || ' : ' && ' | ||
40 | + , OK = negate ? '!' : '' | ||
41 | + , NOT = negate ? '' : '!'; | ||
42 | + switch (dataType) { | ||
43 | + case 'null': return data + EQUAL + 'null'; | ||
44 | + case 'array': return OK + 'Array.isArray(' + data + ')'; | ||
45 | + case 'object': return '(' + OK + data + AND + | ||
46 | + 'typeof ' + data + EQUAL + '"object"' + AND + | ||
47 | + NOT + 'Array.isArray(' + data + '))'; | ||
48 | + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + | ||
49 | + NOT + '(' + data + ' % 1)' + | ||
50 | + AND + data + EQUAL + data + | ||
51 | + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; | ||
52 | + case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + | ||
53 | + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; | ||
54 | + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; | ||
55 | + } | ||
56 | +} | ||
57 | + | ||
58 | + | ||
59 | +function checkDataTypes(dataTypes, data, strictNumbers) { | ||
60 | + switch (dataTypes.length) { | ||
61 | + case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); | ||
62 | + default: | ||
63 | + var code = ''; | ||
64 | + var types = toHash(dataTypes); | ||
65 | + if (types.array && types.object) { | ||
66 | + code = types.null ? '(': '(!' + data + ' || '; | ||
67 | + code += 'typeof ' + data + ' !== "object")'; | ||
68 | + delete types.null; | ||
69 | + delete types.array; | ||
70 | + delete types.object; | ||
71 | + } | ||
72 | + if (types.number) delete types.integer; | ||
73 | + for (var t in types) | ||
74 | + code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); | ||
75 | + | ||
76 | + return code; | ||
77 | + } | ||
78 | +} | ||
79 | + | ||
80 | + | ||
81 | +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); | ||
82 | +function coerceToTypes(optionCoerceTypes, dataTypes) { | ||
83 | + if (Array.isArray(dataTypes)) { | ||
84 | + var types = []; | ||
85 | + for (var i=0; i<dataTypes.length; i++) { | ||
86 | + var t = dataTypes[i]; | ||
87 | + if (COERCE_TO_TYPES[t]) types[types.length] = t; | ||
88 | + else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t; | ||
89 | + } | ||
90 | + if (types.length) return types; | ||
91 | + } else if (COERCE_TO_TYPES[dataTypes]) { | ||
92 | + return [dataTypes]; | ||
93 | + } else if (optionCoerceTypes === 'array' && dataTypes === 'array') { | ||
94 | + return ['array']; | ||
95 | + } | ||
96 | +} | ||
97 | + | ||
98 | + | ||
99 | +function toHash(arr) { | ||
100 | + var hash = {}; | ||
101 | + for (var i=0; i<arr.length; i++) hash[arr[i]] = true; | ||
102 | + return hash; | ||
103 | +} | ||
104 | + | ||
105 | + | ||
106 | +var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; | ||
107 | +var SINGLE_QUOTE = /'|\\/g; | ||
108 | +function getProperty(key) { | ||
109 | + return typeof key == 'number' | ||
110 | + ? '[' + key + ']' | ||
111 | + : IDENTIFIER.test(key) | ||
112 | + ? '.' + key | ||
113 | + : "['" + escapeQuotes(key) + "']"; | ||
114 | +} | ||
115 | + | ||
116 | + | ||
117 | +function escapeQuotes(str) { | ||
118 | + return str.replace(SINGLE_QUOTE, '\\$&') | ||
119 | + .replace(/\n/g, '\\n') | ||
120 | + .replace(/\r/g, '\\r') | ||
121 | + .replace(/\f/g, '\\f') | ||
122 | + .replace(/\t/g, '\\t'); | ||
123 | +} | ||
124 | + | ||
125 | + | ||
126 | +function varOccurences(str, dataVar) { | ||
127 | + dataVar += '[^0-9]'; | ||
128 | + var matches = str.match(new RegExp(dataVar, 'g')); | ||
129 | + return matches ? matches.length : 0; | ||
130 | +} | ||
131 | + | ||
132 | + | ||
133 | +function varReplace(str, dataVar, expr) { | ||
134 | + dataVar += '([^0-9])'; | ||
135 | + expr = expr.replace(/\$/g, '$$$$'); | ||
136 | + return str.replace(new RegExp(dataVar, 'g'), expr + '$1'); | ||
137 | +} | ||
138 | + | ||
139 | + | ||
140 | +function schemaHasRules(schema, rules) { | ||
141 | + if (typeof schema == 'boolean') return !schema; | ||
142 | + for (var key in schema) if (rules[key]) return true; | ||
143 | +} | ||
144 | + | ||
145 | + | ||
146 | +function schemaHasRulesExcept(schema, rules, exceptKeyword) { | ||
147 | + if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not'; | ||
148 | + for (var key in schema) if (key != exceptKeyword && rules[key]) return true; | ||
149 | +} | ||
150 | + | ||
151 | + | ||
152 | +function schemaUnknownRules(schema, rules) { | ||
153 | + if (typeof schema == 'boolean') return; | ||
154 | + for (var key in schema) if (!rules[key]) return key; | ||
155 | +} | ||
156 | + | ||
157 | + | ||
158 | +function toQuotedString(str) { | ||
159 | + return '\'' + escapeQuotes(str) + '\''; | ||
160 | +} | ||
161 | + | ||
162 | + | ||
163 | +function getPathExpr(currentPath, expr, jsonPointers, isNumber) { | ||
164 | + var path = jsonPointers // false by default | ||
165 | + ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')') | ||
166 | + : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\''); | ||
167 | + return joinPaths(currentPath, path); | ||
168 | +} | ||
169 | + | ||
170 | + | ||
171 | +function getPath(currentPath, prop, jsonPointers) { | ||
172 | + var path = jsonPointers // false by default | ||
173 | + ? toQuotedString('/' + escapeJsonPointer(prop)) | ||
174 | + : toQuotedString(getProperty(prop)); | ||
175 | + return joinPaths(currentPath, path); | ||
176 | +} | ||
177 | + | ||
178 | + | ||
179 | +var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; | ||
180 | +var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; | ||
181 | +function getData($data, lvl, paths) { | ||
182 | + var up, jsonPointer, data, matches; | ||
183 | + if ($data === '') return 'rootData'; | ||
184 | + if ($data[0] == '/') { | ||
185 | + if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data); | ||
186 | + jsonPointer = $data; | ||
187 | + data = 'rootData'; | ||
188 | + } else { | ||
189 | + matches = $data.match(RELATIVE_JSON_POINTER); | ||
190 | + if (!matches) throw new Error('Invalid JSON-pointer: ' + $data); | ||
191 | + up = +matches[1]; | ||
192 | + jsonPointer = matches[2]; | ||
193 | + if (jsonPointer == '#') { | ||
194 | + if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); | ||
195 | + return paths[lvl - up]; | ||
196 | + } | ||
197 | + | ||
198 | + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); | ||
199 | + data = 'data' + ((lvl - up) || ''); | ||
200 | + if (!jsonPointer) return data; | ||
201 | + } | ||
202 | + | ||
203 | + var expr = data; | ||
204 | + var segments = jsonPointer.split('/'); | ||
205 | + for (var i=0; i<segments.length; i++) { | ||
206 | + var segment = segments[i]; | ||
207 | + if (segment) { | ||
208 | + data += getProperty(unescapeJsonPointer(segment)); | ||
209 | + expr += ' && ' + data; | ||
210 | + } | ||
211 | + } | ||
212 | + return expr; | ||
213 | +} | ||
214 | + | ||
215 | + | ||
216 | +function joinPaths (a, b) { | ||
217 | + if (a == '""') return b; | ||
218 | + return (a + ' + ' + b).replace(/([^\\])' \+ '/g, '$1'); | ||
219 | +} | ||
220 | + | ||
221 | + | ||
222 | +function unescapeFragment(str) { | ||
223 | + return unescapeJsonPointer(decodeURIComponent(str)); | ||
224 | +} | ||
225 | + | ||
226 | + | ||
227 | +function escapeFragment(str) { | ||
228 | + return encodeURIComponent(escapeJsonPointer(str)); | ||
229 | +} | ||
230 | + | ||
231 | + | ||
232 | +function escapeJsonPointer(str) { | ||
233 | + return str.replace(/~/g, '~0').replace(/\//g, '~1'); | ||
234 | +} | ||
235 | + | ||
236 | + | ||
237 | +function unescapeJsonPointer(str) { | ||
238 | + return str.replace(/~1/g, '/').replace(/~0/g, '~'); | ||
239 | +} |
express/node_modules/ajv/lib/data.js
0 → 100644
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/ajv-validator/ajv/master/lib/refs/data.json#' } | ||
42 | + ] | ||
43 | + }; | ||
44 | + } | ||
45 | + } | ||
46 | + } | ||
47 | + | ||
48 | + return metaSchema; | ||
49 | +}; |
1 | +'use strict'; | ||
2 | + | ||
3 | +var metaSchema = require('./refs/json-schema-draft-07.json'); | ||
4 | + | ||
5 | +module.exports = { | ||
6 | + $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js', | ||
7 | + definitions: { | ||
8 | + simpleTypes: metaSchema.definitions.simpleTypes | ||
9 | + }, | ||
10 | + type: 'object', | ||
11 | + dependencies: { | ||
12 | + schema: ['validate'], | ||
13 | + $data: ['validate'], | ||
14 | + statements: ['inline'], | ||
15 | + valid: {not: {required: ['macro']}} | ||
16 | + }, | ||
17 | + properties: { | ||
18 | + type: metaSchema.properties.type, | ||
19 | + schema: {type: 'boolean'}, | ||
20 | + statements: {type: 'boolean'}, | ||
21 | + dependencies: { | ||
22 | + type: 'array', | ||
23 | + items: {type: 'string'} | ||
24 | + }, | ||
25 | + metaSchema: {type: 'object'}, | ||
26 | + modifying: {type: 'boolean'}, | ||
27 | + valid: {type: 'boolean'}, | ||
28 | + $data: {type: 'boolean'}, | ||
29 | + async: {type: 'boolean'}, | ||
30 | + errors: { | ||
31 | + anyOf: [ | ||
32 | + {type: 'boolean'}, | ||
33 | + {const: 'full'} | ||
34 | + ] | ||
35 | + } | ||
36 | + } | ||
37 | +}; |
express/node_modules/ajv/lib/dot/_limit.jst
0 → 100644
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 | + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { | ||
22 | + throw new Error($keyword + ' must be number'); | ||
23 | + } | ||
24 | + if (!($isDataExcl || $schemaExcl === undefined | ||
25 | + || typeof $schemaExcl == 'number' | ||
26 | + || typeof $schemaExcl == 'boolean')) { | ||
27 | + throw new Error($exclusiveKeyword + ' must be number or boolean'); | ||
28 | + } | ||
29 | +}} | ||
30 | + | ||
31 | +{{? $isDataExcl }} | ||
32 | + {{ | ||
33 | + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) | ||
34 | + , $exclusive = 'exclusive' + $lvl | ||
35 | + , $exclType = 'exclType' + $lvl | ||
36 | + , $exclIsNumber = 'exclIsNumber' + $lvl | ||
37 | + , $opExpr = 'op' + $lvl | ||
38 | + , $opStr = '\' + ' + $opExpr + ' + \''; | ||
39 | + }} | ||
40 | + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; | ||
41 | + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} | ||
42 | + | ||
43 | + var {{=$exclusive}}; | ||
44 | + var {{=$exclType}} = typeof {{=$schemaValueExcl}}; | ||
45 | + if ({{=$exclType}} != 'boolean' && {{=$exclType}} != 'undefined' && {{=$exclType}} != 'number') { | ||
46 | + {{ var $errorKeyword = $exclusiveKeyword; }} | ||
47 | + {{# def.error:'_exclusiveLimit' }} | ||
48 | + } else if ({{# def.$dataNotType:'number' }} | ||
49 | + {{=$exclType}} == 'number' | ||
50 | + ? ( | ||
51 | + ({{=$exclusive}} = {{=$schemaValue}} === undefined || {{=$schemaValueExcl}} {{=$op}}= {{=$schemaValue}}) | ||
52 | + ? {{=$data}} {{=$notOp}}= {{=$schemaValueExcl}} | ||
53 | + : {{=$data}} {{=$notOp}} {{=$schemaValue}} | ||
54 | + ) | ||
55 | + : ( | ||
56 | + ({{=$exclusive}} = {{=$schemaValueExcl}} === true) | ||
57 | + ? {{=$data}} {{=$notOp}}= {{=$schemaValue}} | ||
58 | + : {{=$data}} {{=$notOp}} {{=$schemaValue}} | ||
59 | + ) | ||
60 | + || {{=$data}} !== {{=$data}}) { | ||
61 | + var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; | ||
62 | + {{ | ||
63 | + if ($schema === undefined) { | ||
64 | + $errorKeyword = $exclusiveKeyword; | ||
65 | + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; | ||
66 | + $schemaValue = $schemaValueExcl; | ||
67 | + $isData = $isDataExcl; | ||
68 | + } | ||
69 | + }} | ||
70 | +{{??}} | ||
71 | + {{ | ||
72 | + var $exclIsNumber = typeof $schemaExcl == 'number' | ||
73 | + , $opStr = $op; /*used in error*/ | ||
74 | + }} | ||
75 | + | ||
76 | + {{? $exclIsNumber && $isData }} | ||
77 | + {{ var $opExpr = '\'' + $opStr + '\''; /*used in error*/ }} | ||
78 | + if ({{# def.$dataNotType:'number' }} | ||
79 | + ( {{=$schemaValue}} === undefined | ||
80 | + || {{=$schemaExcl}} {{=$op}}= {{=$schemaValue}} | ||
81 | + ? {{=$data}} {{=$notOp}}= {{=$schemaExcl}} | ||
82 | + : {{=$data}} {{=$notOp}} {{=$schemaValue}} ) | ||
83 | + || {{=$data}} !== {{=$data}}) { | ||
84 | + {{??}} | ||
85 | + {{ | ||
86 | + if ($exclIsNumber && $schema === undefined) { | ||
87 | + {{# def.setExclusiveLimit }} | ||
88 | + $schemaValue = $schemaExcl; | ||
89 | + $notOp += '='; | ||
90 | + } else { | ||
91 | + if ($exclIsNumber) | ||
92 | + $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); | ||
93 | + | ||
94 | + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { | ||
95 | + {{# def.setExclusiveLimit }} | ||
96 | + $notOp += '='; | ||
97 | + } else { | ||
98 | + $exclusive = false; | ||
99 | + $opStr += '='; | ||
100 | + } | ||
101 | + } | ||
102 | + | ||
103 | + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ | ||
104 | + }} | ||
105 | + | ||
106 | + if ({{# def.$dataNotType:'number' }} | ||
107 | + {{=$data}} {{=$notOp}} {{=$schemaValue}} | ||
108 | + || {{=$data}} !== {{=$data}}) { | ||
109 | + {{?}} | ||
110 | +{{?}} | ||
111 | + {{ $errorKeyword = $errorKeyword || $keyword; }} | ||
112 | + {{# def.error:'_limit' }} | ||
113 | + } {{? $breakOnError }} else { {{?}} |
1 | +{{# def.definitions }} | ||
2 | +{{# def.errors }} | ||
3 | +{{# def.setupKeyword }} | ||
4 | +{{# def.$data }} | ||
5 | + | ||
6 | +{{# def.numberKeyword }} | ||
7 | + | ||
8 | +{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }} | ||
9 | +if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) { | ||
10 | + {{ var $errorKeyword = $keyword; }} | ||
11 | + {{# def.error:'_limitItems' }} | ||
12 | +} {{? $breakOnError }} else { {{?}} |
1 | +{{# def.definitions }} | ||
2 | +{{# def.errors }} | ||
3 | +{{# def.setupKeyword }} | ||
4 | +{{# def.$data }} | ||
5 | + | ||
6 | +{{# def.numberKeyword }} | ||
7 | + | ||
8 | +{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }} | ||
9 | +if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) { | ||
10 | + {{ var $errorKeyword = $keyword; }} | ||
11 | + {{# def.error:'_limitLength' }} | ||
12 | +} {{? $breakOnError }} else { {{?}} |
1 | +{{# def.definitions }} | ||
2 | +{{# def.errors }} | ||
3 | +{{# def.setupKeyword }} | ||
4 | +{{# def.$data }} | ||
5 | + | ||
6 | +{{# def.numberKeyword }} | ||
7 | + | ||
8 | +{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} | ||
9 | +if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { | ||
10 | + {{ var $errorKeyword = $keyword; }} | ||
11 | + {{# def.error:'_limitProperties' }} | ||
12 | +} {{? $breakOnError }} else { {{?}} |
express/node_modules/ajv/lib/dot/allOf.jst
0 → 100644
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 | +{{?}} |
express/node_modules/ajv/lib/dot/anyOf.jst
0 → 100644
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 | + {{? $breakOnError }} | ||
44 | + if (true) { | ||
45 | + {{?}} | ||
46 | +{{?}} |
express/node_modules/ajv/lib/dot/coerce.def
0 → 100644
1 | +{{## def.coerceType: | ||
2 | + {{ | ||
3 | + var $dataType = 'dataType' + $lvl | ||
4 | + , $coerced = 'coerced' + $lvl; | ||
5 | + }} | ||
6 | + var {{=$dataType}} = typeof {{=$data}}; | ||
7 | + var {{=$coerced}} = undefined; | ||
8 | + | ||
9 | + {{? it.opts.coerceTypes == 'array' }} | ||
10 | + if ({{=$dataType}} == 'object' && Array.isArray({{=$data}}) && {{=$data}}.length == 1) { | ||
11 | + {{=$data}} = {{=$data}}[0]; | ||
12 | + {{=$dataType}} = typeof {{=$data}}; | ||
13 | + if ({{=it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)}}) {{=$coerced}} = {{=$data}}; | ||
14 | + } | ||
15 | + {{?}} | ||
16 | + | ||
17 | + if ({{=$coerced}} !== undefined) ; | ||
18 | + {{~ $coerceToTypes:$type:$i }} | ||
19 | + {{? $type == 'string' }} | ||
20 | + else if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean') | ||
21 | + {{=$coerced}} = '' + {{=$data}}; | ||
22 | + else if ({{=$data}} === null) {{=$coerced}} = ''; | ||
23 | + {{?? $type == 'number' || $type == 'integer' }} | ||
24 | + else if ({{=$dataType}} == 'boolean' || {{=$data}} === null | ||
25 | + || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}} | ||
26 | + {{? $type == 'integer' }} && !({{=$data}} % 1){{?}})) | ||
27 | + {{=$coerced}} = +{{=$data}}; | ||
28 | + {{?? $type == 'boolean' }} | ||
29 | + else if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null) | ||
30 | + {{=$coerced}} = false; | ||
31 | + else if ({{=$data}} === 'true' || {{=$data}} === 1) | ||
32 | + {{=$coerced}} = true; | ||
33 | + {{?? $type == 'null' }} | ||
34 | + else if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false) | ||
35 | + {{=$coerced}} = null; | ||
36 | + {{?? it.opts.coerceTypes == 'array' && $type == 'array' }} | ||
37 | + else if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null) | ||
38 | + {{=$coerced}} = [{{=$data}}]; | ||
39 | + {{?}} | ||
40 | + {{~}} | ||
41 | + else { | ||
42 | + {{# def.error:'type' }} | ||
43 | + } | ||
44 | + | ||
45 | + if ({{=$coerced}} !== undefined) { | ||
46 | + {{# def.setParentData }} | ||
47 | + {{=$data}} = {{=$coerced}}; | ||
48 | + {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}} | ||
49 | + {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}}; | ||
50 | + } | ||
51 | +#}} |
express/node_modules/ajv/lib/dot/comment.jst
0 → 100644
1 | +{{# def.definitions }} | ||
2 | +{{# def.setupKeyword }} | ||
3 | + | ||
4 | +{{ var $comment = it.util.toQuotedString($schema); }} | ||
5 | +{{? it.opts.$comment === true }} | ||
6 | + console.log({{=$comment}}); | ||
7 | +{{?? typeof it.opts.$comment == 'function' }} | ||
8 | + self._opts.$comment({{=$comment}}, {{=it.util.toQuotedString($errSchemaPath)}}, validate.root.schema); | ||
9 | +{{?}} |
express/node_modules/ajv/lib/dot/const.jst
0 → 100644
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 }} } {{?}} |
express/node_modules/ajv/lib/dot/custom.jst
0 → 100644
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 }}await {{?}}{{= def_callRuleValidate }}; | ||
116 | + {{??}} | ||
117 | + {{? $asyncKeyword }} | ||
118 | + {{ $ruleErrs = 'customErrors' + $lvl; }} | ||
119 | + var {{=$ruleErrs}} = null; | ||
120 | + try { | ||
121 | + {{=$valid}} = await {{= 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 | + {{? it.compositeRule }} | ||
3 | + {{ | ||
4 | + if (it.opts.strictDefaults) { | ||
5 | + var $defaultMsg = 'default is ignored for: ' + $passData; | ||
6 | + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); | ||
7 | + else throw new Error($defaultMsg); | ||
8 | + } | ||
9 | + }} | ||
10 | + {{??}} | ||
11 | + if ({{=$passData}} === undefined | ||
12 | + {{? it.opts.useDefaults == 'empty' }} | ||
13 | + || {{=$passData}} === null | ||
14 | + || {{=$passData}} === '' | ||
15 | + {{?}} | ||
16 | + ) | ||
17 | + {{=$passData}} = {{? it.opts.useDefaults == 'shared' }} | ||
18 | + {{= it.useDefault($sch.default) }} | ||
19 | + {{??}} | ||
20 | + {{= JSON.stringify($sch.default) }} | ||
21 | + {{?}}; | ||
22 | + {{?}} | ||
23 | +#}} | ||
24 | + | ||
25 | + | ||
26 | +{{## def.defaultProperties: | ||
27 | + {{ | ||
28 | + var $schema = it.schema.properties | ||
29 | + , $schemaKeys = Object.keys($schema); }} | ||
30 | + {{~ $schemaKeys:$propertyKey }} | ||
31 | + {{ var $sch = $schema[$propertyKey]; }} | ||
32 | + {{? $sch.default !== undefined }} | ||
33 | + {{ var $passData = $data + it.util.getProperty($propertyKey); }} | ||
34 | + {{# def.assignDefault }} | ||
35 | + {{?}} | ||
36 | + {{~}} | ||
37 | +#}} | ||
38 | + | ||
39 | + | ||
40 | +{{## def.defaultItems: | ||
41 | + {{~ it.schema.items:$sch:$i }} | ||
42 | + {{? $sch.default !== undefined }} | ||
43 | + {{ var $passData = $data + '[' + $i + ']'; }} | ||
44 | + {{# def.assignDefault }} | ||
45 | + {{?}} | ||
46 | + {{~}} | ||
47 | +#}} |
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.opts.strictKeywords | ||
67 | + ? (typeof _schema == 'object' && Object.keys(_schema).length > 0) | ||
68 | + || _schema === false | ||
69 | + : it.util.schemaHasRules(_schema, it.RULES.all)) | ||
70 | +#}} | ||
71 | + | ||
72 | + | ||
73 | +{{## def.strLength: | ||
74 | + {{? it.opts.unicode === false }} | ||
75 | + {{=$data}}.length | ||
76 | + {{??}} | ||
77 | + ucs2length({{=$data}}) | ||
78 | + {{?}} | ||
79 | +#}} | ||
80 | + | ||
81 | + | ||
82 | +{{## def.willOptimize: | ||
83 | + it.util.varOccurences($code, $nextData) < 2 | ||
84 | +#}} | ||
85 | + | ||
86 | + | ||
87 | +{{## def.generateSubschemaCode: | ||
88 | + {{ | ||
89 | + var $code = it.validate($it); | ||
90 | + $it.baseId = $currentBaseId; | ||
91 | + }} | ||
92 | +#}} | ||
93 | + | ||
94 | + | ||
95 | +{{## def.insertSubschemaCode: | ||
96 | + {{= it.validate($it) }} | ||
97 | + {{ $it.baseId = $currentBaseId; }} | ||
98 | +#}} | ||
99 | + | ||
100 | + | ||
101 | +{{## def._optimizeValidate: | ||
102 | + it.util.varReplace($code, $nextData, $passData) | ||
103 | +#}} | ||
104 | + | ||
105 | + | ||
106 | +{{## def.optimizeValidate: | ||
107 | + {{? {{# def.willOptimize}} }} | ||
108 | + {{= {{# def._optimizeValidate }} }} | ||
109 | + {{??}} | ||
110 | + var {{=$nextData}} = {{=$passData}}; | ||
111 | + {{= $code }} | ||
112 | + {{?}} | ||
113 | +#}} | ||
114 | + | ||
115 | + | ||
116 | +{{## def.$data: | ||
117 | + {{ | ||
118 | + var $isData = it.opts.$data && $schema && $schema.$data | ||
119 | + , $schemaValue; | ||
120 | + }} | ||
121 | + {{? $isData }} | ||
122 | + var schema{{=$lvl}} = {{= it.util.getData($schema.$data, $dataLvl, it.dataPathArr) }}; | ||
123 | + {{ $schemaValue = 'schema' + $lvl; }} | ||
124 | + {{??}} | ||
125 | + {{ $schemaValue = $schema; }} | ||
126 | + {{?}} | ||
127 | +#}} | ||
128 | + | ||
129 | + | ||
130 | +{{## def.$dataNotType:_type: | ||
131 | + {{?$isData}} ({{=$schemaValue}} !== undefined && typeof {{=$schemaValue}} != _type) || {{?}} | ||
132 | +#}} | ||
133 | + | ||
134 | + | ||
135 | +{{## def.check$dataIsArray: | ||
136 | + if (schema{{=$lvl}} === undefined) {{=$valid}} = true; | ||
137 | + else if (!Array.isArray(schema{{=$lvl}})) {{=$valid}} = false; | ||
138 | + else { | ||
139 | +#}} | ||
140 | + | ||
141 | + | ||
142 | +{{## def.numberKeyword: | ||
143 | + {{? !($isData || typeof $schema == 'number') }} | ||
144 | + {{ throw new Error($keyword + ' must be number'); }} | ||
145 | + {{?}} | ||
146 | +#}} | ||
147 | + | ||
148 | + | ||
149 | +{{## def.beginDefOut: | ||
150 | + {{ | ||
151 | + var $$outStack = $$outStack || []; | ||
152 | + $$outStack.push(out); | ||
153 | + out = ''; | ||
154 | + }} | ||
155 | +#}} | ||
156 | + | ||
157 | + | ||
158 | +{{## def.storeDefOut:_variable: | ||
159 | + {{ | ||
160 | + var _variable = out; | ||
161 | + out = $$outStack.pop(); | ||
162 | + }} | ||
163 | +#}} | ||
164 | + | ||
165 | + | ||
166 | +{{## def.dataPath:(dataPath || ''){{? it.errorPath != '""'}} + {{= it.errorPath }}{{?}}#}} | ||
167 | + | ||
168 | +{{## def.setParentData: | ||
169 | + {{ | ||
170 | + var $parentData = $dataLvl ? 'data' + (($dataLvl-1)||'') : 'parentData' | ||
171 | + , $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; | ||
172 | + }} | ||
173 | +#}} | ||
174 | + | ||
175 | +{{## def.passParentData: | ||
176 | + {{# def.setParentData }} | ||
177 | + , {{= $parentData }} | ||
178 | + , {{= $parentDataProperty }} | ||
179 | +#}} | ||
180 | + | ||
181 | + | ||
182 | +{{## def.iterateProperties: | ||
183 | + {{? $ownProperties }} | ||
184 | + {{=$dataProperties}} = {{=$dataProperties}} || Object.keys({{=$data}}); | ||
185 | + for (var {{=$idx}}=0; {{=$idx}}<{{=$dataProperties}}.length; {{=$idx}}++) { | ||
186 | + var {{=$key}} = {{=$dataProperties}}[{{=$idx}}]; | ||
187 | + {{??}} | ||
188 | + for (var {{=$key}} in {{=$data}}) { | ||
189 | + {{?}} | ||
190 | +#}} | ||
191 | + | ||
192 | + | ||
193 | +{{## def.noPropertyInData: | ||
194 | + {{=$useData}} === undefined | ||
195 | + {{? $ownProperties }} | ||
196 | + || !{{# def.isOwnProperty }} | ||
197 | + {{?}} | ||
198 | +#}} | ||
199 | + | ||
200 | + | ||
201 | +{{## def.isOwnProperty: | ||
202 | + Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($propertyKey)}}') | ||
203 | +#}} |
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 | + if ($property == '__proto__') continue; | ||
23 | + var $sch = $schema[$property]; | ||
24 | + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; | ||
25 | + $deps[$property] = $sch; | ||
26 | + } | ||
27 | +}} | ||
28 | + | ||
29 | +var {{=$errs}} = errors; | ||
30 | + | ||
31 | +{{ var $currentErrorPath = it.errorPath; }} | ||
32 | + | ||
33 | +var missing{{=$lvl}}; | ||
34 | +{{ for (var $property in $propertyDeps) { }} | ||
35 | + {{ $deps = $propertyDeps[$property]; }} | ||
36 | + {{? $deps.length }} | ||
37 | + if ({{# def.propertyInData }} | ||
38 | + {{? $breakOnError }} | ||
39 | + && ({{# def.checkMissingProperty:$deps }})) { | ||
40 | + {{# def.errorMissingProperty:'dependencies' }} | ||
41 | + {{??}} | ||
42 | + ) { | ||
43 | + {{~ $deps:$propertyKey }} | ||
44 | + {{# def.allErrorsMissingProperty:'dependencies' }} | ||
45 | + {{~}} | ||
46 | + {{?}} | ||
47 | + } {{# def.elseIfValid }} | ||
48 | + {{?}} | ||
49 | +{{ } }} | ||
50 | + | ||
51 | +{{ | ||
52 | + it.errorPath = $currentErrorPath; | ||
53 | + var $currentBaseId = $it.baseId; | ||
54 | +}} | ||
55 | + | ||
56 | + | ||
57 | +{{ for (var $property in $schemaDeps) { }} | ||
58 | + {{ var $sch = $schemaDeps[$property]; }} | ||
59 | + {{? {{# def.nonEmptySchema:$sch }} }} | ||
60 | + {{=$nextValid}} = true; | ||
61 | + | ||
62 | + if ({{# def.propertyInData }}) { | ||
63 | + {{ | ||
64 | + $it.schema = $sch; | ||
65 | + $it.schemaPath = $schemaPath + it.util.getProperty($property); | ||
66 | + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); | ||
67 | + }} | ||
68 | + | ||
69 | + {{# def.insertSubschemaCode }} | ||
70 | + } | ||
71 | + | ||
72 | + {{# def.ifResultValid }} | ||
73 | + {{?}} | ||
74 | +{{ } }} | ||
75 | + | ||
76 | +{{? $breakOnError }} | ||
77 | + {{= $closingBraces }} | ||
78 | + if ({{=$errs}} == errors) { | ||
79 | +{{?}} |
express/node_modules/ajv/lib/dot/enum.jst
0 → 100644
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 { {{?}} |
express/node_modules/ajv/lib/dot/errors.def
0 → 100644
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: "'{{? it.opts._errorDataPathProperty }}is an invalid additional property{{??}}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 | + 'if': "'should match \"' + {{=$ifClause}} + '\" schema'", | ||
105 | + _limit: "'should be {{=$opStr}} {{#def.appendSchema}}", | ||
106 | + _exclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'", | ||
107 | + _limitItems: "'should NOT have {{?$keyword=='maxItems'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} items'", | ||
108 | + _limitLength: "'should NOT be {{?$keyword=='maxLength'}}longer{{??}}shorter{{?}} than {{#def.concatSchema}} characters'", | ||
109 | + _limitProperties:"'should NOT have {{?$keyword=='maxProperties'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} properties'", | ||
110 | + multipleOf: "'should be multiple of {{#def.appendSchema}}", | ||
111 | + not: "'should NOT be valid'", | ||
112 | + oneOf: "'should match exactly one schema in oneOf'", | ||
113 | + pattern: "'should match pattern \"{{#def.concatSchemaEQ}}\"'", | ||
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 | + 'if': "validate.schema{{=$schemaPath}}", | ||
141 | + _limit: "{{#def.schemaRefOrVal}}", | ||
142 | + _exclusiveLimit: "validate.schema{{=$schemaPath}}", | ||
143 | + _limitItems: "{{#def.schemaRefOrVal}}", | ||
144 | + _limitLength: "{{#def.schemaRefOrVal}}", | ||
145 | + _limitProperties:"{{#def.schemaRefOrVal}}", | ||
146 | + multipleOf: "{{#def.schemaRefOrVal}}", | ||
147 | + not: "validate.schema{{=$schemaPath}}", | ||
148 | + oneOf: "validate.schema{{=$schemaPath}}", | ||
149 | + pattern: "{{#def.schemaRefOrQS}}", | ||
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: "{ allowedValue: schema{{=$lvl}} }", | ||
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 | + 'if': "{ failingKeyword: {{=$ifClause}} }", | ||
176 | + _limit: "{ comparison: {{=$opExpr}}, limit: {{=$schemaValue}}, exclusive: {{=$exclusive}} }", | ||
177 | + _exclusiveLimit: "{}", | ||
178 | + _limitItems: "{ limit: {{=$schemaValue}} }", | ||
179 | + _limitLength: "{ limit: {{=$schemaValue}} }", | ||
180 | + _limitProperties:"{ limit: {{=$schemaValue}} }", | ||
181 | + multipleOf: "{ multipleOf: {{=$schemaValue}} }", | ||
182 | + not: "{}", | ||
183 | + oneOf: "{ passingSchemas: {{=$passingSchemas}} }", | ||
184 | + pattern: "{ pattern: {{#def.schemaValueQS}} }", | ||
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 | +} #}} |
express/node_modules/ajv/lib/dot/format.jst
0 → 100644
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}} ? await {{=$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 (!(await {{=$formatRef}}({{=$data}}))) { | ||
101 | + {{??}} | ||
102 | + if (!{{# def.checkFormat }}) { | ||
103 | + {{?}} | ||
104 | +{{?}} | ||
105 | + {{# def.error:'format' }} | ||
106 | + } {{? $breakOnError }} else { {{?}} |
express/node_modules/ajv/lib/dot/if.jst
0 → 100644
1 | +{{# def.definitions }} | ||
2 | +{{# def.errors }} | ||
3 | +{{# def.setupKeyword }} | ||
4 | +{{# def.setupNextLevel }} | ||
5 | + | ||
6 | + | ||
7 | +{{## def.validateIfClause:_clause: | ||
8 | + {{ | ||
9 | + $it.schema = it.schema['_clause']; | ||
10 | + $it.schemaPath = it.schemaPath + '._clause'; | ||
11 | + $it.errSchemaPath = it.errSchemaPath + '/_clause'; | ||
12 | + }} | ||
13 | + {{# def.insertSubschemaCode }} | ||
14 | + {{=$valid}} = {{=$nextValid}}; | ||
15 | + {{? $thenPresent && $elsePresent }} | ||
16 | + {{ $ifClause = 'ifClause' + $lvl; }} | ||
17 | + var {{=$ifClause}} = '_clause'; | ||
18 | + {{??}} | ||
19 | + {{ $ifClause = '\'_clause\''; }} | ||
20 | + {{?}} | ||
21 | +#}} | ||
22 | + | ||
23 | +{{ | ||
24 | + var $thenSch = it.schema['then'] | ||
25 | + , $elseSch = it.schema['else'] | ||
26 | + , $thenPresent = $thenSch !== undefined && {{# def.nonEmptySchema:$thenSch }} | ||
27 | + , $elsePresent = $elseSch !== undefined && {{# def.nonEmptySchema:$elseSch }} | ||
28 | + , $currentBaseId = $it.baseId; | ||
29 | +}} | ||
30 | + | ||
31 | +{{? $thenPresent || $elsePresent }} | ||
32 | + {{ | ||
33 | + var $ifClause; | ||
34 | + $it.createErrors = false; | ||
35 | + $it.schema = $schema; | ||
36 | + $it.schemaPath = $schemaPath; | ||
37 | + $it.errSchemaPath = $errSchemaPath; | ||
38 | + }} | ||
39 | + var {{=$errs}} = errors; | ||
40 | + var {{=$valid}} = true; | ||
41 | + | ||
42 | + {{# def.setCompositeRule }} | ||
43 | + {{# def.insertSubschemaCode }} | ||
44 | + {{ $it.createErrors = true; }} | ||
45 | + {{# def.resetErrors }} | ||
46 | + {{# def.resetCompositeRule }} | ||
47 | + | ||
48 | + {{? $thenPresent }} | ||
49 | + if ({{=$nextValid}}) { | ||
50 | + {{# def.validateIfClause:then }} | ||
51 | + } | ||
52 | + {{? $elsePresent }} | ||
53 | + else { | ||
54 | + {{?}} | ||
55 | + {{??}} | ||
56 | + if (!{{=$nextValid}}) { | ||
57 | + {{?}} | ||
58 | + | ||
59 | + {{? $elsePresent }} | ||
60 | + {{# def.validateIfClause:else }} | ||
61 | + } | ||
62 | + {{?}} | ||
63 | + | ||
64 | + if (!{{=$valid}}) { | ||
65 | + {{# def.extraError:'if' }} | ||
66 | + } | ||
67 | + {{? $breakOnError }} else { {{?}} | ||
68 | +{{??}} | ||
69 | + {{? $breakOnError }} | ||
70 | + if (true) { | ||
71 | + {{?}} | ||
72 | +{{?}} | ||
73 | + |
express/node_modules/ajv/lib/dot/items.jst
0 → 100644
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 | +{{?}} |
express/node_modules/ajv/lib/dot/missing.def
0 → 100644
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 | +{{# def.numberKeyword }} | ||
7 | + | ||
8 | +var division{{=$lvl}}; | ||
9 | +if ({{?$isData}} | ||
10 | + {{=$schemaValue}} !== undefined && ( | ||
11 | + typeof {{=$schemaValue}} != 'number' || | ||
12 | + {{?}} | ||
13 | + (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}}, | ||
14 | + {{? it.opts.multipleOfPrecision }} | ||
15 | + Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}} | ||
16 | + {{??}} | ||
17 | + division{{=$lvl}} !== parseInt(division{{=$lvl}}) | ||
18 | + {{?}} | ||
19 | + ) | ||
20 | + {{?$isData}} ) {{?}} ) { | ||
21 | + {{# def.error:'multipleOf' }} | ||
22 | +} {{? $breakOnError }} else { {{?}} |
express/node_modules/ajv/lib/dot/not.jst
0 → 100644
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 | +{{?}} |
express/node_modules/ajv/lib/dot/oneOf.jst
0 → 100644
1 | +{{# def.definitions }} | ||
2 | +{{# def.errors }} | ||
3 | +{{# def.setupKeyword }} | ||
4 | +{{# def.setupNextLevel }} | ||
5 | + | ||
6 | +{{ | ||
7 | + var $currentBaseId = $it.baseId | ||
8 | + , $prevValid = 'prevValid' + $lvl | ||
9 | + , $passingSchemas = 'passingSchemas' + $lvl; | ||
10 | +}} | ||
11 | + | ||
12 | +var {{=$errs}} = errors | ||
13 | + , {{=$prevValid}} = false | ||
14 | + , {{=$valid}} = false | ||
15 | + , {{=$passingSchemas}} = null; | ||
16 | + | ||
17 | +{{# def.setCompositeRule }} | ||
18 | + | ||
19 | +{{~ $schema:$sch:$i }} | ||
20 | + {{? {{# def.nonEmptySchema:$sch }} }} | ||
21 | + {{ | ||
22 | + $it.schema = $sch; | ||
23 | + $it.schemaPath = $schemaPath + '[' + $i + ']'; | ||
24 | + $it.errSchemaPath = $errSchemaPath + '/' + $i; | ||
25 | + }} | ||
26 | + | ||
27 | + {{# def.insertSubschemaCode }} | ||
28 | + {{??}} | ||
29 | + var {{=$nextValid}} = true; | ||
30 | + {{?}} | ||
31 | + | ||
32 | + {{? $i }} | ||
33 | + if ({{=$nextValid}} && {{=$prevValid}}) { | ||
34 | + {{=$valid}} = false; | ||
35 | + {{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}]; | ||
36 | + } else { | ||
37 | + {{ $closingBraces += '}'; }} | ||
38 | + {{?}} | ||
39 | + | ||
40 | + if ({{=$nextValid}}) { | ||
41 | + {{=$valid}} = {{=$prevValid}} = true; | ||
42 | + {{=$passingSchemas}} = {{=$i}}; | ||
43 | + } | ||
44 | +{{~}} | ||
45 | + | ||
46 | +{{# def.resetCompositeRule }} | ||
47 | + | ||
48 | +{{= $closingBraces }} | ||
49 | + | ||
50 | +if (!{{=$valid}}) { | ||
51 | + {{# def.extraError:'oneOf' }} | ||
52 | +} else { | ||
53 | + {{# def.resetErrors }} | ||
54 | +{{? it.opts.allErrors }} } {{?}} |
express/node_modules/ajv/lib/dot/pattern.jst
0 → 100644
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 { {{?}} |
1 | +{{# def.definitions }} | ||
2 | +{{# def.errors }} | ||
3 | +{{# def.setupKeyword }} | ||
4 | +{{# def.setupNextLevel }} | ||
5 | + | ||
6 | + | ||
7 | +{{## def.validateAdditional: | ||
8 | + {{ /* additionalProperties is schema */ | ||
9 | + $it.schema = $aProperties; | ||
10 | + $it.schemaPath = it.schemaPath + '.additionalProperties'; | ||
11 | + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; | ||
12 | + $it.errorPath = it.opts._errorDataPathProperty | ||
13 | + ? it.errorPath | ||
14 | + : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); | ||
15 | + var $passData = $data + '[' + $key + ']'; | ||
16 | + $it.dataPathArr[$dataNxt] = $key; | ||
17 | + }} | ||
18 | + | ||
19 | + {{# def.generateSubschemaCode }} | ||
20 | + {{# def.optimizeValidate }} | ||
21 | +#}} | ||
22 | + | ||
23 | + | ||
24 | +{{ | ||
25 | + var $key = 'key' + $lvl | ||
26 | + , $idx = 'idx' + $lvl | ||
27 | + , $dataNxt = $it.dataLevel = it.dataLevel + 1 | ||
28 | + , $nextData = 'data' + $dataNxt | ||
29 | + , $dataProperties = 'dataProperties' + $lvl; | ||
30 | + | ||
31 | + var $schemaKeys = Object.keys($schema || {}).filter(notProto) | ||
32 | + , $pProperties = it.schema.patternProperties || {} | ||
33 | + , $pPropertyKeys = Object.keys($pProperties).filter(notProto) | ||
34 | + , $aProperties = it.schema.additionalProperties | ||
35 | + , $someProperties = $schemaKeys.length || $pPropertyKeys.length | ||
36 | + , $noAdditional = $aProperties === false | ||
37 | + , $additionalIsSchema = typeof $aProperties == 'object' | ||
38 | + && Object.keys($aProperties).length | ||
39 | + , $removeAdditional = it.opts.removeAdditional | ||
40 | + , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional | ||
41 | + , $ownProperties = it.opts.ownProperties | ||
42 | + , $currentBaseId = it.baseId; | ||
43 | + | ||
44 | + var $required = it.schema.required; | ||
45 | + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { | ||
46 | + var $requiredHash = it.util.toHash($required); | ||
47 | + } | ||
48 | + | ||
49 | + function notProto(p) { return p !== '__proto__'; } | ||
50 | +}} | ||
51 | + | ||
52 | + | ||
53 | +var {{=$errs}} = errors; | ||
54 | +var {{=$nextValid}} = true; | ||
55 | +{{? $ownProperties }} | ||
56 | + var {{=$dataProperties}} = undefined; | ||
57 | +{{?}} | ||
58 | + | ||
59 | +{{? $checkAdditional }} | ||
60 | + {{# def.iterateProperties }} | ||
61 | + {{? $someProperties }} | ||
62 | + var isAdditional{{=$lvl}} = !(false | ||
63 | + {{? $schemaKeys.length }} | ||
64 | + {{? $schemaKeys.length > 8 }} | ||
65 | + || validate.schema{{=$schemaPath}}.hasOwnProperty({{=$key}}) | ||
66 | + {{??}} | ||
67 | + {{~ $schemaKeys:$propertyKey }} | ||
68 | + || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }} | ||
69 | + {{~}} | ||
70 | + {{?}} | ||
71 | + {{?}} | ||
72 | + {{? $pPropertyKeys.length }} | ||
73 | + {{~ $pPropertyKeys:$pProperty:$i }} | ||
74 | + || {{= it.usePattern($pProperty) }}.test({{=$key}}) | ||
75 | + {{~}} | ||
76 | + {{?}} | ||
77 | + ); | ||
78 | + | ||
79 | + if (isAdditional{{=$lvl}}) { | ||
80 | + {{?}} | ||
81 | + {{? $removeAdditional == 'all' }} | ||
82 | + delete {{=$data}}[{{=$key}}]; | ||
83 | + {{??}} | ||
84 | + {{ | ||
85 | + var $currentErrorPath = it.errorPath; | ||
86 | + var $additionalProperty = '\' + ' + $key + ' + \''; | ||
87 | + if (it.opts._errorDataPathProperty) { | ||
88 | + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); | ||
89 | + } | ||
90 | + }} | ||
91 | + {{? $noAdditional }} | ||
92 | + {{? $removeAdditional }} | ||
93 | + delete {{=$data}}[{{=$key}}]; | ||
94 | + {{??}} | ||
95 | + {{=$nextValid}} = false; | ||
96 | + {{ | ||
97 | + var $currErrSchemaPath = $errSchemaPath; | ||
98 | + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; | ||
99 | + }} | ||
100 | + {{# def.error:'additionalProperties' }} | ||
101 | + {{ $errSchemaPath = $currErrSchemaPath; }} | ||
102 | + {{? $breakOnError }} break; {{?}} | ||
103 | + {{?}} | ||
104 | + {{?? $additionalIsSchema }} | ||
105 | + {{? $removeAdditional == 'failing' }} | ||
106 | + var {{=$errs}} = errors; | ||
107 | + {{# def.setCompositeRule }} | ||
108 | + | ||
109 | + {{# def.validateAdditional }} | ||
110 | + | ||
111 | + if (!{{=$nextValid}}) { | ||
112 | + errors = {{=$errs}}; | ||
113 | + if (validate.errors !== null) { | ||
114 | + if (errors) validate.errors.length = errors; | ||
115 | + else validate.errors = null; | ||
116 | + } | ||
117 | + delete {{=$data}}[{{=$key}}]; | ||
118 | + } | ||
119 | + | ||
120 | + {{# def.resetCompositeRule }} | ||
121 | + {{??}} | ||
122 | + {{# def.validateAdditional }} | ||
123 | + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} | ||
124 | + {{?}} | ||
125 | + {{?}} | ||
126 | + {{ it.errorPath = $currentErrorPath; }} | ||
127 | + {{?}} | ||
128 | + {{? $someProperties }} | ||
129 | + } | ||
130 | + {{?}} | ||
131 | + } | ||
132 | + | ||
133 | + {{# def.ifResultValid }} | ||
134 | +{{?}} | ||
135 | + | ||
136 | +{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }} | ||
137 | + | ||
138 | +{{? $schemaKeys.length }} | ||
139 | + {{~ $schemaKeys:$propertyKey }} | ||
140 | + {{ var $sch = $schema[$propertyKey]; }} | ||
141 | + | ||
142 | + {{? {{# def.nonEmptySchema:$sch}} }} | ||
143 | + {{ | ||
144 | + var $prop = it.util.getProperty($propertyKey) | ||
145 | + , $passData = $data + $prop | ||
146 | + , $hasDefault = $useDefaults && $sch.default !== undefined; | ||
147 | + $it.schema = $sch; | ||
148 | + $it.schemaPath = $schemaPath + $prop; | ||
149 | + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); | ||
150 | + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); | ||
151 | + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); | ||
152 | + }} | ||
153 | + | ||
154 | + {{# def.generateSubschemaCode }} | ||
155 | + | ||
156 | + {{? {{# def.willOptimize }} }} | ||
157 | + {{ | ||
158 | + $code = {{# def._optimizeValidate }}; | ||
159 | + var $useData = $passData; | ||
160 | + }} | ||
161 | + {{??}} | ||
162 | + {{ var $useData = $nextData; }} | ||
163 | + var {{=$nextData}} = {{=$passData}}; | ||
164 | + {{?}} | ||
165 | + | ||
166 | + {{? $hasDefault }} | ||
167 | + {{= $code }} | ||
168 | + {{??}} | ||
169 | + {{? $requiredHash && $requiredHash[$propertyKey] }} | ||
170 | + if ({{# def.noPropertyInData }}) { | ||
171 | + {{=$nextValid}} = false; | ||
172 | + {{ | ||
173 | + var $currentErrorPath = it.errorPath | ||
174 | + , $currErrSchemaPath = $errSchemaPath | ||
175 | + , $missingProperty = it.util.escapeQuotes($propertyKey); | ||
176 | + if (it.opts._errorDataPathProperty) { | ||
177 | + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); | ||
178 | + } | ||
179 | + $errSchemaPath = it.errSchemaPath + '/required'; | ||
180 | + }} | ||
181 | + {{# def.error:'required' }} | ||
182 | + {{ $errSchemaPath = $currErrSchemaPath; }} | ||
183 | + {{ it.errorPath = $currentErrorPath; }} | ||
184 | + } else { | ||
185 | + {{??}} | ||
186 | + {{? $breakOnError }} | ||
187 | + if ({{# def.noPropertyInData }}) { | ||
188 | + {{=$nextValid}} = true; | ||
189 | + } else { | ||
190 | + {{??}} | ||
191 | + if ({{=$useData}} !== undefined | ||
192 | + {{? $ownProperties }} | ||
193 | + && {{# def.isOwnProperty }} | ||
194 | + {{?}} | ||
195 | + ) { | ||
196 | + {{?}} | ||
197 | + {{?}} | ||
198 | + | ||
199 | + {{= $code }} | ||
200 | + } | ||
201 | + {{?}} {{ /* $hasDefault */ }} | ||
202 | + {{?}} {{ /* def.nonEmptySchema */ }} | ||
203 | + | ||
204 | + {{# def.ifResultValid }} | ||
205 | + {{~}} | ||
206 | +{{?}} | ||
207 | + | ||
208 | +{{? $pPropertyKeys.length }} | ||
209 | + {{~ $pPropertyKeys:$pProperty }} | ||
210 | + {{ var $sch = $pProperties[$pProperty]; }} | ||
211 | + | ||
212 | + {{? {{# def.nonEmptySchema:$sch}} }} | ||
213 | + {{ | ||
214 | + $it.schema = $sch; | ||
215 | + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); | ||
216 | + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' | ||
217 | + + it.util.escapeFragment($pProperty); | ||
218 | + }} | ||
219 | + | ||
220 | + {{# def.iterateProperties }} | ||
221 | + if ({{= it.usePattern($pProperty) }}.test({{=$key}})) { | ||
222 | + {{ | ||
223 | + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); | ||
224 | + var $passData = $data + '[' + $key + ']'; | ||
225 | + $it.dataPathArr[$dataNxt] = $key; | ||
226 | + }} | ||
227 | + | ||
228 | + {{# def.generateSubschemaCode }} | ||
229 | + {{# def.optimizeValidate }} | ||
230 | + | ||
231 | + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} | ||
232 | + } | ||
233 | + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} | ||
234 | + } | ||
235 | + | ||
236 | + {{# def.ifResultValid }} | ||
237 | + {{?}} {{ /* def.nonEmptySchema */ }} | ||
238 | + {{~}} | ||
239 | +{{?}} | ||
240 | + | ||
241 | + | ||
242 | +{{? $breakOnError }} | ||
243 | + {{= $closingBraces }} | ||
244 | + if ({{=$errs}} == errors) { | ||
245 | +{{?}} |
1 | +{{# def.definitions }} | ||
2 | +{{# def.errors }} | ||
3 | +{{# def.setupKeyword }} | ||
4 | +{{# def.setupNextLevel }} | ||
5 | + | ||
6 | +var {{=$errs}} = errors; | ||
7 | + | ||
8 | +{{? {{# def.nonEmptySchema:$schema }} }} | ||
9 | + {{ | ||
10 | + $it.schema = $schema; | ||
11 | + $it.schemaPath = $schemaPath; | ||
12 | + $it.errSchemaPath = $errSchemaPath; | ||
13 | + }} | ||
14 | + | ||
15 | + {{ | ||
16 | + var $key = 'key' + $lvl | ||
17 | + , $idx = 'idx' + $lvl | ||
18 | + , $i = 'i' + $lvl | ||
19 | + , $invalidName = '\' + ' + $key + ' + \'' | ||
20 | + , $dataNxt = $it.dataLevel = it.dataLevel + 1 | ||
21 | + , $nextData = 'data' + $dataNxt | ||
22 | + , $dataProperties = 'dataProperties' + $lvl | ||
23 | + , $ownProperties = it.opts.ownProperties | ||
24 | + , $currentBaseId = it.baseId; | ||
25 | + }} | ||
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 | +{{?}} |
express/node_modules/ajv/lib/dot/ref.jst
0 → 100644
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 || (it.async && $refVal.$async !== false); | ||
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 | + await {{=__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 i = {{=$data}}.length | ||
18 | + , {{=$valid}} = true | ||
19 | + , j; | ||
20 | + if (i > 1) { | ||
21 | + {{ | ||
22 | + var $itemType = it.schema.items && it.schema.items.type | ||
23 | + , $typeIsArray = Array.isArray($itemType); | ||
24 | + }} | ||
25 | + {{? !$itemType || $itemType == 'object' || $itemType == 'array' || | ||
26 | + ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0)) }} | ||
27 | + outer: | ||
28 | + for (;i--;) { | ||
29 | + for (j = i; j--;) { | ||
30 | + if (equal({{=$data}}[i], {{=$data}}[j])) { | ||
31 | + {{=$valid}} = false; | ||
32 | + break outer; | ||
33 | + } | ||
34 | + } | ||
35 | + } | ||
36 | + {{??}} | ||
37 | + var itemIndices = {}, item; | ||
38 | + for (;i--;) { | ||
39 | + var item = {{=$data}}[i]; | ||
40 | + {{ var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); }} | ||
41 | + if ({{= it.util[$method]($itemType, 'item', it.opts.strictNumbers, true) }}) continue; | ||
42 | + {{? $typeIsArray}} | ||
43 | + if (typeof item == 'string') item = '"' + item; | ||
44 | + {{?}} | ||
45 | + if (typeof itemIndices[item] == 'number') { | ||
46 | + {{=$valid}} = false; | ||
47 | + j = itemIndices[item]; | ||
48 | + break; | ||
49 | + } | ||
50 | + itemIndices[item] = i; | ||
51 | + } | ||
52 | + {{?}} | ||
53 | + } | ||
54 | + | ||
55 | + {{? $isData }} } {{?}} | ||
56 | + | ||
57 | + if (!{{=$valid}}) { | ||
58 | + {{# def.error:'uniqueItems' }} | ||
59 | + } {{? $breakOnError }} else { {{?}} | ||
60 | +{{??}} | ||
61 | + {{? $breakOnError }} if (true) { {{?}} | ||
62 | +{{?}} |
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 | +{{ | ||
24 | + if (it.opts.strictKeywords) { | ||
25 | + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); | ||
26 | + if ($unknownKwd) { | ||
27 | + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; | ||
28 | + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); | ||
29 | + else throw new Error($keywordsMsg); | ||
30 | + } | ||
31 | + } | ||
32 | +}} | ||
33 | + | ||
34 | +{{? it.isTop }} | ||
35 | + var validate = {{?$async}}{{it.async = true;}}async {{?}}function(data, dataPath, parentData, parentDataProperty, rootData) { | ||
36 | + 'use strict'; | ||
37 | + {{? $id && (it.opts.sourceCode || it.opts.processCode) }} | ||
38 | + {{= '/\*# sourceURL=' + $id + ' */' }} | ||
39 | + {{?}} | ||
40 | +{{?}} | ||
41 | + | ||
42 | +{{? typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref) }} | ||
43 | + {{ var $keyword = 'false schema'; }} | ||
44 | + {{# def.setupKeyword }} | ||
45 | + {{? it.schema === false}} | ||
46 | + {{? it.isTop}} | ||
47 | + {{ $breakOnError = true; }} | ||
48 | + {{??}} | ||
49 | + var {{=$valid}} = false; | ||
50 | + {{?}} | ||
51 | + {{# def.error:'false schema' }} | ||
52 | + {{??}} | ||
53 | + {{? it.isTop}} | ||
54 | + {{? $async }} | ||
55 | + return data; | ||
56 | + {{??}} | ||
57 | + validate.errors = null; | ||
58 | + return true; | ||
59 | + {{?}} | ||
60 | + {{??}} | ||
61 | + var {{=$valid}} = true; | ||
62 | + {{?}} | ||
63 | + {{?}} | ||
64 | + | ||
65 | + {{? it.isTop}} | ||
66 | + }; | ||
67 | + return validate; | ||
68 | + {{?}} | ||
69 | + | ||
70 | + {{ return out; }} | ||
71 | +{{?}} | ||
72 | + | ||
73 | + | ||
74 | +{{? it.isTop }} | ||
75 | + {{ | ||
76 | + var $top = it.isTop | ||
77 | + , $lvl = it.level = 0 | ||
78 | + , $dataLvl = it.dataLevel = 0 | ||
79 | + , $data = 'data'; | ||
80 | + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); | ||
81 | + it.baseId = it.baseId || it.rootId; | ||
82 | + delete it.isTop; | ||
83 | + | ||
84 | + it.dataPathArr = [""]; | ||
85 | + | ||
86 | + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { | ||
87 | + var $defaultMsg = 'default is ignored in the schema root'; | ||
88 | + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); | ||
89 | + else throw new Error($defaultMsg); | ||
90 | + } | ||
91 | + }} | ||
92 | + | ||
93 | + var vErrors = null; {{ /* don't edit, used in replace */ }} | ||
94 | + var errors = 0; {{ /* don't edit, used in replace */ }} | ||
95 | + if (rootData === undefined) rootData = data; {{ /* don't edit, used in replace */ }} | ||
96 | +{{??}} | ||
97 | + {{ | ||
98 | + var $lvl = it.level | ||
99 | + , $dataLvl = it.dataLevel | ||
100 | + , $data = 'data' + ($dataLvl || ''); | ||
101 | + | ||
102 | + if ($id) it.baseId = it.resolve.url(it.baseId, $id); | ||
103 | + | ||
104 | + if ($async && !it.async) throw new Error('async schema in sync schema'); | ||
105 | + }} | ||
106 | + | ||
107 | + var errs_{{=$lvl}} = errors; | ||
108 | +{{?}} | ||
109 | + | ||
110 | +{{ | ||
111 | + var $valid = 'valid' + $lvl | ||
112 | + , $breakOnError = !it.opts.allErrors | ||
113 | + , $closingBraces1 = '' | ||
114 | + , $closingBraces2 = ''; | ||
115 | + | ||
116 | + var $errorKeyword; | ||
117 | + var $typeSchema = it.schema.type | ||
118 | + , $typeIsArray = Array.isArray($typeSchema); | ||
119 | + | ||
120 | + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { | ||
121 | + if ($typeIsArray) { | ||
122 | + if ($typeSchema.indexOf('null') == -1) | ||
123 | + $typeSchema = $typeSchema.concat('null'); | ||
124 | + } else if ($typeSchema != 'null') { | ||
125 | + $typeSchema = [$typeSchema, 'null']; | ||
126 | + $typeIsArray = true; | ||
127 | + } | ||
128 | + } | ||
129 | + | ||
130 | + if ($typeIsArray && $typeSchema.length == 1) { | ||
131 | + $typeSchema = $typeSchema[0]; | ||
132 | + $typeIsArray = false; | ||
133 | + } | ||
134 | +}} | ||
135 | + | ||
136 | +{{## def.checkType: | ||
137 | + {{ | ||
138 | + var $schemaPath = it.schemaPath + '.type' | ||
139 | + , $errSchemaPath = it.errSchemaPath + '/type' | ||
140 | + , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; | ||
141 | + }} | ||
142 | + | ||
143 | + if ({{= it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true) }}) { | ||
144 | +#}} | ||
145 | + | ||
146 | +{{? it.schema.$ref && $refKeywords }} | ||
147 | + {{? it.opts.extendRefs == 'fail' }} | ||
148 | + {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); }} | ||
149 | + {{?? it.opts.extendRefs !== true }} | ||
150 | + {{ | ||
151 | + $refKeywords = false; | ||
152 | + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); | ||
153 | + }} | ||
154 | + {{?}} | ||
155 | +{{?}} | ||
156 | + | ||
157 | +{{? it.schema.$comment && it.opts.$comment }} | ||
158 | + {{= it.RULES.all.$comment.code(it, '$comment') }} | ||
159 | +{{?}} | ||
160 | + | ||
161 | +{{? $typeSchema }} | ||
162 | + {{? it.opts.coerceTypes }} | ||
163 | + {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }} | ||
164 | + {{?}} | ||
165 | + | ||
166 | + {{ var $rulesGroup = it.RULES.types[$typeSchema]; }} | ||
167 | + {{? $coerceToTypes || $typeIsArray || $rulesGroup === true || | ||
168 | + ($rulesGroup && !$shouldUseGroup($rulesGroup)) }} | ||
169 | + {{ | ||
170 | + var $schemaPath = it.schemaPath + '.type' | ||
171 | + , $errSchemaPath = it.errSchemaPath + '/type'; | ||
172 | + }} | ||
173 | + {{# def.checkType }} | ||
174 | + {{? $coerceToTypes }} | ||
175 | + {{# def.coerceType }} | ||
176 | + {{??}} | ||
177 | + {{# def.error:'type' }} | ||
178 | + {{?}} | ||
179 | + } | ||
180 | + {{?}} | ||
181 | +{{?}} | ||
182 | + | ||
183 | + | ||
184 | +{{? it.schema.$ref && !$refKeywords }} | ||
185 | + {{= it.RULES.all.$ref.code(it, '$ref') }} | ||
186 | + {{? $breakOnError }} | ||
187 | + } | ||
188 | + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { | ||
189 | + {{ $closingBraces2 += '}'; }} | ||
190 | + {{?}} | ||
191 | +{{??}} | ||
192 | + {{~ it.RULES:$rulesGroup }} | ||
193 | + {{? $shouldUseGroup($rulesGroup) }} | ||
194 | + {{? $rulesGroup.type }} | ||
195 | + if ({{= it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers) }}) { | ||
196 | + {{?}} | ||
197 | + {{? it.opts.useDefaults }} | ||
198 | + {{? $rulesGroup.type == 'object' && it.schema.properties }} | ||
199 | + {{# def.defaultProperties }} | ||
200 | + {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }} | ||
201 | + {{# def.defaultItems }} | ||
202 | + {{?}} | ||
203 | + {{?}} | ||
204 | + {{~ $rulesGroup.rules:$rule }} | ||
205 | + {{? $shouldUseRule($rule) }} | ||
206 | + {{ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); }} | ||
207 | + {{? $code }} | ||
208 | + {{= $code }} | ||
209 | + {{? $breakOnError }} | ||
210 | + {{ $closingBraces1 += '}'; }} | ||
211 | + {{?}} | ||
212 | + {{?}} | ||
213 | + {{?}} | ||
214 | + {{~}} | ||
215 | + {{? $breakOnError }} | ||
216 | + {{= $closingBraces1 }} | ||
217 | + {{ $closingBraces1 = ''; }} | ||
218 | + {{?}} | ||
219 | + {{? $rulesGroup.type }} | ||
220 | + } | ||
221 | + {{? $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes }} | ||
222 | + else { | ||
223 | + {{ | ||
224 | + var $schemaPath = it.schemaPath + '.type' | ||
225 | + , $errSchemaPath = it.errSchemaPath + '/type'; | ||
226 | + }} | ||
227 | + {{# def.error:'type' }} | ||
228 | + } | ||
229 | + {{?}} | ||
230 | + {{?}} | ||
231 | + | ||
232 | + {{? $breakOnError }} | ||
233 | + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { | ||
234 | + {{ $closingBraces2 += '}'; }} | ||
235 | + {{?}} | ||
236 | + {{?}} | ||
237 | + {{~}} | ||
238 | +{{?}} | ||
239 | + | ||
240 | +{{? $breakOnError }} {{= $closingBraces2 }} {{?}} | ||
241 | + | ||
242 | +{{? $top }} | ||
243 | + {{? $async }} | ||
244 | + if (errors === 0) return data; {{ /* don't edit, used in replace */ }} | ||
245 | + else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }} | ||
246 | + {{??}} | ||
247 | + validate.errors = vErrors; {{ /* don't edit, used in replace */ }} | ||
248 | + return errors === 0; {{ /* don't edit, used in replace */ }} | ||
249 | + {{?}} | ||
250 | + }; | ||
251 | + | ||
252 | + return validate; | ||
253 | +{{??}} | ||
254 | + var {{=$valid}} = errors === errs_{{=$lvl}}; | ||
255 | +{{?}} | ||
256 | + | ||
257 | +{{ | ||
258 | + function $shouldUseGroup($rulesGroup) { | ||
259 | + var rules = $rulesGroup.rules; | ||
260 | + for (var i=0; i < rules.length; i++) | ||
261 | + if ($shouldUseRule(rules[i])) | ||
262 | + return true; | ||
263 | + } | ||
264 | + | ||
265 | + function $shouldUseRule($rule) { | ||
266 | + return it.schema[$rule.keyword] !== undefined || | ||
267 | + ($rule.implements && $ruleImplementsSomeKeyword($rule)); | ||
268 | + } | ||
269 | + | ||
270 | + function $ruleImplementsSomeKeyword($rule) { | ||
271 | + var impl = $rule.implements; | ||
272 | + for (var i=0; i < impl.length; i++) | ||
273 | + if (it.schema[impl[i]] !== undefined) | ||
274 | + return true; | ||
275 | + } | ||
276 | +}} |
express/node_modules/ajv/lib/dotjs/README.md
0 → 100644
express/node_modules/ajv/lib/dotjs/_limit.js
0 → 100644
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 (!($isData || typeof $schema == 'number' || $schema === undefined)) { | ||
28 | + throw new Error($keyword + ' must be number'); | ||
29 | + } | ||
30 | + if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { | ||
31 | + throw new Error($exclusiveKeyword + ' must be number or boolean'); | ||
32 | + } | ||
33 | + if ($isDataExcl) { | ||
34 | + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), | ||
35 | + $exclusive = 'exclusive' + $lvl, | ||
36 | + $exclType = 'exclType' + $lvl, | ||
37 | + $exclIsNumber = 'exclIsNumber' + $lvl, | ||
38 | + $opExpr = 'op' + $lvl, | ||
39 | + $opStr = '\' + ' + $opExpr + ' + \''; | ||
40 | + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; | ||
41 | + $schemaValueExcl = 'schemaExcl' + $lvl; | ||
42 | + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; | ||
43 | + var $errorKeyword = $exclusiveKeyword; | ||
44 | + var $$outStack = $$outStack || []; | ||
45 | + $$outStack.push(out); | ||
46 | + out = ''; /* istanbul ignore else */ | ||
47 | + if (it.createErrors !== false) { | ||
48 | + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; | ||
49 | + if (it.opts.messages !== false) { | ||
50 | + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; | ||
51 | + } | ||
52 | + if (it.opts.verbose) { | ||
53 | + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
54 | + } | ||
55 | + out += ' } '; | ||
56 | + } else { | ||
57 | + out += ' {} '; | ||
58 | + } | ||
59 | + var __err = out; | ||
60 | + out = $$outStack.pop(); | ||
61 | + if (!it.compositeRule && $breakOnError) { | ||
62 | + /* 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 += ' } else if ( '; | ||
72 | + if ($isData) { | ||
73 | + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
74 | + } | ||
75 | + 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) + '=\'; '; | ||
76 | + if ($schema === undefined) { | ||
77 | + $errorKeyword = $exclusiveKeyword; | ||
78 | + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; | ||
79 | + $schemaValue = $schemaValueExcl; | ||
80 | + $isData = $isDataExcl; | ||
81 | + } | ||
82 | + } else { | ||
83 | + var $exclIsNumber = typeof $schemaExcl == 'number', | ||
84 | + $opStr = $op; | ||
85 | + if ($exclIsNumber && $isData) { | ||
86 | + var $opExpr = '\'' + $opStr + '\''; | ||
87 | + out += ' if ( '; | ||
88 | + if ($isData) { | ||
89 | + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
90 | + } | ||
91 | + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; | ||
92 | + } else { | ||
93 | + if ($exclIsNumber && $schema === undefined) { | ||
94 | + $exclusive = true; | ||
95 | + $errorKeyword = $exclusiveKeyword; | ||
96 | + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; | ||
97 | + $schemaValue = $schemaExcl; | ||
98 | + $notOp += '='; | ||
99 | + } else { | ||
100 | + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); | ||
101 | + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { | ||
102 | + $exclusive = true; | ||
103 | + $errorKeyword = $exclusiveKeyword; | ||
104 | + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; | ||
105 | + $notOp += '='; | ||
106 | + } else { | ||
107 | + $exclusive = false; | ||
108 | + $opStr += '='; | ||
109 | + } | ||
110 | + } | ||
111 | + var $opExpr = '\'' + $opStr + '\''; | ||
112 | + out += ' if ( '; | ||
113 | + if ($isData) { | ||
114 | + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
115 | + } | ||
116 | + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; | ||
117 | + } | ||
118 | + } | ||
119 | + $errorKeyword = $errorKeyword || $keyword; | ||
120 | + var $$outStack = $$outStack || []; | ||
121 | + $$outStack.push(out); | ||
122 | + out = ''; /* istanbul ignore else */ | ||
123 | + if (it.createErrors !== false) { | ||
124 | + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; | ||
125 | + if (it.opts.messages !== false) { | ||
126 | + out += ' , message: \'should be ' + ($opStr) + ' '; | ||
127 | + if ($isData) { | ||
128 | + out += '\' + ' + ($schemaValue); | ||
129 | + } else { | ||
130 | + out += '' + ($schemaValue) + '\''; | ||
131 | + } | ||
132 | + } | ||
133 | + if (it.opts.verbose) { | ||
134 | + out += ' , schema: '; | ||
135 | + if ($isData) { | ||
136 | + out += 'validate.schema' + ($schemaPath); | ||
137 | + } else { | ||
138 | + out += '' + ($schema); | ||
139 | + } | ||
140 | + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
141 | + } | ||
142 | + out += ' } '; | ||
143 | + } else { | ||
144 | + out += ' {} '; | ||
145 | + } | ||
146 | + var __err = out; | ||
147 | + out = $$outStack.pop(); | ||
148 | + if (!it.compositeRule && $breakOnError) { | ||
149 | + /* istanbul ignore if */ | ||
150 | + if (it.async) { | ||
151 | + out += ' throw new ValidationError([' + (__err) + ']); '; | ||
152 | + } else { | ||
153 | + out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
154 | + } | ||
155 | + } else { | ||
156 | + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
157 | + } | ||
158 | + out += ' } '; | ||
159 | + if ($breakOnError) { | ||
160 | + out += ' else { '; | ||
161 | + } | ||
162 | + return out; | ||
163 | +} |
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 | + if (!($isData || typeof $schema == 'number')) { | ||
21 | + throw new Error($keyword + ' must be number'); | ||
22 | + } | ||
23 | + var $op = $keyword == 'maxItems' ? '>' : '<'; | ||
24 | + out += 'if ( '; | ||
25 | + if ($isData) { | ||
26 | + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
27 | + } | ||
28 | + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; | ||
29 | + var $errorKeyword = $keyword; | ||
30 | + var $$outStack = $$outStack || []; | ||
31 | + $$outStack.push(out); | ||
32 | + out = ''; /* istanbul ignore else */ | ||
33 | + if (it.createErrors !== false) { | ||
34 | + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; | ||
35 | + if (it.opts.messages !== false) { | ||
36 | + out += ' , message: \'should NOT have '; | ||
37 | + if ($keyword == 'maxItems') { | ||
38 | + out += 'more'; | ||
39 | + } else { | ||
40 | + out += 'fewer'; | ||
41 | + } | ||
42 | + out += ' than '; | ||
43 | + if ($isData) { | ||
44 | + out += '\' + ' + ($schemaValue) + ' + \''; | ||
45 | + } else { | ||
46 | + out += '' + ($schema); | ||
47 | + } | ||
48 | + out += ' items\' '; | ||
49 | + } | ||
50 | + if (it.opts.verbose) { | ||
51 | + out += ' , schema: '; | ||
52 | + if ($isData) { | ||
53 | + out += 'validate.schema' + ($schemaPath); | ||
54 | + } else { | ||
55 | + out += '' + ($schema); | ||
56 | + } | ||
57 | + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
58 | + } | ||
59 | + out += ' } '; | ||
60 | + } else { | ||
61 | + out += ' {} '; | ||
62 | + } | ||
63 | + var __err = out; | ||
64 | + out = $$outStack.pop(); | ||
65 | + if (!it.compositeRule && $breakOnError) { | ||
66 | + /* istanbul ignore if */ | ||
67 | + if (it.async) { | ||
68 | + out += ' throw new ValidationError([' + (__err) + ']); '; | ||
69 | + } else { | ||
70 | + out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
71 | + } | ||
72 | + } else { | ||
73 | + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
74 | + } | ||
75 | + out += '} '; | ||
76 | + if ($breakOnError) { | ||
77 | + out += ' else { '; | ||
78 | + } | ||
79 | + return out; | ||
80 | +} |
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 | + if (!($isData || typeof $schema == 'number')) { | ||
21 | + throw new Error($keyword + ' must be number'); | ||
22 | + } | ||
23 | + var $op = $keyword == 'maxLength' ? '>' : '<'; | ||
24 | + out += 'if ( '; | ||
25 | + if ($isData) { | ||
26 | + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
27 | + } | ||
28 | + if (it.opts.unicode === false) { | ||
29 | + out += ' ' + ($data) + '.length '; | ||
30 | + } else { | ||
31 | + out += ' ucs2length(' + ($data) + ') '; | ||
32 | + } | ||
33 | + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; | ||
34 | + var $errorKeyword = $keyword; | ||
35 | + var $$outStack = $$outStack || []; | ||
36 | + $$outStack.push(out); | ||
37 | + out = ''; /* istanbul ignore else */ | ||
38 | + if (it.createErrors !== false) { | ||
39 | + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; | ||
40 | + if (it.opts.messages !== false) { | ||
41 | + out += ' , message: \'should NOT be '; | ||
42 | + if ($keyword == 'maxLength') { | ||
43 | + out += 'longer'; | ||
44 | + } else { | ||
45 | + out += 'shorter'; | ||
46 | + } | ||
47 | + out += ' than '; | ||
48 | + if ($isData) { | ||
49 | + out += '\' + ' + ($schemaValue) + ' + \''; | ||
50 | + } else { | ||
51 | + out += '' + ($schema); | ||
52 | + } | ||
53 | + out += ' characters\' '; | ||
54 | + } | ||
55 | + if (it.opts.verbose) { | ||
56 | + out += ' , schema: '; | ||
57 | + if ($isData) { | ||
58 | + out += 'validate.schema' + ($schemaPath); | ||
59 | + } else { | ||
60 | + out += '' + ($schema); | ||
61 | + } | ||
62 | + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
63 | + } | ||
64 | + out += ' } '; | ||
65 | + } else { | ||
66 | + out += ' {} '; | ||
67 | + } | ||
68 | + var __err = out; | ||
69 | + out = $$outStack.pop(); | ||
70 | + if (!it.compositeRule && $breakOnError) { | ||
71 | + /* istanbul ignore if */ | ||
72 | + if (it.async) { | ||
73 | + out += ' throw new ValidationError([' + (__err) + ']); '; | ||
74 | + } else { | ||
75 | + out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
76 | + } | ||
77 | + } else { | ||
78 | + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
79 | + } | ||
80 | + out += '} '; | ||
81 | + if ($breakOnError) { | ||
82 | + out += ' else { '; | ||
83 | + } | ||
84 | + return out; | ||
85 | +} |
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 | + if (!($isData || typeof $schema == 'number')) { | ||
21 | + throw new Error($keyword + ' must be number'); | ||
22 | + } | ||
23 | + var $op = $keyword == 'maxProperties' ? '>' : '<'; | ||
24 | + out += 'if ( '; | ||
25 | + if ($isData) { | ||
26 | + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; | ||
27 | + } | ||
28 | + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; | ||
29 | + var $errorKeyword = $keyword; | ||
30 | + var $$outStack = $$outStack || []; | ||
31 | + $$outStack.push(out); | ||
32 | + out = ''; /* istanbul ignore else */ | ||
33 | + if (it.createErrors !== false) { | ||
34 | + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; | ||
35 | + if (it.opts.messages !== false) { | ||
36 | + out += ' , message: \'should NOT have '; | ||
37 | + if ($keyword == 'maxProperties') { | ||
38 | + out += 'more'; | ||
39 | + } else { | ||
40 | + out += 'fewer'; | ||
41 | + } | ||
42 | + out += ' than '; | ||
43 | + if ($isData) { | ||
44 | + out += '\' + ' + ($schemaValue) + ' + \''; | ||
45 | + } else { | ||
46 | + out += '' + ($schema); | ||
47 | + } | ||
48 | + out += ' properties\' '; | ||
49 | + } | ||
50 | + if (it.opts.verbose) { | ||
51 | + out += ' , schema: '; | ||
52 | + if ($isData) { | ||
53 | + out += 'validate.schema' + ($schemaPath); | ||
54 | + } else { | ||
55 | + out += '' + ($schema); | ||
56 | + } | ||
57 | + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; | ||
58 | + } | ||
59 | + out += ' } '; | ||
60 | + } else { | ||
61 | + out += ' {} '; | ||
62 | + } | ||
63 | + var __err = out; | ||
64 | + out = $$outStack.pop(); | ||
65 | + if (!it.compositeRule && $breakOnError) { | ||
66 | + /* istanbul ignore if */ | ||
67 | + if (it.async) { | ||
68 | + out += ' throw new ValidationError([' + (__err) + ']); '; | ||
69 | + } else { | ||
70 | + out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
71 | + } | ||
72 | + } else { | ||
73 | + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
74 | + } | ||
75 | + out += '} '; | ||
76 | + if ($breakOnError) { | ||
77 | + out += ' else { '; | ||
78 | + } | ||
79 | + return out; | ||
80 | +} |
express/node_modules/ajv/lib/dotjs/allOf.js
0 → 100644
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.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : 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 | + return out; | ||
42 | +} |
express/node_modules/ajv/lib/dotjs/anyOf.js
0 → 100644
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.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : 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) { | ||
56 | + /* istanbul ignore if */ | ||
57 | + if (it.async) { | ||
58 | + out += ' throw new ValidationError(vErrors); '; | ||
59 | + } else { | ||
60 | + out += ' validate.errors = vErrors; return false; '; | ||
61 | + } | ||
62 | + } | ||
63 | + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; | ||
64 | + if (it.opts.allErrors) { | ||
65 | + out += ' } '; | ||
66 | + } | ||
67 | + } else { | ||
68 | + if ($breakOnError) { | ||
69 | + out += ' if (true) { '; | ||
70 | + } | ||
71 | + } | ||
72 | + return out; | ||
73 | +} |
1 | +'use strict'; | ||
2 | +module.exports = function generate_comment(it, $keyword, $ruleType) { | ||
3 | + var out = ' '; | ||
4 | + var $schema = it.schema[$keyword]; | ||
5 | + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; | ||
6 | + var $breakOnError = !it.opts.allErrors; | ||
7 | + var $comment = it.util.toQuotedString($schema); | ||
8 | + if (it.opts.$comment === true) { | ||
9 | + out += ' console.log(' + ($comment) + ');'; | ||
10 | + } else if (typeof it.opts.$comment == 'function') { | ||
11 | + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; | ||
12 | + } | ||
13 | + return out; | ||
14 | +} |
express/node_modules/ajv/lib/dotjs/const.js
0 → 100644
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: { allowedValue: schema' + ($lvl) + ' } '; | ||
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) { | ||
42 | + /* istanbul ignore if */ | ||
43 | + if (it.async) { | ||
44 | + out += ' throw new ValidationError([' + (__err) + ']); '; | ||
45 | + } else { | ||
46 | + out += ' validate.errors = [' + (__err) + ']; return false; '; | ||
47 | + } | ||
48 | + } else { | ||
49 | + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; | ||
50 | + } | ||
51 | + out += ' }'; | ||
52 | + if ($breakOnError) { | ||
53 | + out += ' else { '; | ||
54 | + } | ||
55 | + return out; | ||
56 | +} |
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/custom.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/enum.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/format.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/if.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/items.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/not.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/dotjs/oneOf.js
0 → 100644
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.
express/node_modules/ajv/lib/dotjs/ref.js
0 → 100644
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.
express/node_modules/ajv/lib/keyword.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ajv/lib/refs/data.json
0 → 100644
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.
express/node_modules/ajv/package.json
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/ajv/scripts/bundle.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/ajv/scripts/info
0 → 100644
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.
express/node_modules/asn1/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/lib/ber/errors.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/lib/ber/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/lib/ber/reader.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/lib/ber/types.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/lib/ber/writer.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/lib/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asn1/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/assert-plus/AUTHORS
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/assert-plus/CHANGES.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/assert-plus/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/assert-plus/assert.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/bench.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/lib/abort.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/lib/async.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/lib/defer.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/lib/iterate.js
0 → 100644
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.
express/node_modules/asynckit/lib/state.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/parallel.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/serial.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/asynckit/stream.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/aws-sign2/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/aws-sign2/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/aws-sign2/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/aws-sign2/package.json
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/aws4/.travis.yml
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/aws4/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/aws4/aws4.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/aws4/lru.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/aws4/package.json
0 → 100644
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.
express/node_modules/bcrypt-pbkdf/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/bcrypt-pbkdf/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/bcrypt-pbkdf/index.js
0 → 100644
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.
express/node_modules/boxen/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/boxen/license
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/boxen/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.
express/node_modules/braces/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.
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.
express/node_modules/caseless/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/caseless/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/caseless/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/caseless/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/caseless/test.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/chalk/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.
express/node_modules/chalk/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.
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.
express/node_modules/core-util-is/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/core-util-is/README.md
0 → 100644
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.
express/node_modules/core-util-is/test.js
0 → 100644
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.
express/node_modules/dashdash/CHANGES.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/dashdash/LICENSE.txt
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/dashdash/README.md
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/dashdash/package.json
0 → 100644
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.
express/node_modules/delayed-stream/Makefile
0 → 100644
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.
express/node_modules/ecc-jsbn/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ecc-jsbn/index.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/ecc-jsbn/lib/ec.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ecc-jsbn/lib/sec.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ecc-jsbn/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/ecc-jsbn/test.js
0 → 100644
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.
express/node_modules/extend/.editorconfig
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extend/.eslintrc
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extend/.jscs.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extend/.travis.yml
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extend/CHANGELOG.md
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/extend/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extend/component.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extend/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extend/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extsprintf/.gitmodules
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extsprintf/.npmignore
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extsprintf/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/extsprintf/Makefile
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/extsprintf/README.md
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/extsprintf/package.json
0 → 100644
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.
express/node_modules/forever-agent/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/forever-agent/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/forever-agent/index.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/form-data/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/form-data/README.md.bak
0 → 100644
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.
express/node_modules/form-data/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/form-data/yarn.lock
0 → 100644
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.
express/node_modules/getpass/.npmignore
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/getpass/.travis.yml
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/getpass/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/getpass/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/getpass/lib/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/getpass/package.json
0 → 100644
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.
express/node_modules/got/license
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/got/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.
express/node_modules/har-schema/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/har-schema/README.md
0 → 100644
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.
express/node_modules/har-schema/lib/har.json
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/har-schema/lib/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/har-schema/lib/log.json
0 → 100644
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.
express/node_modules/har-schema/package.json
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/har-validator/README.md
0 → 100644
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.
express/node_modules/http-signature/LICENSE
0 → 100644
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.
express/node_modules/ini/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/ini/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/ini/ini.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.
express/node_modules/is-ci/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/is-ci/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/is-ci/bin.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/is-ci/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.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/is-glob/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.
express/node_modules/is-npm/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/is-npm/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.
express/node_modules/is-obj/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/is-obj/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.
express/node_modules/isstream/.jshintrc
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/isstream/.npmignore
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/isstream/.travis.yml
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/isstream/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/isstream/isstream.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/isstream/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/isstream/test.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsbn/.npmignore
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsbn/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsbn/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsbn/example.html
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsbn/example.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsbn/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsbn/package.json
0 → 100644
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.
express/node_modules/json-schema/README.md
0 → 100644
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.
express/node_modules/jsprim/CHANGES.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsprim/CONTRIBUTING.md
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/jsprim/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsprim/lib/jsprim.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/jsprim/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/keyv/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/keyv/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.
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.
express/node_modules/nodemon/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.
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.
express/node_modules/nopt/.npmignore
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/nopt/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/nopt/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.
express/node_modules/oauth-sign/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/oauth-sign/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/oauth-sign/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/oauth-sign/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/once/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/once/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/once/once.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.
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.
express/node_modules/psl/README.md
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/psl/data/rules.json
0 → 100644
This diff could not be displayed because it is too large.
express/node_modules/psl/dist/psl.js
0 → 100644
This diff could not be displayed because it is too large.
express/node_modules/psl/dist/psl.min.js
0 → 100644
This diff could not be displayed because it is too large.
express/node_modules/psl/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/psl/package.json
0 → 100644
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.
express/node_modules/pump/LICENSE
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/pump/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/pump/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.
express/node_modules/punycode/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/punycode/package.json
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/punycode/punycode.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/pupa/index.d.ts
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/pupa/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/pupa/license
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/pupa/readme.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/rc/LICENSE.BSD
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/LICENSE.MIT
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/README.md
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/browser.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/cli.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/index.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/lib/utils.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/package.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
express/node_modules/rc/test/ini.js
deleted
100644 → 0
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/rc/test/test.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.
This diff is collapsed. Click to expand it.
express/node_modules/request/CHANGELOG.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/LICENSE
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/README.md
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/index.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/auth.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/cookies.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/har.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/hawk.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/helpers.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/oauth.js
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/redirect.js
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/lib/tunnel.js
0 → 100644
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.
express/node_modules/request/package.json
0 → 100644
This diff is collapsed. Click to expand it.
express/node_modules/request/request.js
0 → 100644
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.
express/node_modules/semver/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.
-
Please register or login to post a comment