Skip to content

Commit

Permalink
Dynamically import Temporal polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Nov 26, 2023
1 parent 4761d9a commit 42b3b04
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/noaa",
"version": "0.8.6",
"version": "0.8.7",
"description": "sunrise and sunset via NOAA algorithm with elevation, based on KosherJava",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
Expand Down Expand Up @@ -40,11 +40,9 @@
"dist/*"
],
"devDependencies": {
"@types/node": "20.9.4",
"@types/node": "20.10.0",
"gts": "^5.2.0",
"temporal-polyfill": "^0.1.1",
"typescript": "^5.3.2"
},
"dependencies": {
"temporal-polyfill": "^0.1.1"
}
}
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import {Temporal} from 'temporal-polyfill';
(async () => {
if (typeof Temporal !== 'function') {
await import('temporal-polyfill/global');
}
})();

/**
* java.lang.Math.toRadians
Expand Down
4 changes: 2 additions & 2 deletions tsconfig-es6.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
"module": "es6",
"module": "node16",
"declaration": false,
"target": "es6",
"sourceMap": false,
"outDir": "dist/esm",
"lib": ["ESNext"],
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"moduleResolution": "Node16",
"strict": true
}
}

0 comments on commit 42b3b04

Please sign in to comment.