Skip to content

Commit

Permalink
Merge branch 'master' into basher/ajv-named-export
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoniangreen committed Mar 20, 2024
2 parents ac2347f + 5c7f3b6 commit 227036f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/options.md
Expand Up @@ -240,7 +240,7 @@ An array or object of schemas that will be added to the instance. In case you pa

### logger

Sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging).
Sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](./api.md#error-logging).

Option values:

Expand Down
10 changes: 5 additions & 5 deletions docs/packages/README.md
Expand Up @@ -14,11 +14,11 @@ If you have published a useful plugin please submit a PR to add it to the next s

## Related packages

- [ajv-formats](./ajv-formats.md) - formats defined in JSON Schema specification
- [ajv-keywords](./ajv-keywords) - additional validation keywords (select, typeof, etc.)
- [ajv-errors](./ajv-errors.md) - defining error messages in the schema
- [ajv-i18n](./ajv-i18n) - internationalised error messages
- [ajv-cli](./ajv-cli.md) - command line interface
- [ajv-formats](https://github.com/ajv-validator/ajv-formats) - formats defined in JSON Schema specification
- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - additional validation keywords (select, typeof, etc.)
- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - defining error messages in the schema
- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages
- [ajv-cli](https://github.com/ajv-validator/ajv-cli) - command line interface
- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - MongoDB's bsonType formats
- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - formats for draft-2019-09 that are not included in [ajv-formats](./ajv-formats.md) (`idn-hostname`, `idn-email`, `iri` and `iri-reference`)
- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - keywords $merge and $patch
30 changes: 25 additions & 5 deletions lib/compile/codegen/index.ts
Expand Up @@ -41,7 +41,11 @@ abstract class Node {
}

class Def extends Node {
constructor(private readonly varKind: Name, private readonly name: Name, private rhs?: SafeExpr) {
constructor(
private readonly varKind: Name,
private readonly name: Name,
private rhs?: SafeExpr
) {
super()
}

Expand All @@ -63,7 +67,11 @@ class Def extends Node {
}

class Assign extends Node {
constructor(readonly lhs: Code, public rhs: SafeExpr, private readonly sideEffects?: boolean) {
constructor(
readonly lhs: Code,
public rhs: SafeExpr,
private readonly sideEffects?: boolean
) {
super()
}

Expand All @@ -84,7 +92,12 @@ class Assign extends Node {
}

class AssignOp extends Assign {
constructor(lhs: Code, private readonly op: Code, rhs: SafeExpr, sideEffects?: boolean) {
constructor(
lhs: Code,
private readonly op: Code,
rhs: SafeExpr,
sideEffects?: boolean
) {
super(lhs, rhs, sideEffects)
}

Expand Down Expand Up @@ -211,7 +224,10 @@ class Else extends BlockNode {
class If extends BlockNode {
static readonly kind = "if"
else?: If | Else
constructor(private condition: Code | boolean, nodes?: ChildNode[]) {
constructor(
private condition: Code | boolean,
nodes?: ChildNode[]
) {
super(nodes)
}

Expand Down Expand Up @@ -331,7 +347,11 @@ class ForIter extends For {

class Func extends BlockNode {
static readonly kind = "func"
constructor(public name: Name, public args: Code, public async?: boolean) {
constructor(
public name: Name,
public args: Code,
public async?: boolean
) {
super()
}

Expand Down
9 changes: 6 additions & 3 deletions lib/types/index.ts
Expand Up @@ -138,9 +138,12 @@ export interface DataValidateFunction {
}

export interface SchemaValidateFunction {
(schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt):
| boolean
| Promise<any>
(
schema: any,
data: any,
parentSchema?: AnySchemaObject,
dataCxt?: DataValidationCxt
): boolean | Promise<any>
errors?: Partial<ErrorObject>[]
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -64,7 +64,7 @@
"uri-js": "^4.4.1"
},
"devDependencies": {
"@ajv-validator/config": "^0.3.0",
"@ajv-validator/config": "^0.4.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
Expand Down Expand Up @@ -98,7 +98,7 @@
"module-from-string": "^3.3.0",
"node-fetch": "^3.3.2",
"nyc": "^15.1.0",
"prettier": "^2.8.8",
"prettier": "3.0.3",
"re2": "^1.20.9",
"rollup": "^2.79.1",
"rollup-plugin-terser": "^7.0.2",
Expand Down

0 comments on commit 227036f

Please sign in to comment.