Skip to content

Commit 45e5551

Browse files
committed
Bug Fix : changed sort return type
changed return type of sort function in .d.ts file from JSON to object
1 parent 25a1d96 commit 45e5551

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
[![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)
33
> Sorting a json object based on keys either ascending or descending & even recursively
44
5-
### Latest Changes
6-
- `v1.3.0`
7-
- Added support for Typescript
8-
### Example -
5+
### Latest Changes
6+
- Added support for Typescript
7+
### Example -
98
> Note : focus on **keys** not values
109
1110
~~~~
@@ -48,12 +47,14 @@ Output will be -
4847
- data : the json object to sort
4948
- sort :
5049
- true (default) : ascending sort , since it is default you can only call `json.sort(data)`
51-
- false : descending sort
50+
- false : descending sort
5251
> Note : the function assumes that you always provide a json object
5352
5453
+ The function work recursively and sort all the inner json objects too.
5554

5655
### Versions
56+
+ `v1.3.1`
57+
+ Bug Fix : Fixed type of parameter in sort function from JSON to object
5758

5859
+ `v1.3.0`
5960
+ Included support for typescript (added declaration file)
@@ -75,9 +76,10 @@ Output will be -
7576
7677
### Contact
7778

78-
+ Twitter - [@dawnimpulse](https://twitter.com/dawnimpulse)
79+
+ Twitter - [@dawnimpulse](https://twitter.com/dawnimpulse)
7980
8081

82+
8183

8284
### License (ISC)
8385
~~~~

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export declare function sort(data: JSON, sort: boolean): JSON;
1+
export declare function sort(data: object, sort: boolean): object;
22

3-
export declare function sort(data: JSON): JSON;
3+
export declare function sort(data: object): object;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-keys-sort",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Sorting a json object based on keys either ascending or descending & even recursively",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)