@@ -35,32 +35,27 @@ describe(isObjectKeyIn.name , () => {
3535 expect ( isObjectKeyIn ( CLASS , NUMBER ) ) . toBe ( TRUE ) ; // It does find getter number
3636 expect ( isObjectKeyIn ( CLASS , [ 5 , 1030405027 ] ) ) . toBe ( TRUE ) ;
3737 } ) ;
38-
3938 // string.
4039 it ( 'has string key' , ( ) => {
4140 expect ( isObjectKeyIn ( CLASS , 'surname' ) ) . toBe ( TRUE ) ;
4241 expect ( isObjectKeyIn ( CLASS , [ 'firstName' , 'surname' ] ) ) . toBe ( TRUE ) ;
4342 } ) ;
44-
4543 // symbol.
4644 it ( 'has getter symbol key' , ( ) => {
4745 // It does find getter symbol key
4846 expect ( isObjectKeyIn ( CLASS , SYMBOL_NUMBER ) ) . toBe ( TRUE ) ;
4947 expect ( isObjectKeyIn ( CLASS , SYMBOL_STRING ) ) . toBe ( TRUE ) ;
5048 expect ( isObjectKeyIn ( CLASS , [ SYMBOL_NUMBER , SYMBOL_STRING ] ) ) . toBe ( TRUE ) ;
5149 } ) ;
52-
5350 // mixed.
5451 it ( 'has string and number key' , ( ) => expect ( isObjectKeyIn ( CLASS , [ 1030405027 , 'firstName' , 'surname' ] ) ) . toBe ( TRUE ) ) ;
5552 } ) ;
5653 } ) ;
57-
5854 // ... function.
5955 describe ( `function` , ( ) => {
6056 it ( `FUNCTION` , ( ) => expect ( isObjectKeyIn ( FUNCTION , 'function' ) ) . toBe ( FALSE ) ) ;
6157 it ( `CLASS` , ( ) => expect ( isObjectKeyIn ( Class , 'function' ) ) . toBe ( FALSE ) ) ;
6258 } ) ;
63-
6459 // ... objects.
6560 describe ( 'object' , ( ) => {
6661 describe ( `OBJECT_ONE` , ( ) => {
@@ -71,22 +66,19 @@ describe(isObjectKeyIn.name , () => {
7166 expect ( isObjectKeyIn ( OBJECT_ONE , NUMBER ) ) . toBe ( TRUE ) ; // It doesn't find getter
7267 expect ( isObjectKeyIn ( OBJECT_ONE , [ 5 , 1030405027 ] ) ) . toBe ( TRUE ) ;
7368 } ) ;
74-
7569 // string.
7670 it ( 'has string key' , ( ) => {
7771 expect ( isObjectKeyIn ( OBJECT_ONE , 'key as string' ) ) . toBe ( TRUE ) ;
7872 expect ( isObjectKeyIn ( OBJECT_ONE , 'x' ) ) . toBe ( TRUE ) ;
7973 expect ( isObjectKeyIn ( OBJECT_ONE , STRING ) ) . toBe ( TRUE ) ;
8074 expect ( isObjectKeyIn ( OBJECT_ONE , [ 'key as string' , 'x' , STRING ] ) ) . toBe ( TRUE ) ;
8175 } ) ;
82-
8376 // symbol.
8477 it ( 'has symbol key' , ( ) => {
8578 expect ( isObjectKeyIn ( OBJECT_ONE , SYMBOL_NUMBER ) ) . toBe ( TRUE ) ;
8679 expect ( isObjectKeyIn ( OBJECT_ONE , SYMBOL_STRING ) ) . toBe ( TRUE ) ;
8780 expect ( isObjectKeyIn ( OBJECT_ONE , [ SYMBOL_NUMBER , SYMBOL_STRING ] ) ) . toBe ( TRUE ) ;
8881 } ) ;
89-
9082 // mixed.
9183 it ( 'has mixed key' , ( ) => {
9284 expect ( isObjectKeyIn ( OBJECT_ONE , [
@@ -102,48 +94,48 @@ describe(isObjectKeyIn.name , () => {
10294 } ) ;
10395 } ) ;
10496 } ) ;
105-
10697 // ... primitives.
10798 describe ( `primitive` , ( ) => {
10899 // bigint
109- describe ( `bigint` , ( ) => {
110- it ( `${ BIGINT } ` , ( ) => expect ( isObjectKeyIn ( BIGINT , 'bigint' ) ) . toBe ( FALSE ) ) ;
111- it ( `${ BIGINT_EXPECTATION } ` , ( ) => expect ( isObjectKeyIn ( BIGINT_INSTANCE , 'bigint' ) ) . toBe ( FALSE ) ) ;
112- } ) ;
113-
100+ describe ( `bigint` , ( ) => it ( `${ BIGINT } ` , ( ) => expect ( isObjectKeyIn ( BIGINT , 'bigint' ) ) . toBe ( FALSE ) ) ) ;
114101 // boolean
115102 describe ( `boolean` , ( ) => {
116103 it ( `${ TRUE } ` , ( ) => expect ( isObjectKeyIn ( TRUE , 'boolean' ) ) . toBe ( FALSE ) ) ;
117104 it ( `${ FALSE } ` , ( ) => expect ( isObjectKeyIn ( FALSE , 'boolean' ) ) . toBe ( FALSE ) ) ;
118- it ( `${ TRUE_EXPECTATION } ` , ( ) => expect ( isObjectKeyIn ( TRUE_INSTANCE , 'boolean' ) ) . toBe ( FALSE ) ) ;
119- it ( `${ FALSE_EXPECTATION } ` , ( ) => expect ( isObjectKeyIn ( FALSE_INSTANCE , 'boolean' ) ) . toBe ( FALSE ) ) ;
120105 } ) ;
121-
122106 // null
123107 it ( `${ NULL } ` , ( ) => expect ( isObjectKeyIn ( NULL , 'null' ) ) . toBe ( FALSE ) ) ;
124-
125108 // number
126109 describe ( `number` , ( ) => {
127110 it ( `${ NUMBER } ` , ( ) => expect ( isObjectKeyIn ( NUMBER , 'number' ) ) . toBe ( FALSE ) ) ;
128111 it ( `Number(${ NUMBER } )` , ( ) => expect ( isObjectKeyIn ( NUMBER_INSTANCE , 'number' ) ) . toBe ( FALSE ) ) ;
129- it ( `new Number(${ NUMBER } )` , ( ) => expect ( isObjectKeyIn ( NUMBER_NEW_INSTANCE , 'number' ) ) . toBe ( FALSE ) ) ;
130112 } ) ;
131-
132113 // string
133114 describe ( `string` , ( ) => {
134115 it ( `${ STRING } ` , ( ) => expect ( isObjectKeyIn ( STRING , 'string' ) ) . toBe ( FALSE ) ) ;
135116 it ( `String(${ STRING } )` , ( ) => expect ( isObjectKeyIn ( STRING_INSTANCE , 'string' ) ) . toBe ( FALSE ) ) ;
136- it ( `new String(${ STRING } )` , ( ) => expect ( isObjectKeyIn ( STRING_NEW_INSTANCE , 'string' ) ) . toBe ( FALSE ) ) ;
137117 } ) ;
138-
139118 // symbol
140119 describe ( `symbol` , ( ) => {
141120 it ( `Symbol(${ NUMBER } )` , ( ) => expect ( isObjectKeyIn ( SYMBOL_NUMBER , 'symbol' ) ) . toBe ( FALSE ) ) ;
142121 it ( `Symbol(${ STRING } )` , ( ) => expect ( isObjectKeyIn ( SYMBOL_STRING , 'symbol' ) ) . toBe ( FALSE ) ) ;
143122 } ) ;
144-
145123 // undefined
146124 it ( `${ UNDEFINED } ` , ( ) => expect ( isObjectKeyIn ( UNDEFINED , 'undefined' ) ) . toBe ( FALSE ) ) ;
125+ // ... object.
126+ describe ( `object` , ( ) => {
127+ // BigInt
128+ describe ( `BigInt` , ( ) => it ( `${ BIGINT_EXPECTATION } ` , ( ) => expect ( isObjectKeyIn ( BIGINT_INSTANCE , 'bigint' ) ) . toBe ( FALSE ) ) ) ;
129+ // Boolean
130+ describe ( `Boolean` , ( ) => {
131+ it ( `${ TRUE_EXPECTATION } ` , ( ) => expect ( isObjectKeyIn ( TRUE_INSTANCE , 'boolean' ) ) . toBe ( FALSE ) ) ;
132+ it ( `${ FALSE_EXPECTATION } ` , ( ) => expect ( isObjectKeyIn ( FALSE_INSTANCE , 'boolean' ) ) . toBe ( FALSE ) ) ;
133+ } ) ;
134+ // Number
135+ describe ( `Number` , ( ) => it ( `new Number(${ NUMBER } )` , ( ) => expect ( isObjectKeyIn ( NUMBER_NEW_INSTANCE , 'number' ) ) . toBe ( FALSE ) ) ) ;
136+ // String
137+ describe ( `String` , ( ) => it ( `new String(${ STRING } )` , ( ) => expect ( isObjectKeyIn ( STRING_NEW_INSTANCE , 'string' ) ) . toBe ( FALSE ) ) ) ;
138+ } ) ;
147139 } ) ;
148140 } ) ;
149141} ) ;
0 commit comments