From 3ac0f658bd5f74e18d5fe16ca8e52bd9dfc459d9 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Tue, 16 Feb 2016 16:35:04 -0600 Subject: [PATCH] Parser#check(...) is a chainable function, just like all the others --- optimist/optimist-tests.ts | 2 +- optimist/optimist.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/optimist/optimist-tests.ts b/optimist/optimist-tests.ts index 2fe670cbf6..feaa3d6f7d 100644 --- a/optimist/optimist-tests.ts +++ b/optimist/optimist-tests.ts @@ -35,7 +35,7 @@ parser = parser.options({}); parser = parser.usage(str); -parser.check(checkFn); +parser = parser.check(checkFn); parser = parser.boolean(str); parser = parser.boolean([str]); diff --git a/optimist/optimist.d.ts b/optimist/optimist.d.ts index 7393190bd4..c2783b9b63 100644 --- a/optimist/optimist.d.ts +++ b/optimist/optimist.d.ts @@ -60,7 +60,7 @@ declare module "optimist" { /** Check that certain conditions are met in the provided arguments. If fn throws or returns false, show the thrown error, usage information, and exit. */ - check(fn: (argv: any) => any): void; + check(fn: (argv: any) => any): Parser; /** Interpret key as a boolean. If a non-flag option follows key in process.argv, that string won't get set as the value of key. If key never shows up as a