@adamlui/geolocate 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  <a href="https://npmstar.com/compare/@adamlui%2Fgeolocate">
8
8
  <img height=31 src="https://img.shields.io/npm/dm/@adamlui/geolocate?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9
- <a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.4.2">
10
- <img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.2-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9
+ <a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.4.3">
10
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.3-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
11
  <a href="#%EF%B8%8F-mit-license">
12
12
  <img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
13
13
  <a href="https://www.npmjs.com/package/@adamlui/geolocate?activeTab=code">
@@ -124,14 +124,14 @@ const geo = require('@adamlui/geolocate')
124
124
  #### <> HTML script tag:
125
125
 
126
126
  ```html
127
- <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.2/dist/geolocate.min.js"></script>
127
+ <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.3/dist/geolocate.min.js"></script>
128
128
  ```
129
129
 
130
130
  #### ES6:
131
131
 
132
132
  ```js
133
133
  (async () => {
134
- await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.2/dist/geolocate.min.js')
134
+ await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.3/dist/geolocate.min.js')
135
135
  // Your code here...
136
136
  })()
137
137
  ```
@@ -140,7 +140,7 @@ const geo = require('@adamlui/geolocate')
140
140
 
141
141
  ```js
142
142
  ...
143
- // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.2/dist/geolocate.min.js
143
+ // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.3/dist/geolocate.min.js
144
144
  // ==/UserScript==
145
145
 
146
146
  // Your code here...
@@ -148,7 +148,7 @@ const geo = require('@adamlui/geolocate')
148
148
 
149
149
  <br>
150
150
 
151
- **📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.4.2` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
151
+ **📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.4.3` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
152
152
 
153
153
  <br>
154
154
 
@@ -51,15 +51,8 @@ module.exports = {
51
51
  require(`../../${ env.modes.dev ? '../_locales/en' : 'data' }/messages.json`))
52
52
 
53
53
  if (!langCode.startsWith('en')) { // fetch non-English msgs from jsDelivr
54
- try { // check if terminal supports non-Latin scripts
55
- const nonLatinLocales = await (await data.fetch(
56
- `${cli.urls.jsdelivr}@${cli.commitHashes.data}/assets/data/non-latin-locales.json`
57
- )).json()
58
- if (nonLatinLocales.includes(langCode.split('-')[0]) && !env.supports.unicode)
59
- return msgs // en ones
60
- } catch (err) {
61
- log.debug(`Failed to fetch non-Latin locales: ${err}`)
62
- }
54
+ if (require('non-latin-locales').includes(langCode.split('_')[0]) && !env.supports.unicode)
55
+ return msgs // EN ones
63
56
  const msgBaseURL = `${require('./jsdelivr').getCommitURL(cli.commitHashes.locales)}/_locales`
64
57
  let msgURL = `${msgBaseURL}/${langCode}/messages.json`, msgFetchesTried = 0
65
58
  while (msgFetchesTried < 3)
package/docs/README.md CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  <a href="https://npmstar.com/compare/@adamlui%2Fgeolocate">
8
8
  <img height=31 src="https://img.shields.io/npm/dm/@adamlui/geolocate?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9
- <a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.4.2">
10
- <img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.2-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9
+ <a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.4.3">
10
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.4.3-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
11
  <a href="#%EF%B8%8F-mit-license">
12
12
  <img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
13
13
  <a href="https://www.npmjs.com/package/@adamlui/geolocate?activeTab=code">
@@ -124,14 +124,14 @@ const geo = require('@adamlui/geolocate')
124
124
  #### <> HTML script tag:
125
125
 
126
126
  ```html
127
- <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.2/dist/geolocate.min.js"></script>
127
+ <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.3/dist/geolocate.min.js"></script>
128
128
  ```
129
129
 
130
130
  #### ES6:
131
131
 
132
132
  ```js
133
133
  (async () => {
134
- await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.2/dist/geolocate.min.js')
134
+ await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.3/dist/geolocate.min.js')
135
135
  // Your code here...
136
136
  })()
137
137
  ```
@@ -140,7 +140,7 @@ const geo = require('@adamlui/geolocate')
140
140
 
141
141
  ```js
142
142
  ...
143
- // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.2/dist/geolocate.min.js
143
+ // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.4.3/dist/geolocate.min.js
144
144
  // ==/UserScript==
145
145
 
146
146
  // Your code here...
@@ -148,7 +148,7 @@ const geo = require('@adamlui/geolocate')
148
148
 
149
149
  <br>
150
150
 
151
- **📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.4.2` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
151
+ **📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.4.3` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
152
152
 
153
153
  <br>
154
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamlui/geolocate",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Fetch IP geolocation data from the CLI.",
5
5
  "author": {
6
6
  "name": "Adam Lui",
@@ -69,10 +69,11 @@
69
69
  "dependencies": {
70
70
  "console-table-printer": "^2.15.0",
71
71
  "is-unicode-supported": "^2.1.0",
72
- "node-clipboardy": "^1.0.3"
72
+ "node-clipboardy": "^1.0.3",
73
+ "non-latin-locales": "^1.0.1"
73
74
  },
74
75
  "devDependencies": {
75
- "@adamlui/minify.js": "^2.5.1",
76
+ "@adamlui/minify.js": "^2.5.2",
76
77
  "@eslint/json": "^1.2.0",
77
78
  "@eslint/markdown": "^8.0.1",
78
79
  "@stylistic/eslint-plugin": "^5.10.0",
@@ -80,6 +81,6 @@
80
81
  "eslint": "^9.39.4",
81
82
  "eslint-plugin-import": "^2.32.0",
82
83
  "eslint-plugin-regexp": "^3.1.0",
83
- "generate-ip": "^2.9.1"
84
+ "generate-ip": "^2.9.2"
84
85
  }
85
86
  }