File tree 5 files changed +15
-6
lines changed
5 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -493,8 +493,8 @@ const object = {
493
493
const value = Json .get (object , ' hello.world.value.hello' ) // 'Hello World!'
494
494
const undefinedValue = Json .get (object , ' hello.worlld.value.hello' ) // undefined
495
495
const defaultValue = Json .get (object , ' hello.worlld.value.hello' , ' Hi World!' ) // 'Hi World!'
496
- const fullObject = Json .get (object , ' * ' ) // Same as object { hello: { world: { value: { hello: 'Hello World!' } } } }
497
- const defaultValueInObjectNull = Json .get (undefined , ' * ' , { hello: ' world' }) // { hello: 'world' }
496
+ const fullObject = Json .get (object , ' ' ) // Same as object { hello: { world: { value: { hello: 'Hello World!' } } } }
497
+ const defaultValueInObjectNull = Json .get (undefined , ' ' , { hello: ' world' }) // { hello: 'world' }
498
498
```
499
499
500
500
---
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @secjs/utils" ,
3
- "version" : " 1.9.8 " ,
3
+ "version" : " 1.9.9 " ,
4
4
"description" : " Utils functions and classes for Node.js" ,
5
5
"license" : " MIT" ,
6
6
"author" : " João Lenon <lenon@athenna.io>" ,
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export class Json {
132
132
* @return {any|undefined }
133
133
*/
134
134
static get ( object , key , defaultValue ) {
135
- if ( key === '* ' && object ) {
135
+ if ( key === '' && object ) {
136
136
return object
137
137
}
138
138
Original file line number Diff line number Diff line change @@ -30,6 +30,15 @@ test.group('ConfigTest', group => {
30
30
await Folder . safeRemove ( Path . config ( ) )
31
31
} )
32
32
33
+ test ( 'should be able to get full configurations values from Config class' , ( { assert } ) => {
34
+ const app = Config . get ( 'app' )
35
+
36
+ assert . deepEqual ( app , {
37
+ name : 'SecJS' ,
38
+ env : 'test' ,
39
+ } )
40
+ } )
41
+
33
42
test ( 'should be able to get configurations values from Config class' , ( { assert } ) => {
34
43
const appName = Config . get ( 'app.name' )
35
44
Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ test.group('Json Class', () => {
108
108
const value = Json . get ( object , 'hello.world.value.hello' )
109
109
const undefinedValue = Json . get ( object , 'hello.worlld.value.hello' )
110
110
const defaultValue = Json . get ( object , 'hello.worlld.value.hello' , 'Hi World!' )
111
- const fullObject = Json . get ( object , '* ' )
112
- const defaultValueInObjectNull = Json . get ( undefined , '* ' , { hello : 'world' } )
111
+ const fullObject = Json . get ( object , '' )
112
+ const defaultValueInObjectNull = Json . get ( undefined , '' , { hello : 'world' } )
113
113
114
114
assert . equal ( value , 'Hello World!' )
115
115
assert . equal ( defaultValue , 'Hi World!' )
You can’t perform that action at this time.
0 commit comments