return result with input, if prescribed

This commit is contained in:
AJ ONeal 2017-03-21 00:46:48 -06:00
parent 22e0c904e0
commit 66d46eab32
2 changed files with 3 additions and 2 deletions

View File

@ -41,11 +41,12 @@ The follow options may also be specified:
// 4. check the most recent character, if desired
// 5. normalize the input if desired (i.e. John.Doe@GMail.com -> john.doe@gmail.com)
// (or return something else entirely)
// You can error out
// return form.PromiseA.reject(new Error("[X] This isn't an email address: no '@'"));
return input.toLowerCase();
return input.toLowerCase(); // will be returned as `result` alongside `input`
}

View File

@ -233,7 +233,7 @@ var form = {
var input = ws._input.join('');
ws._input = [];
ws._inputIndex = 0;
resolve({ input: normalInput || input });
resolve({ input: input, result: normalInput });
}, function (err) {
rrs.on('data', onData);