99 isBoolean ,
1010 isString ,
1111 isNumber ,
12+ isNumeric ,
1213 isPrimitive ,
1314 isDate ,
1415 isEvent ,
@@ -17,7 +18,7 @@ import {
1718} from './inspect'
1819
1920describe ( 'utils/inspect' , ( ) => {
20- it ( 'toType' , async ( ) => {
21+ it ( 'toType() ' , async ( ) => {
2122 expect ( toType ( 123 ) ) . toEqual ( 'number' )
2223 expect ( toType ( '123' ) ) . toEqual ( 'string' )
2324 expect ( toType ( true ) ) . toEqual ( 'boolean' )
@@ -31,7 +32,7 @@ describe('utils/inspect', () => {
3132 expect ( toType ( null ) ) . toEqual ( 'object' )
3233 } )
3334
34- it ( 'toRawType' , async ( ) => {
35+ it ( 'toRawType() ' , async ( ) => {
3536 expect ( toRawType ( 123 ) ) . toEqual ( 'Number' )
3637 expect ( toRawType ( '123' ) ) . toEqual ( 'String' )
3738 expect ( toRawType ( true ) ) . toEqual ( 'Boolean' )
@@ -45,7 +46,7 @@ describe('utils/inspect', () => {
4546 expect ( toRawType ( null ) ) . toEqual ( 'Null' )
4647 } )
4748
48- it ( 'toRawTypeLC' , async ( ) => {
49+ it ( 'toRawTypeLC() ' , async ( ) => {
4950 expect ( toRawTypeLC ( 123 ) ) . toEqual ( 'number' )
5051 expect ( toRawTypeLC ( '123' ) ) . toEqual ( 'string' )
5152 expect ( toRawTypeLC ( true ) ) . toEqual ( 'boolean' )
@@ -59,7 +60,7 @@ describe('utils/inspect', () => {
5960 expect ( toRawTypeLC ( null ) ) . toEqual ( 'null' )
6061 } )
6162
62- it ( 'isUndefined' , async ( ) => {
63+ it ( 'isUndefined() ' , async ( ) => {
6364 expect ( isUndefined ( 123 ) ) . toEqual ( false )
6465 expect ( isUndefined ( '123' ) ) . toEqual ( false )
6566 expect ( isUndefined ( true ) ) . toEqual ( false )
@@ -73,7 +74,7 @@ describe('utils/inspect', () => {
7374 expect ( isUndefined ( null ) ) . toEqual ( false )
7475 } )
7576
76- it ( 'isNull' , async ( ) => {
77+ it ( 'isNull() ' , async ( ) => {
7778 expect ( isNull ( 123 ) ) . toEqual ( false )
7879 expect ( isNull ( '123' ) ) . toEqual ( false )
7980 expect ( isNull ( true ) ) . toEqual ( false )
@@ -87,7 +88,7 @@ describe('utils/inspect', () => {
8788 expect ( isNull ( null ) ) . toEqual ( true )
8889 } )
8990
90- it ( 'isUndefinedOrNull' , async ( ) => {
91+ it ( 'isUndefinedOrNull() ' , async ( ) => {
9192 expect ( isUndefinedOrNull ( 123 ) ) . toEqual ( false )
9293 expect ( isUndefinedOrNull ( '123' ) ) . toEqual ( false )
9394 expect ( isUndefinedOrNull ( true ) ) . toEqual ( false )
@@ -101,7 +102,7 @@ describe('utils/inspect', () => {
101102 expect ( isUndefinedOrNull ( null ) ) . toEqual ( true )
102103 } )
103104
104- it ( 'isFunction' , async ( ) => {
105+ it ( 'isFunction() ' , async ( ) => {
105106 expect ( isFunction ( 123 ) ) . toEqual ( false )
106107 expect ( isFunction ( '123' ) ) . toEqual ( false )
107108 expect ( isFunction ( true ) ) . toEqual ( false )
@@ -115,7 +116,7 @@ describe('utils/inspect', () => {
115116 expect ( isFunction ( null ) ) . toEqual ( false )
116117 } )
117118
118- it ( 'isBoolean' , async ( ) => {
119+ it ( 'isBoolean() ' , async ( ) => {
119120 expect ( isBoolean ( 123 ) ) . toEqual ( false )
120121 expect ( isBoolean ( '123' ) ) . toEqual ( false )
121122 expect ( isBoolean ( true ) ) . toEqual ( true )
@@ -129,7 +130,7 @@ describe('utils/inspect', () => {
129130 expect ( isBoolean ( null ) ) . toEqual ( false )
130131 } )
131132
132- it ( 'isString' , async ( ) => {
133+ it ( 'isString() ' , async ( ) => {
133134 expect ( isString ( 123 ) ) . toEqual ( false )
134135 expect ( isString ( '123' ) ) . toEqual ( true )
135136 expect ( isString ( true ) ) . toEqual ( false )
@@ -143,8 +144,9 @@ describe('utils/inspect', () => {
143144 expect ( isString ( null ) ) . toEqual ( false )
144145 } )
145146
146- it ( 'isNumber' , async ( ) => {
147+ it ( 'isNumber() ' , async ( ) => {
147148 expect ( isNumber ( 123 ) ) . toEqual ( true )
149+ expect ( isNumber ( 123.5 ) ) . toEqual ( true )
148150 expect ( isNumber ( '123' ) ) . toEqual ( false )
149151 expect ( isNumber ( true ) ) . toEqual ( false )
150152 expect ( isNumber ( { } ) ) . toEqual ( false )
@@ -157,7 +159,24 @@ describe('utils/inspect', () => {
157159 expect ( isNumber ( null ) ) . toEqual ( false )
158160 } )
159161
160- it ( 'isPrimitive' , async ( ) => {
162+ it ( 'isNumeric()' , async ( ) => {
163+ expect ( isNumeric ( 123 ) ) . toEqual ( true )
164+ expect ( isNumeric ( 123.5 ) ) . toEqual ( true )
165+ expect ( isNumeric ( '123' ) ) . toEqual ( true )
166+ expect ( isNumeric ( '123.5' ) ) . toEqual ( true )
167+ expect ( isNumeric ( '123,5' ) ) . toEqual ( false )
168+ expect ( isNumeric ( true ) ) . toEqual ( false )
169+ expect ( isNumeric ( { } ) ) . toEqual ( false )
170+ expect ( isNumeric ( [ ] ) ) . toEqual ( false )
171+ expect ( isNumeric ( / a b c / ) ) . toEqual ( false )
172+ expect ( isNumeric ( ( ) => { } ) ) . toEqual ( false )
173+ expect ( isNumeric ( Date ) ) . toEqual ( false )
174+ expect ( isNumeric ( new Date ( ) ) ) . toEqual ( false )
175+ expect ( isNumeric ( undefined ) ) . toEqual ( false )
176+ expect ( isNumeric ( null ) ) . toEqual ( false )
177+ } )
178+
179+ it ( 'isPrimitive()' , async ( ) => {
161180 expect ( isPrimitive ( 123 ) ) . toEqual ( true )
162181 expect ( isPrimitive ( '123' ) ) . toEqual ( true )
163182 expect ( isPrimitive ( true ) ) . toEqual ( true )
@@ -171,7 +190,7 @@ describe('utils/inspect', () => {
171190 expect ( isPrimitive ( null ) ) . toEqual ( false )
172191 } )
173192
174- it ( 'isDate' , async ( ) => {
193+ it ( 'isDate() ' , async ( ) => {
175194 expect ( isDate ( 123 ) ) . toEqual ( false )
176195 expect ( isDate ( '123' ) ) . toEqual ( false )
177196 expect ( isDate ( true ) ) . toEqual ( false )
@@ -185,7 +204,7 @@ describe('utils/inspect', () => {
185204 expect ( isDate ( null ) ) . toEqual ( false )
186205 } )
187206
188- it ( 'isEvent' , async ( ) => {
207+ it ( 'isEvent() ' , async ( ) => {
189208 expect ( isEvent ( 123 ) ) . toEqual ( false )
190209 expect ( isEvent ( '123' ) ) . toEqual ( false )
191210 expect ( isEvent ( true ) ) . toEqual ( false )
@@ -201,7 +220,7 @@ describe('utils/inspect', () => {
201220 expect ( isEvent ( null ) ) . toEqual ( false )
202221 } )
203222
204- it ( 'isRegExp' , async ( ) => {
223+ it ( 'isRegExp() ' , async ( ) => {
205224 expect ( isRegExp ( 123 ) ) . toEqual ( false )
206225 expect ( isRegExp ( '123' ) ) . toEqual ( false )
207226 expect ( isRegExp ( true ) ) . toEqual ( false )
@@ -215,7 +234,7 @@ describe('utils/inspect', () => {
215234 expect ( isRegExp ( null ) ) . toEqual ( false )
216235 } )
217236
218- it ( 'isPromise' , async ( ) => {
237+ it ( 'isPromise() ' , async ( ) => {
219238 expect ( isPromise ( 123 ) ) . toEqual ( false )
220239 expect ( isPromise ( '123' ) ) . toEqual ( false )
221240 expect ( isPromise ( true ) ) . toEqual ( false )
0 commit comments