File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 2
2
[ ![ Build Status] ( https://travis-ci.org/DawnImpulse/json-keys-sort.svg?branch=master )] ( https://travis-ci.org/DawnImpulse/json-keys-sort ) ![ wait-loop] ( https://img.shields.io/npm/dt/json-keys-sort.svg )
3
3
> Sorting a json object based on keys either ascending or descending & even recursively
4
4
5
- ### Latest Changes
6
- - ` v1.3.0 `
7
- - Added support for Typescript
8
- ### Example -
5
+ ### Latest Changes
6
+ - Added support for Typescript
7
+ ### Example -
9
8
> Note : focus on ** keys** not values
10
9
11
10
~~~~
@@ -48,12 +47,14 @@ Output will be -
48
47
- data : the json object to sort
49
48
- sort :
50
49
- true (default) : ascending sort , since it is default you can only call ` json.sort(data) `
51
- - false : descending sort
50
+ - false : descending sort
52
51
> Note : the function assumes that you always provide a json object
53
52
54
53
+ The function work recursively and sort all the inner json objects too.
55
54
56
55
### Versions
56
+ + ` v1.3.1 `
57
+ + Bug Fix : Fixed type of parameter in sort function from JSON to object
57
58
58
59
+ ` v1.3.0 `
59
60
+ Included support for typescript (added declaration file)
@@ -75,9 +76,10 @@ Output will be -
75
76
76
77
### Contact
77
78
78
- + Twitter - [ @dawnimpulse ] ( https://twitter.com/dawnimpulse )
79
+ + Twitter - [ @dawnimpulse ] ( https://twitter.com/dawnimpulse )
79
80
80
81
82
+
81
83
82
84
### License (ISC)
83
85
~~~~
Original file line number Diff line number Diff line change 1
- export declare function sort ( data : JSON , sort : boolean ) : JSON ;
1
+ export declare function sort ( data : object , sort : boolean ) : object ;
2
2
3
- export declare function sort ( data : JSON ) : JSON ;
3
+ export declare function sort ( data : object ) : object ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " json-keys-sort" ,
3
- "version" : " 1.3.0 " ,
3
+ "version" : " 1.3.1 " ,
4
4
"description" : " Sorting a json object based on keys either ascending or descending & even recursively" ,
5
5
"main" : " index.js" ,
6
6
"types" : " index.d.ts" ,
You can’t perform that action at this time.
0 commit comments