monocle-ts
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -16,2 +16,7 @@ # Changelog | ||
# 1.6.1 | ||
- **Polish** | ||
- Providing a `Refinement` to the `find` method of `Fold` will return the narrowed type (@Stouffi) | ||
# 1.6.0 | ||
@@ -18,0 +23,0 @@ |
@@ -8,6 +8,2 @@ import { HKT, URIS, URIS2, URIS3, Type, Type2, Type3 } from 'fp-ts/lib/HKT'; | ||
import { Predicate, Refinement } from 'fp-ts/lib/function'; | ||
/** | ||
* @internal | ||
*/ | ||
export declare const update: <O, K extends keyof O, A extends O[K]>(o: O, k: K, a: A) => O; | ||
export declare class Iso<S, A> { | ||
@@ -304,2 +300,3 @@ readonly get: (s: S) => A; | ||
/** find the first target of a Fold matching the predicate */ | ||
find<B extends A>(p: Refinement<A, B>): (s: S) => Option<B>; | ||
find(p: Predicate<A>): (s: S) => Option<A>; | ||
@@ -306,0 +303,0 @@ /** get the first target of a Fold */ |
@@ -630,5 +630,4 @@ "use strict"; | ||
}; | ||
/** find the first target of a Fold matching the predicate */ | ||
Fold.prototype.find = function (p) { | ||
return this.foldMapFirst(function (a) { return (p(a) ? Option_1.option.of(a) : Option_1.none); }); | ||
return this.foldMapFirst(Option_1.fromPredicate(p)); | ||
}; | ||
@@ -635,0 +634,0 @@ /** get the first target of a Fold */ |
{ | ||
"name": "monocle-ts", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "A porting of scala monocle library to TypeScript", | ||
@@ -5,0 +5,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78925
1101