Skip to content

Commit

Permalink
Merge pull request #46 from harpreetkhalsagtbit/release-v2.0.0
Browse files Browse the repository at this point in the history
Release v2.0.0
  • Loading branch information
harpreetkhalsagtbit authored Jan 5, 2021
2 parents 6cbd66d + 3f2ada6 commit 9ffda0a
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 62 deletions.
112 changes: 74 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For any data related issue, you can raise a Issue [here](https://github.com/dr5h

# Usage

## Latest Release : `v1.0.0` (First Major Version Release - Not backward compatible)
## Latest Release : `v2.0.0` (First Major Version Release - Not backward compatible)
- ES6 Module usage

```js
Expand Down Expand Up @@ -51,11 +51,23 @@ It accepts a valid `CountryCode` eg: `'AS'` and returns *Country Details*
type: **json | ICountry**

```js
{
"name": "India",
"isoCode": "IN",
"phonecode": "+91",
"flag": "🇮🇳"
{
"isoCode": "IN",
"name": "India",
"phonecode": "91",
"flag": "🇮🇳",
"currency": "INR",
"latitude": "20.00000000",
"longitude": "77.00000000",
"timezones": [
{
"zoneName": "Asia\/Kolkata",
"gmtOffset": 19800,
"gmtOffsetName": "UTC+05:30",
"abbreviation": "IST",
"tzName": "Indian Standard Time"
}
]
}
```

Expand All @@ -68,11 +80,13 @@ type: **array of json | IState**

```js
[
{
"name": "Delhi",
"isoCode": "DL",
"countryCode": "IN"
}
{
"name": "Delhi",
"isoCode": "DL",
"countryCode": "IN",
"latitude": "28.70405920",
"longitude": "77.10249020"
}
]
```
Expand All @@ -85,11 +99,13 @@ type: **array of json | ICity**

```js
[
{
"name": "New Delhi",
"countryCode": "IN",
"stateCode": "DL"
}
{
"name": "New Delhi",
"countryCode": "IN",
"stateCode": "DL",
"latitude": "28.63576000",
"longitude": "77.22445000"
}
]
```
Expand All @@ -103,11 +119,13 @@ type: **array of json | ICity**

```js
[
{
"name": "New Delhi",
"countryCode": "IN",
"stateCode": "DL"
}
{
"name": "New Delhi",
"countryCode": "IN",
"stateCode": "DL",
"latitude": "28.63576000",
"longitude": "77.22445000"
}
]
```
Expand All @@ -120,12 +138,24 @@ type: **array of json | ICountry**

```js
[
{
"name": "India",
"isoCode": "IN",
"phonecode": "+91",
"flag": "🇮🇳"
}
{
"isoCode": "IN",
"name": "India",
"phonecode": "91",
"flag": "🇮🇳",
"currency": "INR",
"latitude": "20.00000000",
"longitude": "77.00000000",
"timezones": [
{
"zoneName": "Asia\/Kolkata",
"gmtOffset": 19800,
"gmtOffsetName": "UTC+05:30",
"abbreviation": "IST",
"tzName": "Indian Standard Time"
}
]
}
]
```

Expand All @@ -137,11 +167,14 @@ type: **array of json | IState**

```js
[
{
"name": "Delhi",
"isoCode": "DL",
"countryCode": "IN"
}
{
"name": "Delhi",
"isoCode": "DL",
"countryCode": "IN",
"latitude": "28.70405920",
"longitude": "77.10249020"
}
]
```

Expand All @@ -153,18 +186,21 @@ type: **array of json | ICity**

```js
[
{
"name": "New Delhi",
"countryCode": "IN",
"stateCode": "DL"
}
{
"name": "Delhi",
"isoCode": "DL",
"countryCode": "IN",
"latitude": "28.70405920",
"longitude": "77.10249020"
}
]
```

Special Thanks
---------------

[@baywet](https://github.com/baywet) - For mentoring Javascript to Typescript Conversion
[@dr5hn](https://github.com/dr5hn) - For updated World Data Dictionary

Change Logs
---------------
Expand All @@ -174,7 +210,7 @@ Change Logs
2. New and updated API functions.
3. Removed proprietor Indexed Id's for uniquely identifying Country, State, City. Instead now using standard isoCodes.
4. Data taken from more robust and accurate database.
5. Countries with their respective flags, currencies, latitude, longitude & timezones.
5. Countries with their respective flags, isoCode, currencies, latitude, longitude & timezones.
6. States & cities with their latitude & longitude.
**v1.0.0** :: [Data Source (hiiamrohit)](https://github.com/hiiamrohit/Countries-States-Cities-database)
Expand Down
32 changes: 9 additions & 23 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
module.exports = {
"roots": [
"<rootDir>/"
],
moduleFileExtensions: [
'js',
'ts',
'tsx',
'json',
'node',
],
testMatch: [
'**/*.test.ts',
'**/*.test.js'
],
testPathIgnorePatterns: [
'/node_modules/',
'dist'
],
collectCoverage: true,
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
}
roots: ['<rootDir>/'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'json', 'node'],
testMatch: ['**/*.test.ts', '**/*.test.js'],
testPathIgnorePatterns: ['/node_modules/', 'dist'],
collectCoverage: true,
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "country-state-city",
"version": "1.0.5",
"version": "2.0.0",
"description": "Library for fetching Country, its States and Cities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 9ffda0a

Please sign in to comment.