Skip to content

Commit

Permalink
Fix integer typo
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-dldc committed Oct 22, 2019
1 parent 47076b0 commit 07645b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ Chemin.matchExact(chemin, '/3.1415'); // { myNum: 3.1415 }

#### CheminParams.number(name)

> A interger using `parseInt(x, 10)`
> A integer using `parseInt(x, 10)`
```ts
const chemin = Chemin.create(CheminParams.interger('myInt'));
const chemin = Chemin.create(CheminParams.integer('myInt'));
Chemin.matchExact(chemin, '/42'); // { myInt: 42 }
```

Expand Down Expand Up @@ -214,7 +214,7 @@ Chemin.matchExact(chemin, '/'); // false
> Make any `CheminParams` optional
```ts
const chemin = Chemin.create(CheminParams.optional(CheminParams.interger('myInt')));
const chemin = Chemin.create(CheminParams.optional(CheminParams.integer('myInt')));
Chemin.matchExact(chemin, '/42'); // { myInt: { present: true, value: 42 } }
Chemin.matchExact(chemin, '/'); // { myInt: { present: false } }
```
Expand Down
2 changes: 1 addition & 1 deletion examples/optional.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Chemin, CheminParams } from '../dist';

const chemin = Chemin.create(CheminParams.optional(CheminParams.interger('myInt')));
const chemin = Chemin.create(CheminParams.optional(CheminParams.integer('myInt')));
console.log(Chemin.matchExact(chemin, '/42')); // { myInt: { present: true, value: 42 } }
console.log(Chemin.matchExact(chemin, '/')); // { myInt: { present: false } }
4 changes: 2 additions & 2 deletions src/CheminParams.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const CheminParams = {
number,
interger,
integer,
string,
constant,
optional,
Expand Down Expand Up @@ -49,7 +49,7 @@ function number<N extends string>(name: N): CheminParams<N, number> {
};
}

function interger<N extends string>(name: N): CheminParams<N, number> {
function integer<N extends string>(name: N): CheminParams<N, number> {
return {
name,
match: (value, ...rest) => {
Expand Down

0 comments on commit 07645b1

Please sign in to comment.