aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Harley2018-02-07 12:22:49 +0000
committerTom Harley2018-02-07 12:22:49 +0000
commit79b80371d94e258c2cc1eeee41625ccc212369f6 (patch)
treeccaf108dbfe237ed727710b410ef231ad6f93513
parentcurried option functions (diff)
downloadmedicine-79b80371d94e258c2cc1eeee41625ccc212369f6.tar.gz
medicine-79b80371d94e258c2cc1eeee41625ccc212369f6.zip

removed types from options.ts to remove ts-node ambiguity

-rw-r--r--src/matcher/options.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/matcher/options.ts b/src/matcher/options.ts
index 1ffa24e..b356c7b 100644
--- a/src/matcher/options.ts
+++ b/src/matcher/options.ts
@@ -1,9 +1,6 @@
import { default as types } from './types';
-type matchType<T = any>
- = (boolean | ((T) => boolean));
-
-export function match(template: Object, value?: Object): matchType<Object> {
+export function match(template: Object, value?: Object) {
if (value === undefined) {
return match.bind(null, template);
}
@@ -16,7 +13,7 @@ export function match(template: Object, value?: Object): matchType<Object> {
return true;
}
-export function exact(template: Object, value?: Object): matchType<Object> {
+export function exact(template: Object, value?: Object) {
if (value === undefined) {
return exact.bind(null, template);
}
@@ -28,7 +25,7 @@ export function exact(template: Object, value?: Object): matchType<Object> {
&& k2.every((x) => k1.indexOf(x) < 0);
}
-export function optional(template: Function, value?: any): matchType<any> {
+export function optional(template: Function, value?: any) {
if (value === undefined) {
return optional.bind(null, template);
}
@@ -37,7 +34,7 @@ export function optional(template: Function, value?: any): matchType<any> {
|| template(value);
}
-export function alternative(templates: any[], value?: any): matchType<any> {
+export function alternative(templates: any[], value?: any) {
if (value === undefined) {
return alternative.bind(null, templates);
}
@@ -58,8 +55,7 @@ export function alternative(templates: any[], value?: any): matchType<any> {
}
}
-export function array(template: Object, values?: Array<Object>):
-matchType<Array<Object>> {
+export function array(template: Object, values?: Array<Object>) {
if (values === undefined) {
return array.bind(null, template);
}