Skip to content

Commit

Permalink
version 2.2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Mar 8, 2021
1 parent c245666 commit b88a20c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
**Note**: Gaps between patch versions are faulty/broken releases.
**Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.

# 2.2.16

Experimental modules require `fp-ts@^2.5.0`.

- **Experimental**
- `Codec`
- add `readonly` combinator (@gcanti)
- `Encoder`
- add `readonly` combinator (@gcanti)

# 2.2.15

- **Experimental**
Expand Down
11 changes: 11 additions & 0 deletions docs/modules/Codec.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Added in v2.2.3
- [mapLeftWithInput](#mapleftwithinput)
- [nullable](#nullable)
- [partial](#partial)
- [readonly](#readonly)
- [record](#record)
- [refine](#refine)
- [struct](#struct)
Expand Down Expand Up @@ -237,6 +238,16 @@ export declare function partial<P extends Record<string, Codec<unknown, any, any

Added in v2.2.3

## readonly

**Signature**

```ts
export declare const readonly: <I, O, A>(codec: Codec<I, O, A>) => Codec<I, O, Readonly<A>>
```

Added in v2.2.16

## record

**Signature**
Expand Down
11 changes: 11 additions & 0 deletions docs/modules/Encoder.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Added in v2.2.3
- [lazy](#lazy)
- [nullable](#nullable)
- [partial](#partial)
- [readonly](#readonly)
- [record](#record)
- [struct](#struct)
- [sum](#sum)
Expand Down Expand Up @@ -139,6 +140,16 @@ export declare function partial<P extends Record<string, Encoder<any, any>>>(

Added in v2.2.3

## readonly

**Signature**

```ts
export declare const readonly: <O, A>(decoder: Encoder<O, A>) => Encoder<O, Readonly<A>>
```

Added in v2.2.16

## record

**Signature**
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "io-ts",
"version": "2.2.15",
"version": "2.2.16",
"description": "TypeScript runtime type system for IO decoding/encoding",
"main": "lib/index.js",
"module": "es6/index.js",
"typings": "lib/index.d.ts",
"sideEffects": false,
"scripts": {
"lint": "tslint -p tsconfig.tslint.json src/**/*.ts test/**/*.ts",
"lint": "tslint -p .",
"eslint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" \"scripts/**/*.ts\"",
"jest": "jest",
"prettier": "prettier --no-semi --single-quote --print-width 120 --parser typescript --list-different \"{src,test}/**/*.ts\"",
Expand Down
6 changes: 6 additions & 0 deletions src/Codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ export function lazy<I, O, A>(id: string, f: () => Codec<I, O, A>): Codec<I, O,
return make(D.lazy(id, f), E.lazy(f))
}

/**
* @category combinators
* @since 2.2.16
*/
export const readonly: <I, O, A>(codec: Codec<I, O, A>) => Codec<I, O, Readonly<A>> = identity

/**
* @category combinators
* @since 2.2.8
Expand Down
6 changes: 6 additions & 0 deletions src/Encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ export function lazy<O, A>(f: () => Encoder<O, A>): Encoder<O, A> {
}
}

/**
* @category combinators
* @since 2.2.16
*/
export const readonly: <O, A>(decoder: Encoder<O, A>) => Encoder<O, Readonly<A>> = identity

// -------------------------------------------------------------------------------------
// non-pipeables
// -------------------------------------------------------------------------------------
Expand Down

0 comments on commit b88a20c

Please sign in to comment.