Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.217.80
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
nodejs /
ajv /
lib /
vocabularies /
jtd /
Delete
Unzip
Name
Size
Permission
Date
Action
discriminator.ts
2.59
KB
-rw-r--r--
2023-12-16 08:36
elements.ts
976
B
-rw-r--r--
2023-12-16 08:36
enum.ts
1.59
KB
-rw-r--r--
2023-12-16 08:36
error.ts
746
B
-rw-r--r--
2023-12-16 08:36
index.ts
1007
B
-rw-r--r--
2023-12-16 08:36
metadata.ts
716
B
-rw-r--r--
2023-12-16 08:36
nullable.ts
649
B
-rw-r--r--
2023-12-16 08:36
optionalProperties.ts
394
B
-rw-r--r--
2023-12-16 08:36
properties.ts
6.1
KB
-rw-r--r--
2023-12-16 08:36
ref.ts
2.29
KB
-rw-r--r--
2023-12-16 08:36
type.ts
2.49
KB
-rw-r--r--
2023-12-16 08:36
union.ts
292
B
-rw-r--r--
2023-12-16 08:36
values.ts
1.64
KB
-rw-r--r--
2023-12-16 08:36
Save
Rename
import type {CodeKeywordDefinition, AnySchemaObject} from "../../types" import type {KeywordCxt} from "../../compile/validate" import {compileSchema, SchemaEnv} from "../../compile" import {_, not, nil, stringify} from "../../compile/codegen" import MissingRefError from "../../compile/ref_error" import N from "../../compile/names" import {getValidate, callRef} from "../core/ref" import {checkMetadata} from "./metadata" const def: CodeKeywordDefinition = { keyword: "ref", schemaType: "string", code(cxt: KeywordCxt) { checkMetadata(cxt) const {gen, data, schema: ref, parentSchema, it} = cxt const { schemaEnv: {root}, } = it const valid = gen.name("valid") if (parentSchema.nullable) { gen.var(valid, _`${data} === null`) gen.if(not(valid), validateJtdRef) } else { gen.var(valid, false) validateJtdRef() } cxt.ok(valid) function validateJtdRef(): void { const refSchema = (root.schema as AnySchemaObject).definitions?.[ref] if (!refSchema) { throw new MissingRefError(it.opts.uriResolver, "", ref, `No definition ${ref}`) } if (hasRef(refSchema) || !it.opts.inlineRefs) callValidate(refSchema) else inlineRefSchema(refSchema) } function callValidate(schema: AnySchemaObject): void { const sch = compileSchema.call( it.self, new SchemaEnv({schema, root, schemaPath: `/definitions/${ref}`}) ) const v = getValidate(cxt, sch) const errsCount = gen.const("_errs", N.errors) callRef(cxt, v, sch, sch.$async) gen.assign(valid, _`${errsCount} === ${N.errors}`) } function inlineRefSchema(schema: AnySchemaObject): void { const schName = gen.scopeValue( "schema", it.opts.code.source === true ? {ref: schema, code: stringify(schema)} : {ref: schema} ) cxt.subschema( { schema, dataTypes: [], schemaPath: nil, topSchemaRef: schName, errSchemaPath: `/definitions/${ref}`, }, valid ) } }, } export function hasRef(schema: AnySchemaObject): boolean { for (const key in schema) { let sch: AnySchemaObject if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) return true } return false } export default def