-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed return type of sort function in .d.ts file from JSON to object
- Loading branch information
1 parent
25a1d96
commit 45e5551
Showing
3 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
~~~~ | ||
|
@@ -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) | ||
|
@@ -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) | ||
~~~~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters