mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-17 12:16:38 +08:00
16 lines
272 B
TypeScript
16 lines
272 B
TypeScript
import pLog = require('p-log');
|
|
|
|
Promise.resolve('unicorn')
|
|
.then(pLog())
|
|
.then(val => {
|
|
val; // $ExpectType string
|
|
});
|
|
|
|
Promise.resolve()
|
|
.then(() => {
|
|
throw new Error('pony');
|
|
})
|
|
.catch(pLog.catch())
|
|
.catch(error => {
|
|
});
|