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

refactoring regexp-pick #1

Merged
merged 1 commit into from
Feb 10, 2015
Merged

refactoring regexp-pick #1

merged 1 commit into from
Feb 10, 2015

Conversation

stoeffel
Copy link

In my opinion this is much simpler to read.

refs tjmehta/pull/55

function isRegExp (obj) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could even be a seperat module.
@tjmehta what do you think?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering this too.

Out of curiosity, what is the difference between this and obj instanceof RegExp?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case using instanceof would be okay. It's only a problem if you have different contexts(windows). See i.e. expressjs/express#1557

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the instanceof explanation and the refactor, this is much easier to read. Something I need to improve on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem :bowtie:

tristaaan added a commit that referenced this pull request Feb 10, 2015
@tristaaan tristaaan merged commit eec0d12 into tristaaan:regexp-pick Feb 10, 2015
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.

2 participants