Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support async functions #67

Closed
wessberg opened this issue Mar 25, 2018 · 1 comment · Fixed by #90
Closed

Doesn't support async functions #67

wessberg opened this issue Mar 25, 2018 · 1 comment · Fixed by #90

Comments

@wessberg
Copy link

wessberg commented Mar 25, 2018

Consider:

const objectHash = require("object-hash");
objectHash(async function foo () {}); // Error: Unknown object type "asyncfunction"

This breaks usage with untranspiled code (node v7.4.0 and above as well as any ES2017+ compatible browser)

I've added a PR: #68

@wessberg
Copy link
Author

Hi there! I'm not quite sure if you're joking or not, but I'm going to respond to your comment as if you're not.

(1) Are you implying that a function is a primitive value? Rest assured, functions are objects.

(2) If your definition of "object" is actually "object literal" (or "Plain Old JavaScript Object") and what you are saying is that this library should only concern itself with such, please remember that:
- Object property values can be any type
- ... Including functions, which this library already handles
- To compute a hash from an object literal, you have to take its' properties into account, wouldn't you say?

If what you are implying is that this library should only compute hashes on object literal, and only based on their identifier, then I must inform you that this library is far more intelligent and wider reaching than that.

In case your comment is a joke, well, here's a beer emoji: 🍺

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 a pull request may close this issue.

1 participant