Skip to content

Commit f32bb23

Browse files
authored
Merge pull request #166 from evansiroky/typescript-import-fix
Add entry points to assist TypeScript
2 parents e913e82 + 1b11eda commit f32bb23

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ This library does an exact geographic lookup which has tradeoffs. The results ar
2424

2525
## Entry Points
2626

27-
As of version 8, node-geo-tz offers the ability to choose from the three different timezone boundary products that the [timezone-boudary-builder](https://github.com/evansiroky/timezone-boundary-builder) project produces.
27+
As of version 8, node-geo-tz offers the ability to choose from the three different timezone boundary products that the [timezone-boudary-builder](https://github.com/evansiroky/timezone-boundary-builder) project produces. If using TypeScript, it may be necessary to use the `dist` entry points (see [issue #165](https://github.com/evansiroky/node-geo-tz/issues/165)).
2828

2929
### Alike Since 1970 (default)
3030

3131
The default data product used by this library are unioned timezones that are alike since 1970. This is a breaking change from versions below version 8 that used timezone identifiers that generally had a minimum of one timezone per country. In a number of places, the timezone identifier returned will be that which has the highest population among all timezone identifiers with similar timekeeping methods since 1970.
3232

3333
```js
3434
const { find } = require('geo-tz')
35+
// const { find } = require('geo-tz/dist/find-1970') // TypeScript-compatible import
3536

3637
find(12.826174, 45.036933) // ['Asia/Riyadh']
3738
```
@@ -44,6 +45,7 @@ A comprehensive dataset is available to query for all timezone identifiers avail
4445

4546
```js
4647
const { find } = require('geo-tz/all')
48+
// const { find } = require('geo-tz/dist/find-all') // TypeScript-compatible import
4749

4850
find(12.826174, 45.036933) // ['Asia/Aden']
4951
```
@@ -56,6 +58,7 @@ A dataset containing a unioned set of timezones that share the same timekeeping
5658

5759
```js
5860
const { find } = require('geo-tz/now')
61+
// const { find } = require('geo-tz/dist/find-now') // TypeScript-compatible import
5962

6063
find(12.826174, 45.036933) // ['Europe/Moscow']
6164
```

package.json

+18
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@
4040
"import": "./dist/find-now.js",
4141
"require": "./dist/find-now.js",
4242
"types": "./dist/find-now.d.ts"
43+
},
44+
"./dist/find-1970": {
45+
"main": "./dist/find-1970.js",
46+
"import": "./dist/find-1970.js",
47+
"require": "./dist/find-1970.js",
48+
"types": "./dist/find-1970.d.ts"
49+
},
50+
"./dist/find-all": {
51+
"main": "./dist/find-all.js",
52+
"import": "./dist/find-all.js",
53+
"require": "./dist/find-all.js",
54+
"types": "./dist/find-all.d.ts"
55+
},
56+
"./dist/find-now": {
57+
"main": "./dist/find-now.js",
58+
"import": "./dist/find-now.js",
59+
"require": "./dist/find-now.js",
60+
"types": "./dist/find-now.d.ts"
4361
}
4462
},
4563
"scripts": {

0 commit comments

Comments
 (0)