Skip to content

Commit

Permalink
[ci] release (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Jan 22, 2024
1 parent 1c4b78b commit 4c13eca
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 52 deletions.
51 changes: 0 additions & 51 deletions .changeset/plenty-ladybugs-run.md

This file was deleted.

52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# ajv-ts

## 0.6.1

### Patch Changes

- 1c4b78b: - fix `default` behavior.

Now you can pass `undefined` or `null` and your default values will be applies.

**NOTE:** `default` keyword will be applied for `items` and `properties` definition. That means `default` keyword will works only for `object()` and `array()` builders. See in [ajv](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) docs

Example:

```ts
import s from "ajv-ts";

const Person = s.object({
age: s.number().default(18),
});

// Before
Person.parse({}); // throws error

// Now
Person.parse({}); // returns { age: 18 }, default value
```

- `parse`, `safeParse` and `validate` now can be called without arguments.

```ts
import s from "ajv-ts";

// Before
s.number().safeParse(); // Error, required at least 1 argument

// After
s.number().safeParse(); // ok now
```

- expose default `Ajv` instance.

- make `object` builder optional.

Example:

```ts
import s from "ajv-ts";
// Before
s.object(); // error, expected object
// After
s.object(); // OK, empty object definition
```

## 0.6.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ajv-ts",
"description": "JSON-schema builder with typescript safety",
"version": "0.6.0",
"version": "0.6.1",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 4c13eca

Please sign in to comment.