Skip to content

Commit 3fa77a2

Browse files
Merge pull request #168 from domdomegg/master
Provide response in map function
2 parents 9e7a548 + 2e45eae commit 3fa77a2

File tree

5 files changed

+12665
-52
lines changed

5 files changed

+12665
-52
lines changed

masala-parser.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export interface Response<T> {
294294
* Transform the response **in case of** success. Won't touch a Reject.
295295
* @param f
296296
*/
297-
map<Y>(f: (v: T) => Y): Response<Y>;
297+
map<Y>(f: (v: T, r: readonly this) => Y): Response<Y>;
298298

299299
/**
300300
* ```js
@@ -526,7 +526,7 @@ export interface IParser<T> {
526526
*
527527
* @param f
528528
*/
529-
map<Y>(f: (value: T) => Y): SingleParser<Y>;
529+
map<Y>(f: (value: T, response: readonly Response<T>) => Y): SingleParser<Y>;
530530

531531
/**
532532
* Create a new parser value *knowing* the current parsing value

0 commit comments

Comments
 (0)