Skip to content

Conversation

@IronGeek
Copy link

Hi, There!

This PR add support for passing the time argument as BigInt.

AS IS, when trying to pass a BigInt to pretty-time, for example:

const start = process.hrtime.bigint();
prettyTime(process.hrtime.bigint() - start);

Would result in:

TypeError: Cannot mix BigInt and other types, use explicit conversions
    at module.exports (pretty-time/index.js:32:19)

This PR resolves the above issue by first converting the BigInt value to the legacy process.hrtime() format ([number,number]) and then continue with the rest of formatting logic AS IS.

closes #2

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.

Support process.hrtime.bigint()

1 participant