@hyperjump/json-schema
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -1,2 +0,2 @@ | ||
import { append as pointerAppend } from "@hyperjump/json-pointer"; | ||
import { append as pointerAppend, get as pointerGet } from "@hyperjump/json-pointer"; | ||
import { toAbsoluteIri } from "@hyperjump/uri"; | ||
@@ -21,3 +21,8 @@ import curry from "just-curry-it"; | ||
return { ...instance, pointer: url.substr(1) }; | ||
const pointer = url.substr(1); | ||
return { | ||
...instance, | ||
pointer: pointer, | ||
value: pointerGet(pointer, instance.instance) | ||
}; | ||
}; | ||
@@ -24,0 +29,0 @@ |
{ | ||
"name": "@hyperjump/json-schema", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "A JSON Schema validator with support for custom keywords, vocabularies, and dialects", | ||
@@ -29,3 +29,3 @@ "type": "module", | ||
"clean": "xargs -a .gitignore rm -rf", | ||
"lint": "eslint lib stable draft-* openapi-*", | ||
"lint": "eslint lib stable draft-* openapi-* bundle annotations", | ||
"test": "mocha 'lib/**/*.spec.ts' 'stable/**/*.spec.ts' 'draft-*/**/*.spec.ts' 'openapi-*/**/*.spec.ts' 'bundle/**/*.spec.ts' 'annotations/**/*.spec.ts'" | ||
@@ -32,0 +32,0 @@ }, |
@@ -197,7 +197,7 @@ # Hyperjump - JSON Schema | ||
the network. | ||
* **validate**: (schemaURI: string, instance: any, outputFormat: OutputFormat = FLAG) => Promise<OutputUnit> | ||
* **validate**: (schemaURI: string, instance: any, outputFormat: OutputFormat = * FLAG) => Promise\<OutputUnit> | ||
Validate an instance against a schema. This function is curried to allow | ||
compiling the schema once and applying it to multiple instances. | ||
* **validate**: (schemaURI: string) => Promise<(instance: any, outputFormat: OutputFormat = FLAG) => OutputUnit> | ||
* **validate**: (schemaURI: string) => Promise\<(instance: any, outputFormat: OutputFormat = FLAG) => OutputUnit> | ||
@@ -317,3 +317,3 @@ Compiling a schema to a validation function. | ||
* **bundle**: (uri: string, options: Options) => Promise<SchemaObject> | ||
* **bundle**: (uri: string, options: Options) => Promise\<SchemaObject> | ||
@@ -538,3 +538,3 @@ Create a bundled schema starting with the given schema. External schemas | ||
own to avoid conflict with keywords defined by others. | ||
* compile: (schema: SchemaDocument, ast: AST, parentSchema: SchemaDocument) => Promise<A> | ||
* compile: (schema: SchemaDocument, ast: AST, parentSchema: SchemaDocument) * => Promise\<A> | ||
@@ -557,3 +557,3 @@ This function takes the keyword value, does whatever preprocessing it | ||
function for `unevaluatedProperties` to work as expected. | ||
* collectEvaluatedItems?: (compiledKeywordValue: A, instance: JsonDocument, ast: AST, dynamicAnchors: Anchors) => Set<number> | false | ||
* collectEvaluatedItems?: (compiledKeywordValue: A, instance: JsonDocument, * ast: AST, dynamicAnchors: Anchors) => Set\<number> | false | ||
@@ -574,3 +574,3 @@ If the keyword is an applicator, it will need to implements this | ||
Load a schema. Returns the identifier for the schema. | ||
* **Schema.get**: (url: string, contextDoc?: SchemaDocument) => Promise<SchemaDocument> | ||
* **Schema.get**: (url: string, contextDoc?: SchemaDocument) => Promise\<SchemaDocument> | ||
@@ -588,18 +588,18 @@ Fetch a schema. Schemas can come from an HTTP request, a file, or a schema | ||
Determines if the JSON type of the given doc matches the given type. | ||
* **Schema.has**: (key: string, doc: SchemaDocument) => Promise<SchemaDocument> | ||
* **Schema.has**: (key: string, doc: SchemaDocument) => Promise\<SchemaDocument> | ||
Similar to `key in schema`. | ||
* **Schema.step**: (key: string, doc: SchemaDocument) => Promise<SchemaDocument> | ||
* **Schema.step**: (key: string, doc: SchemaDocument) => Promise\<SchemaDocument> | ||
Similar to `schema[key]`, but returns an SchemaDocument. | ||
* **Schema.iter**: (doc: SchemaDocument) => AsyncGenerator<SchemaDocument> | ||
* **Schema.iter**: (doc: SchemaDocument) => AsyncGenerator\<SchemaDocument> | ||
Iterate over the items in the array that the SchemaDocument represents | ||
* **Schema.entries**: (doc: SchemaDocument) => AsyncGenerator<[string, SchemaDocument]> | ||
* **Schema.entries**: (doc: SchemaDocument) => AsyncGenerator\<[string, SchemaDocument]> | ||
Similar to `Object.entries`, but yields SchemaDocuments for values. | ||
* **Schema.values**: (doc: SchemaDocument) => AsyncGenerator<SchemaDocument> | ||
* **Schema.values**: (doc: SchemaDocument) => AsyncGenerator\<SchemaDocument> | ||
Similar to `Object.values`, but yields SchemaDocuments for values. | ||
* **Schema.keys**: (doc: SchemaDocument) => Generator<string> | ||
* **Schema.keys**: (doc: SchemaDocument) => Generator\<string> | ||
@@ -656,12 +656,12 @@ Similar to `Object.keys`. | ||
Similar to `schema[key]`, but returns a InstanceDocument. | ||
* **Instance.iter**: (doc: InstanceDocument) => Generator<InstanceDocument> | ||
* **Instance.iter**: (doc: InstanceDocument) => Generator\<InstanceDocument> | ||
Iterate over the items in the array that the SchemaDocument represents. | ||
* **Instance.entries**: (doc: InstanceDocument) => Generator<[string, InstanceDocument]> | ||
* **Instance.entries**: (doc: InstanceDocument) => Generator\<[string, InstanceDocument]> | ||
Similar to `Object.entries`, but yields InstanceDocuments for values. | ||
* **Instance.values**: (doc: InstanceDocument) => Generator<InstanceDocument> | ||
* **Instance.values**: (doc: InstanceDocument) => Generator\<InstanceDocument> | ||
Similar to `Object.values`, but yields InstanceDocuments for values. | ||
* **Instance.keys**: (doc: InstanceDocument) => Generator<string> | ||
* **Instance.keys**: (doc: InstanceDocument) => Generator\<string> | ||
@@ -753,3 +753,3 @@ Similar to `Object.keys`. | ||
* **annotate**: (schemaUri: string, instance: any, outputFormat: OutputFormat = FLAG) => Promise<AnnotatedInstance> | ||
* **annotate**: (schemaUri: string, instance: any, outputFormat: OutputFormat = * FLAG) => Promise\<AnnotatedInstance> | ||
@@ -788,3 +788,3 @@ Annotate an instance using the given schema. The function is curried to | ||
* **compile**: (schema: SchemaDocument) => Promise<CompiledSchema> | ||
* **compile**: (schemaUri: string) => Promise\<CompiledSchema> | ||
@@ -791,0 +791,0 @@ Return a compiled schema. This is useful if you're creating tooling for |
357048
10420