From 45e5551d94f848d7dbfc15aebeb15eb41bb5e8c2 Mon Sep 17 00:00:00 2001 From: Saksham Khurana Date: Sat, 21 Dec 2019 13:30:22 +0530 Subject: [PATCH] Bug Fix : changed sort return type changed return type of sort function in .d.ts file from JSON to object --- README.md | 14 ++++++++------ index.d.ts | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ce0e3fd..b0bc5b8 100644 --- a/README.md +++ b/README.md @@ -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 - [dawnimpulse@gmail.com](mailto:dawnimpulse@gmail.com) + ### License (ISC) ~~~~ diff --git a/index.d.ts b/index.d.ts index 5693a1d..9be7f15 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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; \ No newline at end of file +export declare function sort(data: object): object; \ No newline at end of file diff --git a/package.json b/package.json index b431b80..3b5acac 100644 --- a/package.json +++ b/package.json @@ -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",