Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
7
my-app/node_modules/ajv/lib/runtime/equal.ts
generated
vendored
Executable file
7
my-app/node_modules/ajv/lib/runtime/equal.ts
generated
vendored
Executable file
|
@ -0,0 +1,7 @@
|
|||
// https://github.com/ajv-validator/ajv/issues/889
|
||||
import * as equal from "fast-deep-equal"
|
||||
|
||||
type Equal = typeof equal & {code: string}
|
||||
;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default'
|
||||
|
||||
export default equal as Equal
|
176
my-app/node_modules/ajv/lib/runtime/parseJson.ts
generated
vendored
Executable file
176
my-app/node_modules/ajv/lib/runtime/parseJson.ts
generated
vendored
Executable file
|
@ -0,0 +1,176 @@
|
|||
const rxParseJson = /position\s(\d+)$/
|
||||
|
||||
export function parseJson(s: string, pos: number): unknown {
|
||||
let endPos: number | undefined
|
||||
parseJson.message = undefined
|
||||
let matches: RegExpExecArray | null
|
||||
if (pos) s = s.slice(pos)
|
||||
try {
|
||||
parseJson.position = pos + s.length
|
||||
return JSON.parse(s)
|
||||
} catch (e) {
|
||||
matches = rxParseJson.exec((e as Error).message)
|
||||
if (!matches) {
|
||||
parseJson.message = "unexpected end"
|
||||
return undefined
|
||||
}
|
||||
endPos = +matches[1]
|
||||
const c = s[endPos]
|
||||
s = s.slice(0, endPos)
|
||||
parseJson.position = pos + endPos
|
||||
try {
|
||||
return JSON.parse(s)
|
||||
} catch (e1) {
|
||||
parseJson.message = `unexpected token ${c}`
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parseJson.message = undefined as string | undefined
|
||||
parseJson.position = 0 as number
|
||||
parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson'
|
||||
|
||||
export function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined {
|
||||
let numStr = ""
|
||||
let c: string
|
||||
parseJsonNumber.message = undefined
|
||||
if (s[pos] === "-") {
|
||||
numStr += "-"
|
||||
pos++
|
||||
}
|
||||
if (s[pos] === "0") {
|
||||
numStr += "0"
|
||||
pos++
|
||||
} else {
|
||||
if (!parseDigits(maxDigits)) {
|
||||
errorMessage()
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
if (maxDigits) {
|
||||
parseJsonNumber.position = pos
|
||||
return +numStr
|
||||
}
|
||||
if (s[pos] === ".") {
|
||||
numStr += "."
|
||||
pos++
|
||||
if (!parseDigits()) {
|
||||
errorMessage()
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
if (((c = s[pos]), c === "e" || c === "E")) {
|
||||
numStr += "e"
|
||||
pos++
|
||||
if (((c = s[pos]), c === "+" || c === "-")) {
|
||||
numStr += c
|
||||
pos++
|
||||
}
|
||||
if (!parseDigits()) {
|
||||
errorMessage()
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
parseJsonNumber.position = pos
|
||||
return +numStr
|
||||
|
||||
function parseDigits(maxLen?: number): boolean {
|
||||
let digit = false
|
||||
while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) {
|
||||
digit = true
|
||||
numStr += c
|
||||
pos++
|
||||
}
|
||||
return digit
|
||||
}
|
||||
|
||||
function errorMessage(): void {
|
||||
parseJsonNumber.position = pos
|
||||
parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"
|
||||
}
|
||||
}
|
||||
|
||||
parseJsonNumber.message = undefined as string | undefined
|
||||
parseJsonNumber.position = 0 as number
|
||||
parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber'
|
||||
|
||||
const escapedChars: {[X in string]?: string} = {
|
||||
b: "\b",
|
||||
f: "\f",
|
||||
n: "\n",
|
||||
r: "\r",
|
||||
t: "\t",
|
||||
'"': '"',
|
||||
"/": "/",
|
||||
"\\": "\\",
|
||||
}
|
||||
|
||||
const CODE_A: number = "a".charCodeAt(0)
|
||||
const CODE_0: number = "0".charCodeAt(0)
|
||||
|
||||
export function parseJsonString(s: string, pos: number): string | undefined {
|
||||
let str = ""
|
||||
let c: string | undefined
|
||||
parseJsonString.message = undefined
|
||||
// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
|
||||
while (true) {
|
||||
c = s[pos++]
|
||||
if (c === '"') break
|
||||
if (c === "\\") {
|
||||
c = s[pos]
|
||||
if (c in escapedChars) {
|
||||
str += escapedChars[c]
|
||||
pos++
|
||||
} else if (c === "u") {
|
||||
pos++
|
||||
let count = 4
|
||||
let code = 0
|
||||
while (count--) {
|
||||
code <<= 4
|
||||
c = s[pos]
|
||||
if (c === undefined) {
|
||||
errorMessage("unexpected end")
|
||||
return undefined
|
||||
}
|
||||
c = c.toLowerCase()
|
||||
if (c >= "a" && c <= "f") {
|
||||
code += c.charCodeAt(0) - CODE_A + 10
|
||||
} else if (c >= "0" && c <= "9") {
|
||||
code += c.charCodeAt(0) - CODE_0
|
||||
} else {
|
||||
errorMessage(`unexpected token ${c}`)
|
||||
return undefined
|
||||
}
|
||||
pos++
|
||||
}
|
||||
str += String.fromCharCode(code)
|
||||
} else {
|
||||
errorMessage(`unexpected token ${c}`)
|
||||
return undefined
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
} else if (c === undefined) {
|
||||
errorMessage("unexpected end")
|
||||
return undefined
|
||||
} else {
|
||||
if (c.charCodeAt(0) >= 0x20) {
|
||||
str += c
|
||||
} else {
|
||||
errorMessage(`unexpected token ${c}`)
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
parseJsonString.position = pos
|
||||
return str
|
||||
|
||||
function errorMessage(msg: string): void {
|
||||
parseJsonString.position = pos
|
||||
parseJsonString.message = msg
|
||||
}
|
||||
}
|
||||
|
||||
parseJsonString.message = undefined as string | undefined
|
||||
parseJsonString.position = 0 as number
|
||||
parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString'
|
31
my-app/node_modules/ajv/lib/runtime/quote.ts
generated
vendored
Executable file
31
my-app/node_modules/ajv/lib/runtime/quote.ts
generated
vendored
Executable file
|
@ -0,0 +1,31 @@
|
|||
const rxEscapable =
|
||||
// eslint-disable-next-line no-control-regex, no-misleading-character-class
|
||||
/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g
|
||||
|
||||
const escaped: {[K in string]?: string} = {
|
||||
"\b": "\\b",
|
||||
"\t": "\\t",
|
||||
"\n": "\\n",
|
||||
"\f": "\\f",
|
||||
"\r": "\\r",
|
||||
'"': '\\"',
|
||||
"\\": "\\\\",
|
||||
}
|
||||
|
||||
export default function quote(s: string): string {
|
||||
rxEscapable.lastIndex = 0
|
||||
return (
|
||||
'"' +
|
||||
(rxEscapable.test(s)
|
||||
? s.replace(rxEscapable, (a) => {
|
||||
const c = escaped[a]
|
||||
return typeof c === "string"
|
||||
? c
|
||||
: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
|
||||
})
|
||||
: s) +
|
||||
'"'
|
||||
)
|
||||
}
|
||||
|
||||
quote.code = 'require("ajv/dist/runtime/quote").default'
|
6
my-app/node_modules/ajv/lib/runtime/re2.ts
generated
vendored
Executable file
6
my-app/node_modules/ajv/lib/runtime/re2.ts
generated
vendored
Executable file
|
@ -0,0 +1,6 @@
|
|||
import * as re2 from "re2"
|
||||
|
||||
type Re2 = typeof re2 & {code: string}
|
||||
;(re2 as Re2).code = 'require("ajv/dist/runtime/re2").default'
|
||||
|
||||
export default re2 as Re2
|
46
my-app/node_modules/ajv/lib/runtime/timestamp.ts
generated
vendored
Executable file
46
my-app/node_modules/ajv/lib/runtime/timestamp.ts
generated
vendored
Executable file
|
@ -0,0 +1,46 @@
|
|||
const DT_SEPARATOR = /t|\s/i
|
||||
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/
|
||||
const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i
|
||||
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
||||
|
||||
export default function validTimestamp(str: string, allowDate: boolean): boolean {
|
||||
// http://tools.ietf.org/html/rfc3339#section-5.6
|
||||
const dt: string[] = str.split(DT_SEPARATOR)
|
||||
return (
|
||||
(dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) ||
|
||||
(allowDate && dt.length === 1 && validDate(dt[0]))
|
||||
)
|
||||
}
|
||||
|
||||
function validDate(str: string): boolean {
|
||||
const matches: string[] | null = DATE.exec(str)
|
||||
if (!matches) return false
|
||||
const y: number = +matches[1]
|
||||
const m: number = +matches[2]
|
||||
const d: number = +matches[3]
|
||||
return (
|
||||
m >= 1 &&
|
||||
m <= 12 &&
|
||||
d >= 1 &&
|
||||
(d <= DAYS[m] ||
|
||||
// leap year: https://tools.ietf.org/html/rfc3339#appendix-C
|
||||
(m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0)))
|
||||
)
|
||||
}
|
||||
|
||||
function validTime(str: string): boolean {
|
||||
const matches: string[] | null = TIME.exec(str)
|
||||
if (!matches) return false
|
||||
const hr: number = +matches[1]
|
||||
const min: number = +matches[2]
|
||||
const sec: number = +matches[3]
|
||||
const tzH: number = +(matches[4] || 0)
|
||||
const tzM: number = +(matches[5] || 0)
|
||||
return (
|
||||
(hr <= 23 && min <= 59 && sec <= 59) ||
|
||||
// leap second
|
||||
(hr - tzH === 23 && min - tzM === 59 && sec === 60)
|
||||
)
|
||||
}
|
||||
|
||||
validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default'
|
20
my-app/node_modules/ajv/lib/runtime/ucs2length.ts
generated
vendored
Executable file
20
my-app/node_modules/ajv/lib/runtime/ucs2length.ts
generated
vendored
Executable file
|
@ -0,0 +1,20 @@
|
|||
// https://mathiasbynens.be/notes/javascript-encoding
|
||||
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
|
||||
export default function ucs2length(str: string): number {
|
||||
const len = str.length
|
||||
let length = 0
|
||||
let pos = 0
|
||||
let value: number
|
||||
while (pos < len) {
|
||||
length++
|
||||
value = str.charCodeAt(pos++)
|
||||
if (value >= 0xd800 && value <= 0xdbff && pos < len) {
|
||||
// high surrogate, and there is a next character
|
||||
value = str.charCodeAt(pos)
|
||||
if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate
|
||||
}
|
||||
}
|
||||
return length
|
||||
}
|
||||
|
||||
ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'
|
6
my-app/node_modules/ajv/lib/runtime/uri.ts
generated
vendored
Executable file
6
my-app/node_modules/ajv/lib/runtime/uri.ts
generated
vendored
Executable file
|
@ -0,0 +1,6 @@
|
|||
import * as uri from "uri-js"
|
||||
|
||||
type URI = typeof uri & {code: string}
|
||||
;(uri as URI).code = 'require("ajv/dist/runtime/uri").default'
|
||||
|
||||
export default uri as URI
|
13
my-app/node_modules/ajv/lib/runtime/validation_error.ts
generated
vendored
Executable file
13
my-app/node_modules/ajv/lib/runtime/validation_error.ts
generated
vendored
Executable file
|
@ -0,0 +1,13 @@
|
|||
import type {ErrorObject} from "../types"
|
||||
|
||||
export default class ValidationError extends Error {
|
||||
readonly errors: Partial<ErrorObject>[]
|
||||
readonly ajv: true
|
||||
readonly validation: true
|
||||
|
||||
constructor(errors: Partial<ErrorObject>[]) {
|
||||
super("validation failed")
|
||||
this.errors = errors
|
||||
this.ajv = this.validation = true
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue