Skip to content

Commit a53a60e

Browse files
committed
remove /lib prefix in docs
1 parent 061c3b7 commit a53a60e

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

Codec.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ You can build a new codec using the `make` helper
2323
**Example**
2424

2525
```ts
26-
import * as C from 'io-ts/lib/Codec'
27-
import * as D from 'io-ts/lib/Decoder'
28-
import * as E from 'io-ts/lib/Encoder'
29-
import { pipe } from 'fp-ts/lib/function'
26+
import * as C from 'io-ts/Codec'
27+
import * as D from 'io-ts/Decoder'
28+
import * as E from 'io-ts/Encoder'
29+
import { pipe } from 'fp-ts/function'
3030

3131
const decoder: D.Decoder<unknown, number> = pipe(
3232
D.string,

Decoder.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface Decoder<I, A> {
3535
A decoder representing `string` can be defined as
3636

3737
```ts
38-
import * as D from 'io-ts/lib/Decoder'
38+
import * as D from 'io-ts/Decoder'
3939

4040
export const string: D.Decoder<unknown, string> = {
4141
decode: (u) => (typeof u === 'string' ? D.success(u) : D.failure(u, 'string'))
@@ -45,7 +45,7 @@ export const string: D.Decoder<unknown, string> = {
4545
and we can use it as follows:
4646

4747
```ts
48-
import { isRight } from 'fp-ts/lib/Either'
48+
import { isRight } from 'fp-ts/Either'
4949

5050
console.log(isRight(string.decode('a'))) // => true
5151
console.log(isRight(string.decode(null))) // => false
@@ -54,8 +54,8 @@ console.log(isRight(string.decode(null))) // => false
5454
More generally the result of calling `decode` can be handled using [`fold`](https://gcanti.github.io/fp-ts/modules/Either.ts.html#fold) along with `pipe` (which is similar to the pipeline operator)
5555

5656
```ts
57-
import { pipe } from 'fp-ts/lib/pipeable'
58-
import { fold } from 'fp-ts/lib/Either'
57+
import { pipe } from 'fp-ts/pipeable'
58+
import { fold } from 'fp-ts/Either'
5959

6060
console.log(
6161
pipe(
@@ -289,7 +289,7 @@ const Bar: D.Decoder<unknown, Bar> = D.lazy('Bar', () =>
289289
The `refine` combinator allows to define refinements, for example a branded type
290290

291291
```ts
292-
import { pipe } from 'fp-ts/lib/function'
292+
import { pipe } from 'fp-ts/function'
293293

294294
export interface PositiveBrand {
295295
readonly Positive: unique symbol
@@ -311,8 +311,8 @@ console.log(isRight(Positive.decode(-1))) // => false
311311
The `parse` combinator is more powerful than `refine` in that you can change the output type
312312

313313
```ts
314-
import { pipe } from 'fp-ts/lib/function'
315-
import { isRight } from 'fp-ts/lib/Either'
314+
import { pipe } from 'fp-ts/function'
315+
import { isRight } from 'fp-ts/Either'
316316

317317
export const NumberFromString: D.Decoder<unknown, number> = pipe(
318318
D.string,
@@ -354,7 +354,7 @@ export interface Person extends D.TypeOf<typeof Person> {}
354354
# Built-in error reporter
355355

356356
```ts
357-
import { isLeft } from 'fp-ts/lib/Either'
357+
import { isLeft } from 'fp-ts/Either'
358358

359359
export const Person = D.type({
360360
name: D.string,

Encoder.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface Encoder<O, A> {
1818
An encoder representing a nullable value
1919

2020
```ts
21-
import * as E from 'io-ts/lib/Encoder'
21+
import * as E from 'io-ts/Encoder'
2222

2323
export function nullable<O, A>(or: E.Encoder<O, A>): E.Encoder<null | O, null | A> {
2424
return {

Eq.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Instances must satisfy the following laws:
2626
**Example**
2727

2828
```ts
29-
import { Eq } from 'fp-ts/lib/Eq'
29+
import { Eq } from 'fp-ts/Eq'
3030

3131
export const string: Eq<string> = {
3232
equals: (x, y) => x === y
@@ -57,7 +57,7 @@ export const string: Eq<string> = {
5757
**Example**
5858

5959
```ts
60-
import * as E from 'io-ts/lib/Eq'
60+
import * as E from 'io-ts/Eq'
6161

6262
const Person = E.type({
6363
name: E.string,

Schema.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export interface Schema<A> {
1919
**Example**
2020

2121
```ts
22-
import * as D from 'io-ts/lib/Decoder'
23-
import * as Eq from 'io-ts/lib/Eq'
24-
import * as G from 'io-ts/lib/Guard'
25-
import * as S from 'io-ts/lib/Schema'
26-
import * as TD from 'io-ts/lib/TaskDecoder'
22+
import * as D from 'io-ts/Decoder'
23+
import * as Eq from 'io-ts/Eq'
24+
import * as G from 'io-ts/Guard'
25+
import * as S from 'io-ts/Schema'
26+
import * as TD from 'io-ts/TaskDecoder'
2727

2828
export const Person = S.make((S) =>
2929
S.type({
@@ -55,8 +55,8 @@ export type Int = number & IntBrand
5555
Now we must define a custom `MySchemable` type class containing a new member `Int`...
5656
5757
```ts
58-
import { Kind2, URIS2, HKT } from 'fp-ts/lib/HKT'
59-
import * as S from 'io-ts/lib/Schemable'
58+
import { Kind2, URIS2, HKT } from 'fp-ts/HKT'
59+
import * as S from 'io-ts/Schemable'
6060

6161
export interface MySchemable<S> extends S.Schemable<S> {
6262
readonly Int: HKT<S, Int>
@@ -82,7 +82,7 @@ export function make<A>(f: MySchema<A>): MySchema<A> {
8282
Finally we must define an instance of `MySchemable2C` for `Decoder` and an interpreter
8383

8484
```ts
85-
import * as D from 'io-ts/lib/Decoder'
85+
import * as D from 'io-ts/Decoder'
8686
import { pipe } from 'fp-ts/function'
8787

8888
export const mySchemable: MySchemable2C<D.URI> = {

index.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const string = new t.Type<string, string, unknown>(
9090
and we can use it as follows:
9191

9292
```ts
93-
import { isRight } from 'fp-ts/lib/Either'
93+
import { isRight } from 'fp-ts/Either'
9494

9595
isRight(string.decode('a string')) // true
9696
isRight(string.decode(null)) // false
@@ -100,8 +100,8 @@ More generally the result of calling `decode` can be handled using [`fold`](http
100100

101101
```ts
102102
import * as t from 'io-ts'
103-
import { pipe } from 'fp-ts/lib/pipeable'
104-
import { fold } from 'fp-ts/lib/Either'
103+
import { pipe } from 'fp-ts/pipeable'
104+
import { fold } from 'fp-ts/Either'
105105

106106
// failure handler
107107
const onLeft = (errors: t.Errors): string => `${errors.length} error(s) found`
@@ -195,7 +195,7 @@ This package exports a default `PathReporter` reporter
195195
Example
196196
197197
```ts
198-
import { PathReporter } from 'io-ts/lib/PathReporter'
198+
import { PathReporter } from 'io-ts/PathReporter'
199199

200200
const result = User.decode({ name: 'Giulio' })
201201

@@ -224,8 +224,8 @@ interface Errors extends Array<ValidationError> {}
224224
Example
225225
226226
```ts
227-
import { pipe } from 'fp-ts/lib/pipeable'
228-
import { fold } from 'fp-ts/lib/Either'
227+
import { pipe } from 'fp-ts/pipeable'
228+
import { fold } from 'fp-ts/Either'
229229

230230
const getPaths = <A>(v: t.Validation<A>): Array<string> => {
231231
return pipe(
@@ -247,7 +247,7 @@ You can set your own error message by providing a `message` argument to `failure
247247
Example
248248
249249
```ts
250-
import { either } from 'fp-ts/lib/Either'
250+
import { either } from 'fp-ts/Either'
251251

252252
const NumberFromString = new t.Type<number, string, unknown>(
253253
'NumberFromString',
@@ -434,7 +434,7 @@ type PartialUser = {
434434
You can define your own types. Let's see an example
435435
436436
```ts
437-
import { either } from 'fp-ts/lib/Either'
437+
import { either } from 'fp-ts/Either'
438438

439439
// represents a Date from an ISO string
440440
const DateFromString = new t.Type<Date, string, unknown>(

0 commit comments

Comments
 (0)