Skip to content

Conversation

@Mallikarjun-0
Copy link

There is a possibility that the method profile of class Logger might return a boolean.

… possibility that the method might return a boolean.
@Mallikarjun-0
Copy link
Author

Hi @DABH, I think this PR got skipped because of its brevity.

Summary

This PR, fixes the return type hint of the method profile() of class Logger defined in logger.js. The current type hint for this method only has this impling Logger but profile() can also return boolean

Example:

const winston = require('winston');

const logger = winston.createLogger({
  level: 'info',
  format: winston.format.simple(),
  transports: [
    new winston.transports.Console()
  ]
});

var temp = logger.profile('test');
console.log(typeof temp);           // prints 'object' as 'Logger' is returned

setTimeout(() => {
  temp = logger.profile('test');
  console.log(typeof temp);         // prints 'boolean`
}, 1000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant