Skip to content

Commit b88a20c

Browse files
committed
version 2.2.16
1 parent c245666 commit b88a20c

File tree

6 files changed

+46
-2
lines changed

6 files changed

+46
-2
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
**Note**: Gaps between patch versions are faulty/broken releases.
1515
**Note**: A feature tagged as Experimental is in a high state of flux, you're at risk of it changing without notice.
1616

17+
# 2.2.16
18+
19+
Experimental modules require `fp-ts@^2.5.0`.
20+
21+
- **Experimental**
22+
- `Codec`
23+
- add `readonly` combinator (@gcanti)
24+
- `Encoder`
25+
- add `readonly` combinator (@gcanti)
26+
1727
# 2.2.15
1828

1929
- **Experimental**

docs/modules/Codec.ts.md

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Added in v2.2.3
3535
- [mapLeftWithInput](#mapleftwithinput)
3636
- [nullable](#nullable)
3737
- [partial](#partial)
38+
- [readonly](#readonly)
3839
- [record](#record)
3940
- [refine](#refine)
4041
- [struct](#struct)
@@ -237,6 +238,16 @@ export declare function partial<P extends Record<string, Codec<unknown, any, any
237238

238239
Added in v2.2.3
239240

241+
## readonly
242+
243+
**Signature**
244+
245+
```ts
246+
export declare const readonly: <I, O, A>(codec: Codec<I, O, A>) => Codec<I, O, Readonly<A>>
247+
```
248+
249+
Added in v2.2.16
250+
240251
## record
241252

242253
**Signature**

docs/modules/Encoder.ts.md

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Added in v2.2.3
3131
- [lazy](#lazy)
3232
- [nullable](#nullable)
3333
- [partial](#partial)
34+
- [readonly](#readonly)
3435
- [record](#record)
3536
- [struct](#struct)
3637
- [sum](#sum)
@@ -139,6 +140,16 @@ export declare function partial<P extends Record<string, Encoder<any, any>>>(
139140

140141
Added in v2.2.3
141142

143+
## readonly
144+
145+
**Signature**
146+
147+
```ts
148+
export declare const readonly: <O, A>(decoder: Encoder<O, A>) => Encoder<O, Readonly<A>>
149+
```
150+
151+
Added in v2.2.16
152+
142153
## record
143154

144155
**Signature**

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "io-ts",
3-
"version": "2.2.15",
3+
"version": "2.2.16",
44
"description": "TypeScript runtime type system for IO decoding/encoding",
55
"main": "lib/index.js",
66
"module": "es6/index.js",
77
"typings": "lib/index.d.ts",
88
"sideEffects": false,
99
"scripts": {
10-
"lint": "tslint -p tsconfig.tslint.json src/**/*.ts test/**/*.ts",
10+
"lint": "tslint -p .",
1111
"eslint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" \"scripts/**/*.ts\"",
1212
"jest": "jest",
1313
"prettier": "prettier --no-semi --single-quote --print-width 120 --parser typescript --list-different \"{src,test}/**/*.ts\"",

src/Codec.ts

+6
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ export function lazy<I, O, A>(id: string, f: () => Codec<I, O, A>): Codec<I, O,
304304
return make(D.lazy(id, f), E.lazy(f))
305305
}
306306

307+
/**
308+
* @category combinators
309+
* @since 2.2.16
310+
*/
311+
export const readonly: <I, O, A>(codec: Codec<I, O, A>) => Codec<I, O, Readonly<A>> = identity
312+
307313
/**
308314
* @category combinators
309315
* @since 2.2.8

src/Encoder.ts

+6
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ export function lazy<O, A>(f: () => Encoder<O, A>): Encoder<O, A> {
162162
}
163163
}
164164

165+
/**
166+
* @category combinators
167+
* @since 2.2.16
168+
*/
169+
export const readonly: <O, A>(decoder: Encoder<O, A>) => Encoder<O, Readonly<A>> = identity
170+
165171
// -------------------------------------------------------------------------------------
166172
// non-pipeables
167173
// -------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)