Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

feat(both-like): allow variadic predicate #91

Merged
merged 1 commit into from
Aug 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions snapshots/allPass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Predicate } from '../ramda/dist/src/$types';
import * as R_allPass from '../ramda/dist/src/allPass';

declare const string_predicate: Predicate<string>;
declare const number_preficate: Predicate<number>;
declare const string_number_preficate: (x: string, y: number) => boolean;

// @dts-jest:pass -> (value: string) => boolean
R_allPass([string_predicate, string_predicate]);
// @dts-jest:pass -> (value: string | number) => boolean
R_allPass<string | number>([string_predicate, number_preficate]);
// @dts-jest:pass -> (x: string, y: number) => boolean
R_allPass([string_predicate, string_number_preficate]);
6 changes: 3 additions & 3 deletions snapshots/anyPass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Predicate } from '../ramda/dist/src/$types';
import * as R_anyPass from '../ramda/dist/src/anyPass';

declare const string_predicate: Predicate<string>;
declare const number_preficate: Predicate<number>;
declare const string_number_preficate: (x: string, y: number) => boolean;

// @dts-jest:pass -> (value: string) => boolean
R_anyPass([string_predicate, string_predicate]);
// @dts-jest:pass -> (value: string | number) => boolean
R_anyPass<string | number>([string_predicate, number_preficate]);
// @dts-jest:pass -> (x: string, y: number) => boolean
R_anyPass([string_predicate, string_number_preficate]);
4 changes: 2 additions & 2 deletions templates/allPass.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Predicate } from './$types';
import { Variadic } from './$types';

export function $<T>(fns: Predicate<T>[]): Predicate<T>;
export function $<F extends Variadic<boolean>>(fns: F[]): F;
4 changes: 2 additions & 2 deletions templates/anyPass.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Predicate } from './$types';
import { Variadic } from './$types';

export function $<T>(fns: Predicate<T>[]): Predicate<T>;
export function $<F extends Variadic<boolean>>(fns: F[]): F;
4 changes: 2 additions & 2 deletions templates/both.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Predicate } from './$types';
import { Variadic } from './$types';

export function $<T>(fn1: Predicate<T>, fn2: Predicate<T>): Predicate<T>;
export function $<F extends Variadic<boolean>>(fn1: F, fn2: F): F;
4 changes: 2 additions & 2 deletions templates/either.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Predicate } from './$types';
import { Variadic } from './$types';

export function $<T>(fn1: Predicate<T>, fn2: Predicate<T>): Predicate<T>;
export function $<F extends Variadic<boolean>>(fn1: F, fn2: F): F;
4 changes: 2 additions & 2 deletions tests/__snapshots__/allPass.ts.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`R_allPass([string_predicate, string_predicate]) 1`] = `"(value: string) => boolean"`;
exports[`R_allPass([string_predicate, string_number_preficate]) 1`] = `"(x: string, y: number) => boolean"`;

exports[`R_allPass<string | number>([string_predicate, number_preficate]) 1`] = `"(value: string | number) => boolean"`;
exports[`R_allPass([string_predicate, string_predicate]) 1`] = `"(value: string) => boolean"`;
4 changes: 2 additions & 2 deletions tests/__snapshots__/anyPass.ts.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`R_anyPass([string_predicate, string_predicate]) 1`] = `"(value: string) => boolean"`;
exports[`R_anyPass([string_predicate, string_number_preficate]) 1`] = `"(x: string, y: number) => boolean"`;

exports[`R_anyPass<string | number>([string_predicate, number_preficate]) 1`] = `"(value: string | number) => boolean"`;
exports[`R_anyPass([string_predicate, string_predicate]) 1`] = `"(value: string) => boolean"`;
4 changes: 2 additions & 2 deletions tests/allPass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Predicate } from '../ramda/dist/src/$types';
import * as R_allPass from '../ramda/dist/src/allPass';

declare const string_predicate: Predicate<string>;
declare const number_preficate: Predicate<number>;
declare const string_number_preficate: (x: string, y: number) => boolean;

// @dts-jest:pass
R_allPass([string_predicate, string_predicate]);
// @dts-jest:pass
R_allPass<string | number>([string_predicate, number_preficate]);
R_allPass([string_predicate, string_number_preficate]);
4 changes: 2 additions & 2 deletions tests/anyPass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Predicate } from '../ramda/dist/src/$types';
import * as R_anyPass from '../ramda/dist/src/anyPass';

declare const string_predicate: Predicate<string>;
declare const number_preficate: Predicate<number>;
declare const string_number_preficate: (x: string, y: number) => boolean;

// @dts-jest:pass
R_anyPass([string_predicate, string_predicate]);
// @dts-jest:pass
R_anyPass<string | number>([string_predicate, number_preficate]);
R_anyPass([string_predicate, string_number_preficate]);