airport-utils 1.3.24 → 1.3.25

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.
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var tz = require('@date-fns/tz');
4
- var timezones = require('./mapping/timezones.js');
5
- var errors = require('./errors.js');
4
+ var timezones = require('./mapping/timezones.cjs');
5
+ var errors = require('./errors.cjs');
6
6
 
7
7
  const ISO_LOCAL_RE = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/;
8
8
  const VALID_TIMEZONE_CACHE = new Map();
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var converter = require('./converter.js');
4
- var info = require('./info.js');
5
- var errors = require('./errors.js');
3
+ var converter = require('./converter.cjs');
4
+ var info = require('./info.cjs');
5
+ var errors = require('./errors.cjs');
6
6
 
7
7
 
8
8
 
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var timezones = require('./mapping/timezones.js');
4
- var geo = require('./mapping/geo.js');
5
- var errors = require('./errors.js');
3
+ var timezones = require('./mapping/timezones.cjs');
4
+ var geo = require('./mapping/geo.cjs');
5
+ var errors = require('./errors.cjs');
6
6
 
7
7
  /** @throws UnknownAirportError */
8
8
  function getAirportInfo(iata) {
@@ -25003,6 +25003,15 @@ const geo = {
25003
25003
  countryName: 'South Korea',
25004
25004
  continent: 'Asia'
25005
25005
  },
25006
+ HMZ: {
25007
+ latitude: 23.46546,
25008
+ longitude: 103.34922,
25009
+ name: 'Honghe Mengzi Airport',
25010
+ city: 'Mengzi',
25011
+ country: 'CN',
25012
+ countryName: 'China',
25013
+ continent: 'Asia'
25014
+ },
25006
25015
  HNA: {
25007
25016
  latitude: 39.428611,
25008
25017
  longitude: 141.135278,
@@ -54635,7 +54644,7 @@ const geo = {
54635
54644
  latitude: 47.49111,
54636
54645
  longitude: 39.92878,
54637
54646
  name: 'Platov International Airport',
54638
- city: 'Rostov-na-Donu',
54647
+ city: 'Rostov-on-Don',
54639
54648
  country: 'RU',
54640
54649
  countryName: 'Russia',
54641
54650
  continent: 'Europe'
@@ -59387,7 +59396,7 @@ const geo = {
59387
59396
  latitude: 45.10916,
59388
59397
  longitude: 42.11278,
59389
59398
  name: 'Stavropol Shpakovskoye Airport',
59390
- city: 'Stavropol',
59399
+ city: 'Stavropol',
59391
59400
  country: 'RU',
59392
59401
  countryName: 'Russia',
59393
59402
  continent: 'Europe'
@@ -60215,7 +60224,7 @@ const geo = {
60215
60224
  latitude: 22.83,
60216
60225
  longitude: 101,
60217
60226
  name: 'Simao Airport',
60218
- city: 'Simao',
60227
+ city: "Pu'er",
60219
60228
  country: 'CN',
60220
60229
  countryName: 'China',
60221
60230
  continent: 'Asia'
@@ -60466,7 +60475,7 @@ const geo = {
60466
60475
  SZR: {
60467
60476
  latitude: 42.37668,
60468
60477
  longitude: 25.65514,
60469
- name: 'Kolyu Ganchevo Airport',
60478
+ name: 'Stara Zagora Airport',
60470
60479
  city: 'Stara Zagora',
60471
60480
  country: 'BG',
60472
60481
  countryName: 'Bulgaria',
@@ -66506,7 +66515,7 @@ const geo = {
66506
66515
  latitude: 17.515,
66507
66516
  longitude: 106.59056,
66508
66517
  name: 'Dong Hoi Airport',
66509
- city: 'Động Hỏi',
66518
+ city: 'Đồng Hới',
66510
66519
  country: 'VN',
66511
66520
  countryName: 'Vietnam',
66512
66521
  continent: 'Asia'
@@ -2780,6 +2780,7 @@ const timezones = {
2780
2780
  HMV: 'Europe/Stockholm',
2781
2781
  HMX: 'Asia/Shanghai',
2782
2782
  HMY: 'Asia/Seoul',
2783
+ HMZ: 'Asia/Shanghai',
2783
2784
  HNA: 'Asia/Tokyo',
2784
2785
  HNB: 'America/Indiana/Vincennes',
2785
2786
  HNC: 'America/New_York',
@@ -25001,6 +25001,15 @@ const geo = {
25001
25001
  countryName: 'South Korea',
25002
25002
  continent: 'Asia'
25003
25003
  },
25004
+ HMZ: {
25005
+ latitude: 23.46546,
25006
+ longitude: 103.34922,
25007
+ name: 'Honghe Mengzi Airport',
25008
+ city: 'Mengzi',
25009
+ country: 'CN',
25010
+ countryName: 'China',
25011
+ continent: 'Asia'
25012
+ },
25004
25013
  HNA: {
25005
25014
  latitude: 39.428611,
25006
25015
  longitude: 141.135278,
@@ -54633,7 +54642,7 @@ const geo = {
54633
54642
  latitude: 47.49111,
54634
54643
  longitude: 39.92878,
54635
54644
  name: 'Platov International Airport',
54636
- city: 'Rostov-na-Donu',
54645
+ city: 'Rostov-on-Don',
54637
54646
  country: 'RU',
54638
54647
  countryName: 'Russia',
54639
54648
  continent: 'Europe'
@@ -59385,7 +59394,7 @@ const geo = {
59385
59394
  latitude: 45.10916,
59386
59395
  longitude: 42.11278,
59387
59396
  name: 'Stavropol Shpakovskoye Airport',
59388
- city: 'Stavropol',
59397
+ city: 'Stavropol',
59389
59398
  country: 'RU',
59390
59399
  countryName: 'Russia',
59391
59400
  continent: 'Europe'
@@ -60213,7 +60222,7 @@ const geo = {
60213
60222
  latitude: 22.83,
60214
60223
  longitude: 101,
60215
60224
  name: 'Simao Airport',
60216
- city: 'Simao',
60225
+ city: "Pu'er",
60217
60226
  country: 'CN',
60218
60227
  countryName: 'China',
60219
60228
  continent: 'Asia'
@@ -60464,7 +60473,7 @@ const geo = {
60464
60473
  SZR: {
60465
60474
  latitude: 42.37668,
60466
60475
  longitude: 25.65514,
60467
- name: 'Kolyu Ganchevo Airport',
60476
+ name: 'Stara Zagora Airport',
60468
60477
  city: 'Stara Zagora',
60469
60478
  country: 'BG',
60470
60479
  countryName: 'Bulgaria',
@@ -66504,7 +66513,7 @@ const geo = {
66504
66513
  latitude: 17.515,
66505
66514
  longitude: 106.59056,
66506
66515
  name: 'Dong Hoi Airport',
66507
- city: 'Động Hỏi',
66516
+ city: 'Đồng Hới',
66508
66517
  country: 'VN',
66509
66518
  countryName: 'Vietnam',
66510
66519
  continent: 'Asia'
@@ -2778,6 +2778,7 @@ const timezones = {
2778
2778
  HMV: 'Europe/Stockholm',
2779
2779
  HMX: 'Asia/Shanghai',
2780
2780
  HMY: 'Asia/Seoul',
2781
+ HMZ: 'Asia/Shanghai',
2781
2782
  HNA: 'Asia/Tokyo',
2782
2783
  HNB: 'America/Indiana/Vincennes',
2783
2784
  HNC: 'America/New_York',
package/package.json CHANGED
@@ -1,15 +1,25 @@
1
1
  {
2
2
  "name": "airport-utils",
3
- "version": "1.3.24",
3
+ "version": "1.3.25",
4
4
  "description": "Convert local ISO 8601 timestamps to UTC using airport IATA codes, with airport geo-data",
5
- "main": "dist/cjs/index.js",
5
+ "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/types/index.d.ts",
8
8
  "exports": {
9
- "require": "./dist/cjs/index.js",
9
+ "types": "./dist/types/index.d.ts",
10
+ "require": "./dist/cjs/index.cjs",
10
11
  "import": "./dist/esm/index.js"
11
12
  },
12
13
  "type": "module",
14
+ "files": [
15
+ "dist/",
16
+ "README.md",
17
+ "package.json"
18
+ ],
19
+ "sideEffects": false,
20
+ "publishConfig": {
21
+ "provenance": true
22
+ },
13
23
  "repository": {
14
24
  "type": "git",
15
25
  "url": "https://github.com/elipeF/airport-utils.git"
@@ -18,14 +28,13 @@
18
28
  "node": ">=22"
19
29
  },
20
30
  "scripts": {
21
- "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist/types",
31
+ "build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --outDir dist/types",
22
32
  "build:js": "rollup -c",
23
33
  "build": "npm run build:types && npm run build:js",
24
34
  "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\"",
25
35
  "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\"",
26
36
  "format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\"",
27
37
  "test": "jest --coverage",
28
- "prepublishOnly": "npm run build",
29
38
  "update:mapping": "node --loader ts-node/esm --input-type=module -e \"import { generateMapping } from './scripts/generateMapping.ts'; await generateMapping();\""
30
39
  },
31
40
  "keywords": [
@@ -42,6 +51,7 @@
42
51
  "@date-fns/tz": "^1.2.0"
43
52
  },
44
53
  "devDependencies": {
54
+ "@eslint/js": "^10.0.1",
45
55
  "@rollup/plugin-node-resolve": "^16.0.1",
46
56
  "@rollup/plugin-typescript": "^12.1.2",
47
57
  "@semantic-release/commit-analyzer": "^13.0.1",
@@ -49,20 +59,18 @@
49
59
  "@semantic-release/npm": "^13.1.3",
50
60
  "@semantic-release/release-notes-generator": "^14.1.0",
51
61
  "@types/jest": "^30.0.0",
52
- "@types/node-fetch": "^2.6.12",
53
62
  "@typescript-eslint/eslint-plugin": "^8.53.1",
54
63
  "@typescript-eslint/parser": "^8.53.1",
55
64
  "conventional-changelog-conventionalcommits": "^9.1.0",
56
- "eslint": "^9.39.2",
65
+ "eslint": "^10.2.0",
57
66
  "eslint-config-prettier": "^10.1.8",
58
67
  "jest": "^30.0.5",
59
- "node-fetch": "^3.3.2",
60
68
  "prettier": "^3.8.0",
61
69
  "rollup": "^4.40.2",
62
70
  "semantic-release": "^25.0.2",
63
71
  "ts-jest": "^29.0.0",
64
72
  "ts-node": "^10.9.1",
65
73
  "tslib": "^2.8.1",
66
- "typescript": "^5.0.0"
74
+ "typescript": "^6.0.2"
67
75
  }
68
76
  }
package/.editorconfig DELETED
@@ -1,12 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- indent_style = space
7
- indent_size = 2
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
@@ -1,13 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "npm"
4
- directory: "/" # Location of package.json
5
- schedule:
6
- interval: "daily" # Check every day
7
- open-pull-requests-limit: 10 # Max 10 open PRs
8
- labels:
9
- - "dependencies" # Attach this label
10
- versioning-strategy: "auto" # Allow patch, minor & major bumps
11
- commit-message:
12
- prefix: "chore(deps)"
13
- include: scope
@@ -1,15 +0,0 @@
1
- name: CI
2
- on: [pull_request]
3
- jobs:
4
- build-and-test:
5
- runs-on: ubuntu-latest
6
- steps:
7
- - uses: actions/checkout@v3
8
- - uses: actions/setup-node@v4
9
- with:
10
- node-version-file: '.nvmrc'
11
- - run: npm ci
12
- - run: npm run lint
13
- - run: npm run format:check
14
- - run: npm run build
15
- - run: npm test
@@ -1,30 +0,0 @@
1
- name: "Auto-merge Dependabot updates"
2
-
3
- on:
4
- pull_request_target:
5
- types:
6
- - opened
7
- - labeled
8
- - unlabeled
9
- - synchronize
10
- - ready_for_review
11
- branches:
12
- - main
13
-
14
- permissions:
15
- pull-requests: write
16
- contents: write
17
-
18
- jobs:
19
- automerge:
20
- if: >
21
- github.actor == 'dependabot[bot]' &&
22
- contains(github.event.pull_request.labels.*.name, 'dependencies')
23
- runs-on: ubuntu-latest
24
-
25
- steps:
26
- - name: Enable auto-merge when CI passes
27
- uses: peter-evans/enable-pull-request-automerge@v2
28
- with:
29
- pull-request-number: ${{ github.event.pull_request.number }}
30
- merge-method: squash
@@ -1,118 +0,0 @@
1
- name: Maintain Bot PRs
2
-
3
- on:
4
- pull_request_target:
5
- types: [opened, reopened, synchronize, ready_for_review]
6
- schedule:
7
- - cron: "*/30 * * * *"
8
- workflow_dispatch:
9
-
10
- permissions:
11
- contents: write
12
- pull-requests: write
13
-
14
- concurrency:
15
- group: bot-pr-maintenance
16
- cancel-in-progress: false
17
-
18
- env:
19
- BOT_TOKEN: ${{ secrets.BOT_MAINTAINER_TOKEN != '' && secrets.BOT_MAINTAINER_TOKEN || secrets.GITHUB_TOKEN }}
20
- APPROVED_BOTS: '["dependabot[bot]","github-actions[bot]"]'
21
-
22
- jobs:
23
- maintain:
24
- runs-on: ubuntu-latest
25
- steps:
26
- - name: Determine PR number (if event is a PR)
27
- id: pr
28
- run: |
29
- if [ "${{ github.event.pull_request.number }}" != "" ]; then
30
- echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
31
- fi
32
-
33
- - name: Update the PR branch to latest base
34
- if: ${{ steps.pr.outputs.number != '' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
35
- uses: actions/github-script@v7
36
- with:
37
- github-token: ${{ env.BOT_TOKEN }}
38
- script: |
39
- const owner = context.repo.owner;
40
- const repo = context.repo.repo;
41
- const APPROVED_BOTS = JSON.parse(process.env.APPROVED_BOTS);
42
-
43
- async function updateOne(number) {
44
- const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: number });
45
- if (!APPROVED_BOTS.includes(pr.user.login) || pr.state !== 'open') return;
46
- try {
47
- await github.rest.pulls.updateBranch({ owner, repo, pull_number: number });
48
- core.info(`Updated branch for PR #${number}`);
49
- } catch (e) {
50
- core.info(`UpdateBranch skipped for PR #${number}: ${e.message}`);
51
- }
52
- }
53
-
54
- if (context.eventName === 'pull_request_target' && context.payload.pull_request) {
55
- await updateOne(context.payload.pull_request.number);
56
- } else {
57
- const all = await github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', per_page: 100 });
58
- for (const pr of all.filter(p => APPROVED_BOTS.includes(p.user.login))) {
59
- await updateOne(pr.number);
60
- }
61
- }
62
-
63
- - name: Auto-approve bot PR(s) (skip if reviewer == author or already approved)
64
- if: ${{ steps.pr.outputs.number != '' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
65
- uses: actions/github-script@v7
66
- with:
67
- github-token: ${{ env.BOT_TOKEN }}
68
- script: |
69
- const owner = context.repo.owner;
70
- const repo = context.repo.repo;
71
- const APPROVED_BOTS = JSON.parse(process.env.APPROVED_BOTS);
72
- const myLogin = process.env.GITHUB_ACTOR.toLowerCase();
73
-
74
- async function approveOne(number) {
75
- const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: number });
76
- const author = pr.user.login.toLowerCase();
77
- if (!APPROVED_BOTS.includes(pr.user.login) || pr.state !== 'open') return;
78
-
79
- // Skip if reviewer == author
80
- if (author === myLogin) {
81
- core.info(`Skipping PR #${number} - reviewer (${myLogin}) is the author.`);
82
- return;
83
- }
84
-
85
- // Skip if already approved by this reviewer
86
- const { data: reviews } = await github.rest.pulls.listReviews({ owner, repo, pull_number: number });
87
- const hasApproval = reviews.some(r =>
88
- r.user?.login?.toLowerCase() === myLogin &&
89
- r.state?.toLowerCase() === 'approved'
90
- );
91
- if (hasApproval) {
92
- core.info(`Skipping PR #${number} - already approved by ${myLogin}.`);
93
- return;
94
- }
95
-
96
- await github.rest.pulls.createReview({
97
- owner, repo, pull_number: number,
98
- event: 'APPROVE'
99
- });
100
- core.info(`Approved PR #${number} from ${pr.user.login}`);
101
- }
102
-
103
- if (context.eventName === 'pull_request_target' && context.payload.pull_request) {
104
- await approveOne(context.payload.pull_request.number);
105
- } else {
106
- const all = await github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', per_page: 100 });
107
- for (const pr of all.filter(p => APPROVED_BOTS.includes(p.user.login))) {
108
- await approveOne(pr.number);
109
- }
110
- }
111
-
112
- - name: Enable auto-merge (squash)
113
- if: ${{ steps.pr.outputs.number != '' }}
114
- uses: peter-evans/enable-pull-request-automerge@v3
115
- with:
116
- token: ${{ env.BOT_TOKEN }}
117
- pull-request-number: ${{ steps.pr.outputs.number }}
118
- merge-method: squash
@@ -1,54 +0,0 @@
1
- name: Publish
2
-
3
- on:
4
- schedule:
5
- - cron: '0 2 * * *' # daily at 02:00 UTC
6
- workflow_dispatch:
7
-
8
- jobs:
9
- release:
10
- runs-on: ubuntu-latest
11
- permissions:
12
- contents: write
13
- id-token: write
14
-
15
- steps:
16
- - name: Check out code
17
- uses: actions/checkout@v3
18
- with:
19
- fetch-depth: 0
20
- persist-credentials: true
21
-
22
- - name: Write .npmrc for registry auth
23
- run: |
24
- # Public npm
25
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
26
- env:
27
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28
-
29
- - name: Setup Node.js
30
- uses: actions/setup-node@v4
31
- with:
32
- node-version-file: '.nvmrc'
33
-
34
-
35
- - name: Install dependencies
36
- run: npm ci
37
-
38
- - name: Lint
39
- run: npm run lint
40
-
41
- - name: Format check
42
- run: npm run format:check
43
-
44
- - name: Build
45
- run: npm run build
46
-
47
- - name: Test
48
- run: npm test
49
-
50
- - name: Run semantic-release
51
- env:
52
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54
- run: npx semantic-release
@@ -1,72 +0,0 @@
1
- name: Update IATA→Timezone & Geo Mapping
2
-
3
- on:
4
- schedule:
5
- - cron: '0 0 * * *' # every day at 00:00 UTC
6
- workflow_dispatch:
7
-
8
- permissions:
9
- contents: write
10
- pull-requests: write
11
-
12
- concurrency:
13
- group: update-mapping
14
- cancel-in-progress: false
15
-
16
- env:
17
- # Single token for commits, PR creation, and auto-merge
18
- BOT_TOKEN: ${{ secrets.BOT_MAINTAINER_TOKEN != '' && secrets.BOT_MAINTAINER_TOKEN || secrets.GITHUB_TOKEN }}
19
-
20
- jobs:
21
- refresh-mapping:
22
- runs-on: ubuntu-latest
23
- steps:
24
- - name: Checkout repo
25
- uses: actions/checkout@v4
26
- with:
27
- fetch-depth: 0
28
- token: ${{ env.BOT_TOKEN }}
29
-
30
- - name: Setup Node.js
31
- uses: actions/setup-node@v4
32
- with:
33
- node-version-file: '.nvmrc'
34
-
35
- - name: Install dependencies
36
- run: npm ci
37
-
38
- - name: Generate updated mapping
39
- run: npm run update:mapping
40
-
41
- - name: Commit changes (no push)
42
- run: |
43
- git config user.name "github-actions[bot]"
44
- git config user.email "github-actions[bot]@users.noreply.github.com"
45
- git add src/mapping/*
46
- if git diff --cached --quiet; then
47
- echo "No changes in mapping files"
48
- echo "no_changes=true" >> $GITHUB_ENV
49
- else
50
- git commit -m "chore(mapping): daily update of mapping files"
51
- fi
52
-
53
- - name: Create or update PR
54
- if: env.no_changes != 'true'
55
- id: cpr
56
- uses: peter-evans/create-pull-request@v6
57
- with:
58
- token: ${{ env.BOT_TOKEN }}
59
- commit-message: "chore(mapping): daily update of mapping files"
60
- branch: chore/mapping-auto
61
- title: "chore(mapping): daily update of mapping files"
62
- body: "Automated update of mapping files."
63
- labels: dependencies
64
- delete-branch: true
65
-
66
- - name: Enable auto-merge (squash)
67
- if: steps.cpr.outputs.pull-request-number
68
- uses: peter-evans/enable-pull-request-automerge@v3
69
- with:
70
- token: ${{ env.BOT_TOKEN }}
71
- pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
72
- merge-method: squash
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 22
package/.prettierrc.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "semi": true,
4
- "trailingComma": "none",
5
- "printWidth": 100
6
- }
package/.releaserc.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "branches": ["main"],
3
- "repositoryUrl": "https://github.com/elipeF/airport-utils.git",
4
- "plugins": [
5
- [
6
- "@semantic-release/commit-analyzer",
7
- {
8
- "preset": "conventionalcommits",
9
- "releaseRules": [
10
- { "type": "chore", "release": "patch" },
11
- { "type": "docs", "release": "patch" },
12
- { "type": "style", "release": "patch" },
13
- { "type": "refactor", "release": "patch" },
14
- { "type": "perf", "release": "patch" },
15
- { "type": "test", "release": "patch" }
16
- ],
17
- "parserOpts": {
18
- "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
19
- }
20
- }
21
- ],
22
- "@semantic-release/release-notes-generator",
23
- "@semantic-release/npm",
24
- "@semantic-release/github"
25
- ]
26
- }