JamesEggers1 / luhn

A JavaScript module of the luhn algorithm for Credit Card Validation that works with both client-side JavaScript and Node.js
MIT License
52 stars 17 forks source link

Make browserify compatible #2

Closed bengourley closed 10 years ago

bengourley commented 10 years ago

With the existing check for the namespace on which to export, this module behaved badly when attempting use with browserify. Rather than export on the exports object, it would attach it to the global window.

This pull request switches around the check, looking for exports first, so that if both exports and window exist, the module contents are attached to exports.

JamesEggers1 commented 10 years ago

Thanks for the update.

bengourley commented 10 years ago

No probs, could you bump the version and publish to npm please?

JamesEggers1 commented 10 years ago

Updated to 1.0.6