aboutsummaryrefslogtreecommitdiff
path: root/src/matcher/options.ts
diff options
context:
space:
mode:
authorHafeez2018-04-20 16:59:50 +0100
committerHafeez2018-04-20 16:59:50 +0100
commitafdfe914feb3082fca5f735524175916ef221cb7 (patch)
treea2bff440ae74024020e3a2d9443551d7103a6eac /src/matcher/options.ts
parentcommit for merge (diff)
parentFinalise CORS support with package corser (diff)
downloadmedicine-afdfe914feb3082fca5f735524175916ef221cb7.tar.gz
medicine-afdfe914feb3082fca5f735524175916ef221cb7.zip

asdas

Diffstat (limited to 'src/matcher/options.ts')
-rw-r--r--src/matcher/options.ts13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/matcher/options.ts b/src/matcher/options.ts
index 967a6f9..62e4985 100644
--- a/src/matcher/options.ts
+++ b/src/matcher/options.ts
@@ -15,20 +15,13 @@ export type Value =
const matchNoCurry:
(template: TemplateValue, value: Value | undefined) => boolean =
(template: TemplateValue, value: Value | undefined): boolean => {
- console.log("matchNoCurry()")
- console.log(template)
- console.log(value)
if (types.atom(template)) {
- console.log("atom")
return template === value;
} else if (types.function(template)) {
- console.log("function")
return template(value);
} else if (types.atom(value) || value === undefined) {
- console.log("atom2")
return false;
} else if (types.object(template)) {
- console.log("object")
return Object.keys(template)
.every((key: string): boolean => {
const v: Value | undefined = value[key];
@@ -41,11 +34,7 @@ const matchNoCurry:
// tslint:disable-next-line:typedef
export const match = (template: TemplateValue, value?: Value) => {
- console.log("match()")
- console.log(template)
- console.log(value)
if (value === undefined) {
- console.log("is undefined")
return matchNoCurry.bind(null, template);
}
return matchNoCurry(template, value);
@@ -96,7 +85,7 @@ export const array = (template: TemplateValue, values?: Value[]) => {
const m: Checker = types.function(template)
? template
: match.bind(null, template);
- return values.every(m); //
+ return values.every(m);
};
// tslint:disable-next-line:typedef