Skip to content

Commit

Permalink
fix lensSatisfies
Browse files Browse the repository at this point in the history
  • Loading branch information
selfrefactor committed May 3, 2024
1 parent db20844 commit 0feada4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions files/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7758,10 +7758,10 @@ Notes: Idea for this method comes from `ramda-adjunct` library
*/
// @SINGLE_MARKER
export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens, input: U): boolean;
export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens): (input: U) => boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens, input: T[]): boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens): (input: T[]) => boolean;
export function lensSatisfies<PredicateInput, Input>(predicate: (x: PredicateInput) => boolean, lens: Lens<PredicateInput, Input>, input: Input): boolean;
export function lensSatisfies<PredicateInput, Input>(predicate: (x: PredicateInput) => boolean, lens: Lens<PredicateInput, Input>): (input: Input) => boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens<T[], T>, input: T[]): boolean;
export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens<T[], T>): (input: T[]) => boolean;

/*
Method: viewOr
Expand Down
6 changes: 3 additions & 3 deletions source/lensSatisfies-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {lensSatisfies, lensIndex, lensPath} from 'rambda'
describe('R.lensSatisfies', () => {
it('with list', () => {
const list = [1, 2, 3]
const lens = lensIndex(0)
const lens = lensIndex<number>(0)
const predicate = (x: number) => x > 2
const result = lensSatisfies<number>(predicate, lens, list)
const result = lensSatisfies(predicate, lens, list)
result // $ExpectType boolean

const curriedResult = lensSatisfies<number>(predicate, lens)(list)
const curriedResult = lensSatisfies(predicate, lens)(list)
curriedResult // $ExpectType boolean
})
it('with object', () => {
Expand Down

0 comments on commit 0feada4

Please sign in to comment.