Skip to content

Commit

Permalink
version 2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Jan 6, 2021
1 parent d32a4d5 commit 2cbd238
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
**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.3.4

- **Experimental**
- `Lens`, `Prism`, `Optional`: add `Refinement` overload to `findFirst`, #148 (@wmaurer)

# 2.3.3

- **Experimental**
Expand Down
5 changes: 4 additions & 1 deletion docs/modules/Lens.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ Added in v2.3.0
**Signature**

```ts
export declare const findFirst: <A>(predicate: Predicate<A>) => <S>(sa: Lens<S, readonly A[]>) => Optional<S, A>
export declare function findFirst<A, B extends A>(
refinement: Refinement<A, B>
): <S>(sa: Lens<S, ReadonlyArray<A>>) => Optional<S, B>
export declare function findFirst<A>(predicate: Predicate<A>): <S>(sa: Lens<S, ReadonlyArray<A>>) => Optional<S, A>
```

Added in v2.3.2
Expand Down
5 changes: 4 additions & 1 deletion docs/modules/Optional.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ Added in v2.3.0
**Signature**

```ts
export declare const findFirst: <A>(predicate: Predicate<A>) => <S>(sa: Optional<S, readonly A[]>) => Optional<S, A>
export declare function findFirst<A, B extends A>(
refinement: Refinement<A, B>
): <S>(sa: Optional<S, ReadonlyArray<A>>) => Optional<S, B>
export declare function findFirst<A>(predicate: Predicate<A>): <S>(sa: Optional<S, ReadonlyArray<A>>) => Optional<S, A>
```

Added in v2.3.2
Expand Down
5 changes: 4 additions & 1 deletion docs/modules/Prism.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ Added in v2.3.0
**Signature**

```ts
export declare const findFirst: <A>(predicate: Predicate<A>) => <S>(sa: Prism<S, readonly A[]>) => Optional<S, A>
export declare function findFirst<A, B extends A>(
refinement: Refinement<A, B>
): <S>(sa: Prism<S, ReadonlyArray<A>>) => Optional<S, B>
export declare function findFirst<A>(predicate: Predicate<A>): <S>(sa: Prism<S, ReadonlyArray<A>>) => Optional<S, A>
```

Added in v2.3.2
Expand Down
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monocle-ts",
"version": "2.3.3",
"version": "2.3.4",
"description": "A porting of scala monocle library to TypeScript",
"files": [
"lib",
Expand Down Expand Up @@ -54,7 +54,7 @@
"ts-node": "^8.0.2",
"tslint": "^5.12.1",
"tslint-config-standard": "^8.0.1",
"typescript": "^3.9.5"
"typescript": "^4.1.3"
},
"tags": [
"typescript",
Expand Down
2 changes: 1 addition & 1 deletion src/Lens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export function findFirst<A, B extends A>(
): <S>(sa: Lens<S, ReadonlyArray<A>>) => Optional<S, B>
export function findFirst<A>(predicate: Predicate<A>): <S>(sa: Lens<S, ReadonlyArray<A>>) => Optional<S, A>
export function findFirst<A>(predicate: Predicate<A>): <S>(sa: Lens<S, ReadonlyArray<A>>) => Optional<S, A> {
return flow(_.findFirst, composeOptional)(predicate)
return composeOptional(_.findFirst(predicate))
}

// -------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Optional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export function findFirst<A, B extends A>(
): <S>(sa: Optional<S, ReadonlyArray<A>>) => Optional<S, B>
export function findFirst<A>(predicate: Predicate<A>): <S>(sa: Optional<S, ReadonlyArray<A>>) => Optional<S, A>
export function findFirst<A>(predicate: Predicate<A>): <S>(sa: Optional<S, ReadonlyArray<A>>) => Optional<S, A> {
return flow(_.findFirst, compose)(predicate)
return compose(_.findFirst(predicate))
}

// -------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Prism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export function findFirst<A, B extends A>(
): <S>(sa: Prism<S, ReadonlyArray<A>>) => Optional<S, B>
export function findFirst<A>(predicate: Predicate<A>): <S>(sa: Prism<S, ReadonlyArray<A>>) => Optional<S, A>
export function findFirst<A>(predicate: Predicate<A>): <S>(sa: Prism<S, ReadonlyArray<A>>) => Optional<S, A> {
return flow(_.findFirst, composeOptional)(predicate)
return composeOptional(_.findFirst(predicate))
}

// -------------------------------------------------------------------------------------
Expand Down

0 comments on commit 2cbd238

Please sign in to comment.