Skip to content

Commit

Permalink
Bug Fix : changed sort return type
Browse files Browse the repository at this point in the history
changed return type of sort function in .d.ts file from JSON to object
  • Loading branch information
DawnImpulse committed Dec 21, 2019
1 parent 25a1d96 commit 45e5551
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
[![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)
> Sorting a json object based on keys either ascending or descending & even recursively
### Latest Changes
- `v1.3.0`
- Added support for Typescript
### Example -
### Latest Changes
- Added support for Typescript
### Example -
> Note : focus on **keys** not values
~~~~
Expand Down Expand Up @@ -48,12 +47,14 @@ Output will be -
- data : the json object to sort
- sort :
- true (default) : ascending sort , since it is default you can only call `json.sort(data)`
- false : descending sort
- false : descending sort
> Note : the function assumes that you always provide a json object
+ The function work recursively and sort all the inner json objects too.

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

+ `v1.3.0`
+ Included support for typescript (added declaration file)
Expand All @@ -75,9 +76,10 @@ Output will be -
### Contact

+ Twitter - [@dawnimpulse](https://twitter.com/dawnimpulse)
+ Twitter - [@dawnimpulse](https://twitter.com/dawnimpulse)
+ Email - [[email protected]](mailto:[email protected])



### License (ISC)
~~~~
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export declare function sort(data: JSON, sort: boolean): JSON;
export declare function sort(data: object, sort: boolean): object;

export declare function sort(data: JSON): JSON;
export declare function sort(data: object): object;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-keys-sort",
"version": "1.3.0",
"version": "1.3.1",
"description": "Sorting a json object based on keys either ascending or descending & even recursively",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 45e5551

Please sign in to comment.