-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add typeof utility #1648
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
Add typeof utility #1648
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1648 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 101
Lines ? 1851
Branches ? 0
==========================================
Hits ? 1851
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! Will be helpful in many places 👍
assert.strictEqual(typeOf(null), 'null'); | ||
assert.strictEqual(typeOf({}), 'object'); | ||
assert.strictEqual(typeOf(new Date()), 'date'); | ||
assert.strictEqual(typeOf('ezkemboi'), 'string'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, could you add one more test for String('kemboi')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the test @profnandaa
71d5a3a
to
3808d4c
Compare
I will try to identify the areas that this can help and see if I can create PR making those necessary changes. Cc. @profnandaa and @tux-tn |
What I have done
I.e type of {} == 'object' and type of null == 'null'
and not that all areobject
.