Skip to content

Commit b82a506

Browse files
committed
docs: update method descriptions to latest changes
1 parent 0a14070 commit b82a506

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ expect(reducedNode.schema).to.deep.eq({
752752
753753
### toDataNodes
754754

755-
`each` iterates over each data-item (_object_, _array_ and _value_) and emits the data-item, schema and location to a callback.
755+
`toDataNodes` collects all data-items (_object_, _array_ and _value_) and their SchemaNode and return them as a list of **DataNodes**:
756756

757757
```ts
758758
type DataNode = { pointer: string; value: unknown; node: SchemaNode };
@@ -788,7 +788,7 @@ expect(calls).to.deep.equal([
788788

789789
### toSchemaNodes
790790

791-
`eachSchema` emits each sub-schema definition to a callback. A sub-schema is any schema-definition like in `properties["property"]`, `anyOf[1]`, `contains`, `$defs["name"]`, etc.
791+
`toSchemaNodes` collects all sub-schema definitions, like in `properties["property"]`, `anyOf[1]`, `contains`, `$defs["name"]`, etc. and returns them as a list of **SchemaNodes**:
792792

793793
```ts
794794
const nodes: SchemaNode[] = compileSchema(mySchema).toSchemaNodes();
@@ -1233,13 +1233,13 @@ The new implementation revolves around compiling schemas into a **SchemaNode** t
12331233

12341234
**`compileSchema`** is now a standalone function and replaces the `Draft` class. All return values for JSON Schema are now `SchemaNode` objects that contain a `schema` property.
12351235

1236-
```ts
1237-
// PREVIOUSLY
1238-
const draft = new Draft(schema);
1236+
```ts
1237+
// PREVIOUSLY
1238+
const draft = new Draft(schema);
12391239

1240-
// NOW
1241-
const node = compileSchema(schema);
1242-
```
1240+
// NOW
1241+
const node = compileSchema(schema);
1242+
```
12431243

12441244
**Changed Methods**:
12451245

0 commit comments

Comments
 (0)