sweph 2.10.3-1 → 2.10.3-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.
Files changed (75) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +15 -12
  3. package/binding.gyp +22 -21
  4. package/index.d.ts +9 -9
  5. package/package.json +29 -20
  6. package/src/functions/calc.cpp +1 -1
  7. package/src/functions/calc_pctr.cpp +1 -1
  8. package/src/functions/calc_ut.cpp +1 -1
  9. package/src/functions/deltat_ex.cpp +1 -1
  10. package/src/functions/fixstar.cpp +1 -1
  11. package/src/functions/fixstar2.cpp +1 -1
  12. package/src/functions/fixstar2_mag.cpp +1 -1
  13. package/src/functions/fixstar2_ut.cpp +1 -1
  14. package/src/functions/fixstar_mag.cpp +1 -1
  15. package/src/functions/fixstar_ut.cpp +1 -1
  16. package/src/functions/gauquelin_sector.cpp +1 -1
  17. package/src/functions/get_ayanamsa_ex.cpp +1 -1
  18. package/src/functions/get_ayanamsa_ex_ut.cpp +1 -1
  19. package/src/functions/get_orbital_elements.cpp +1 -1
  20. package/src/functions/heliacal_pheno_ut.cpp +1 -1
  21. package/src/functions/heliacal_ut.cpp +1 -1
  22. package/src/functions/helio_cross.cpp +1 -1
  23. package/src/functions/helio_cross_ut.cpp +1 -1
  24. package/src/functions/house_pos.cpp +1 -1
  25. package/src/functions/houses_armc_ex2.cpp +1 -1
  26. package/src/functions/houses_ex2.cpp +1 -1
  27. package/src/functions/lat_to_lmt.cpp +1 -1
  28. package/src/functions/lmt_to_lat.cpp +1 -1
  29. package/src/functions/lun_eclipse_how.cpp +1 -1
  30. package/src/functions/lun_eclipse_when.cpp +1 -1
  31. package/src/functions/lun_eclipse_when_loc.cpp +1 -1
  32. package/src/functions/lun_occult_when_glob.cpp +1 -1
  33. package/src/functions/lun_occult_when_loc.cpp +1 -1
  34. package/src/functions/lun_occult_where.cpp +1 -1
  35. package/src/functions/mooncross.cpp +1 -1
  36. package/src/functions/mooncross_node.cpp +1 -1
  37. package/src/functions/mooncross_node_ut.cpp +1 -1
  38. package/src/functions/mooncross_ut.cpp +1 -1
  39. package/src/functions/nod_aps.cpp +1 -1
  40. package/src/functions/nod_aps_ut.cpp +1 -1
  41. package/src/functions/orbit_max_min_true_distance.cpp +1 -1
  42. package/src/functions/pheno.cpp +1 -1
  43. package/src/functions/pheno_ut.cpp +1 -1
  44. package/src/functions/rise_trans.cpp +1 -1
  45. package/src/functions/rise_trans_true_hor.cpp +1 -1
  46. package/src/functions/sol_eclipse_how.cpp +1 -1
  47. package/src/functions/sol_eclipse_when_glob.cpp +1 -1
  48. package/src/functions/sol_eclipse_when_loc.cpp +1 -1
  49. package/src/functions/sol_eclipse_where.cpp +1 -1
  50. package/src/functions/solcross.cpp +1 -1
  51. package/src/functions/solcross_ut.cpp +1 -1
  52. package/src/functions/time_equ.cpp +1 -1
  53. package/src/functions/utc_to_jd.cpp +1 -1
  54. package/src/functions/vis_limit_mag.cpp +1 -1
  55. package/{deps/swisseph → swisseph}/swecl.c +6430 -6430
  56. package/{deps/swisseph → swisseph}/swehouse.c +3140 -3140
  57. package/{deps/swisseph → swisseph}/sweph.c +8615 -8615
  58. package/{deps/swisseph → swisseph}/sweph.h +849 -849
  59. package/{deps/swisseph → swisseph}/swephexp.h +1025 -1025
  60. package/{deps/swisseph → swisseph}/swephlib.c +4634 -4634
  61. package/{deps/swisseph → swisseph}/swephlib.h +189 -189
  62. package/.github/FUNDING.yml +0 -5
  63. package/deps/swisseph.gyp +0 -43
  64. package/docs.gif +0 -0
  65. /package/{deps/swisseph → swisseph}/swedate.c +0 -0
  66. /package/{deps/swisseph → swisseph}/swedate.h +0 -0
  67. /package/{deps/swisseph → swisseph}/swehel.c +0 -0
  68. /package/{deps/swisseph → swisseph}/swehouse.h +0 -0
  69. /package/{deps/swisseph → swisseph}/swejpl.c +0 -0
  70. /package/{deps/swisseph → swisseph}/swejpl.h +0 -0
  71. /package/{deps/swisseph → swisseph}/swemmoon.c +0 -0
  72. /package/{deps/swisseph → swisseph}/swemplan.c +0 -0
  73. /package/{deps/swisseph → swisseph}/swemptab.h +0 -0
  74. /package/{deps/swisseph → swisseph}/swenut2000a.h +0 -0
  75. /package/{deps/swisseph → swisseph}/sweodef.h +0 -0
package/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
1
  This program and the accompanying materials are made available
2
- under the terms of the GNU GENERAL PUBLIC LICENSE 2.0 which is
2
+ under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE 3.0 which is
3
3
  available at https://www.gnu.org/licenses/agpl-3.0.html, or the
4
4
  GNU LESSER GENERAL PUBLIC LICENSE 3.0 which is available at
5
5
  https://www.gnu.org/licenses/lgpl-3.0.html depending on the
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Sweph
2
2
 
3
3
  The definitive Swiss Ephemeris bindings for Node.js
4
- Everything you need to create Astrology and Astronomy applications with javascript and node
4
+ Everything you need to create Astrology and Astronomy applications with JavaScript and node
5
5
 
6
6
  * 100% API coverage
7
7
  * Built-in Typescript declarations and ESM exports
@@ -9,9 +9,9 @@ Everything you need to create Astrology and Astronomy applications with javascri
9
9
  * Version matched
10
10
  * Made with the N-API
11
11
 
12
- [Official programmers documentation for the Swiss Ephemeris by Astrodienst AG](https://www.astro.com/swisseph/swephprg.htm)
12
+ [Official programmer's documentation for the Swiss Ephemeris by Astrodienst AG](https://www.astro.com/swisseph/swephprg.htm)
13
13
  [Official guide for the Swiss Ephemeris by Astrodienst AG](https://www.astro.com/ftp/swisseph/doc/swisseph.htm)
14
- [Sweph on Github](https://github.com/timotejroiko/sweph)
14
+ [Sweph on GitHub](https://github.com/timotejroiko/sweph)
15
15
  [Sweph on NPM](https://npmjs.com/package/sweph)
16
16
 
17
17
  ## Installation and Licensing
@@ -36,7 +36,7 @@ If you own a professional license for the Swiss Ephemeris, you may use any versi
36
36
 
37
37
  This library is version locked to the Swiss Ephemeris in addition to its own revisions. For example, version `2.10.1-1` corresponds to the Swiss Ephemeris version `2.10.1` and this library's revision `1`.
38
38
 
39
- Updates to this library will be released under new revisions, while updates to Swiss Ephemeris will be released under matching semver versions.
39
+ Updates to this library will be released under new revisions, while updates to Swiss Ephemeris will be released under matching SemVer versions.
40
40
 
41
41
  ## Documentation
42
42
 
@@ -61,20 +61,23 @@ For advanced usage, the following files can also be found:
61
61
 
62
62
  * astxxx folders - files for individual asteroids (600 years)
63
63
  * longfiles folder - files for individual asteroids (6000 years)
64
- * jplfiles folder - files for nasa's jpl ephemerides
64
+ * jplfiles folder - files for NASA's JPL ephemerides
65
65
  * sat folder - files for planetary moons
66
66
 
67
- More information can be found in the [Swiss Ephemeris files documentation](https://www.astro.com/ftp/swisseph/doc/swisseph.htm#_Toc58931065).
67
+ More information can be found in the [Swiss Ephemeris files documentation](https://www.astro.com/ftp/swisseph/doc/swisseph.htm).
68
68
 
69
69
  ## Contributing
70
70
 
71
- If you find any innacuracy or bug in this library, or if you find an update that is not yet included in this library, feel free to open an issue or a pull request.
71
+ If you find any inaccuracy or bug in this library, or if you find an upstream update that is not yet included in this library, feel free to open an issue or a pull request.
72
72
 
73
- ## Known Issues and Caveats
73
+ ## Limitations
74
74
 
75
- * Due to how the underlying C library operates, you may find that the `error` field returned by some functions will contain random data even if there is no actual error. This can happen when existing memory buffers are recycled therefore the user must always check the returned flag values as per the Swiss Ephemeris documentation.
76
- * While worker_threads are supported, the underlying C library is single threaded and its settings are global. Functions such as `set_ephe_path()` will affect the entire process, including worker_threads. While you can still use worker_threads as long as you dont change settings from other threads in the middle of calculations, true thread-safe multithreading can be achieved using child_process instead.
75
+ * While worker_threads are supported, the underlying C library is single threaded and contains process-wide settings. Functions such as `set_ephe_path()` or `set_sid_mode()` will affect the entire process, including all worker_threads. While you can still use worker_threads as long as you don't change settings from other threads in the middle of calculations, true thread-safe multithreading can only be achieved using child_process.
77
76
 
78
- ## Author
77
+ * This library is a C/C++ add-on designed for Node.JS only, it will not work in browsers, other JS engines or in any other environment that does not support native C/C++ add-ons. In order to install this library, the target system must have the necessary build tools installed, such as `python`, `make` and `gcc` on Linux, `xcode` on Mac, `visual c++` on Windows, and/or other equivalent solutions.
79
78
 
80
- Copyright © 2021, Timotej Valentin Rojko
79
+ ## Copyright
80
+
81
+ Copyright © 2021-2023, Timotej Valentin Rojko
82
+
83
+ This library is offered free of charge for any type of use, including commercial use, however, if you're an individual or a company using this library in commercial products and/or services, consider subscribing to the appropriate sponsorship level [here](https://github.com/sponsors/timotejroiko) and get priority support for your business.
package/binding.gyp CHANGED
@@ -4,36 +4,37 @@
4
4
  "target_name": "sweph",
5
5
  "sources": [
6
6
  "src/sweph.cpp",
7
- "<!@(node -p \"const { readdirSync, readFileSync, writeFileSync } = require('fs'); const file = readdirSync('./src/functions').map((x,i) => readFileSync('./src/functions/' + x, 'utf8').replace(/args/g, 'args' + i).replace('#include <sweph.h>', '')).reduce((a,b) => a + b, '#include <sweph.h>'); writeFileSync('./src/functions.cpp', file, 'utf8'); 'src/functions.cpp'\")"
7
+ "src/functions.cpp"
8
8
  ],
9
9
  "include_dirs": [
10
10
  "<!(node -p \"require('node-addon-api').include_dir\")",
11
11
  "src"
12
12
  ],
13
- 'dependencies': [
14
- 'deps/swisseph.gyp:swisseph'
13
+ "dependencies": [
14
+ "swisseph"
15
15
  ],
16
16
  "defines": [
17
17
  "NAPI_DISABLE_CPP_EXCEPTIONS"
18
+ ]
19
+ },
20
+ {
21
+ "target_name": "swisseph",
22
+ 'type': "static_library",
23
+ "sources": [
24
+ "swisseph/swecl.c",
25
+ "swisseph/swedate.c",
26
+ "swisseph/swehel.c",
27
+ "swisseph/swehouse.c",
28
+ "swisseph/swejpl.c",
29
+ "swisseph/swemmoon.c",
30
+ "swisseph/swemplan.c",
31
+ "swisseph/sweph.c",
32
+ "swisseph/swephlib.c"
18
33
  ],
19
- "cflags": [
20
- "-flto",
21
- "-Ofast",
22
- "-pipe"
23
- ],
24
- "cflags_cc": [
25
- "-flto",
26
- "-Ofast",
27
- "-pipe"
28
- ],
29
- "msvs_settings": {
30
- "VCCLCompilerTool": {
31
- "AdditionalOptions": [
32
- "/O2",
33
- "/GL",
34
- "/Gw"
35
- ]
36
- }
34
+ "direct_dependent_settings": {
35
+ "include_dirs": [
36
+ "swisseph"
37
+ ]
37
38
  }
38
39
  }
39
40
  ]
package/index.d.ts CHANGED
@@ -2,9 +2,9 @@
2
2
  * ## Sweph
3
3
  * Definitive Swiss Ephemeris bindings for Node.js
4
4
  *
5
- * [Official programmers documentation for the Swiss Ephemeris](https://www.astro.com/swisseph/swephprg.htm)
5
+ * [Official programmer's documentation for the Swiss Ephemeris](https://www.astro.com/swisseph/swephprg.htm)
6
6
  * [Official guide for the Swiss Ephemeris](https://www.astro.com/ftp/swisseph/doc/swisseph.htm)
7
- * [Sweph on Github](https://github.com/timotejroiko/sweph)
7
+ * [Sweph on GitHub](https://github.com/timotejroiko/sweph)
8
8
  * [Sweph on NPM](http://npmjs.com/package/sweph)
9
9
  *
10
10
  * ### Usage
@@ -649,7 +649,7 @@ declare module "sweph" {
649
649
  * ```
650
650
  * ```
651
651
  */
652
- data: JdEtUd;
652
+ data: JdEtUt;
653
653
  }
654
654
 
655
655
  interface VisLimitMag extends Flag, Error {
@@ -1756,7 +1756,7 @@ declare module "sweph" {
1756
1756
  dip: number
1757
1757
  ]
1758
1758
 
1759
- type JdEtUd = [
1759
+ type JdEtUt = [
1760
1760
  /**
1761
1761
  * Julian day in ephemeris/terrestrial time
1762
1762
  */
@@ -2092,7 +2092,7 @@ declare module "sweph" {
2092
2092
  * ```
2093
2093
  * • csec: number // Centiseconds value
2094
2094
  * • sep: string // Separator character
2095
- * • supzero: boolean // Omit seconds if they are zero
2095
+ * • suppresszero: boolean // Omit seconds if they are zero
2096
2096
  * ```
2097
2097
  * ### Returns
2098
2098
  * ```
@@ -2104,7 +2104,7 @@ declare module "sweph" {
2104
2104
  * ```
2105
2105
  * &nbsp;
2106
2106
  */
2107
- export function cs2timestr(csec: number, sep: string, supzero: boolean): string;
2107
+ export function cs2timestr(csec: number, sep: string, suppresszero: boolean): string;
2108
2108
 
2109
2109
  /**
2110
2110
  * ### Description
@@ -2189,7 +2189,7 @@ declare module "sweph" {
2189
2189
  * ```
2190
2190
  * &nbsp;
2191
2191
  */
2192
- export function date_conversion(year: number, month: number, day: number, hour: number, calendar: string): DateConversion;
2192
+ export function date_conversion(year: number, month: number, day: number, hour: number, calendar: "g" | "j" | (string & {})): DateConversion;
2193
2193
 
2194
2194
  /**
2195
2195
  * ### Description
@@ -2600,7 +2600,7 @@ declare module "sweph" {
2600
2600
  * ```
2601
2601
  * &nbsp;
2602
2602
  */
2603
- export function gauquelin_sector(tjd_ut: number, ipl: number, starname: string | null, iflag: number, imeth: number, geopos: [number,number,number], atpress: number, attemp: number): GauquelinSector;
2603
+ export function gauquelin_sector(tjd_ut: number, ipl: number, starname: string | null, iflag: number, imeth: number, geopos: [longitude: number, latitude: number, elevation: number], atpress: number, attemp: number): GauquelinSector;
2604
2604
 
2605
2605
  /**
2606
2606
  * ### Description
@@ -4114,7 +4114,7 @@ declare module "sweph" {
4114
4114
  * ### Params
4115
4115
  * ```
4116
4116
  * • tjd: number // Julian day in universal time
4117
- * • gregflag: number // Calendar type (SE_JUL_CAL or SE_GREG_CAL)
4117
+ * • gregflag: number // Calendar system, SE_GREG_CAL for gregorian calendar, SE_JUL_CAL for julian calendar
4118
4118
  * ```
4119
4119
  * ### Returns
4120
4120
  * ```
package/package.json CHANGED
@@ -1,19 +1,7 @@
1
1
  {
2
2
  "name": "sweph",
3
- "version": "2.10.3-1",
3
+ "version": "2.10.3-3",
4
4
  "description": "The definitive Swiss Ephemeris bindings for Node.js",
5
- "main": "index.js",
6
- "typings": "./index.d.ts",
7
- "exports": {
8
- "require": "./index.js",
9
- "import": "./index.mjs"
10
- },
11
- "scripts": {
12
- "test": "echo \"Error: no test specified\" && exit 0"
13
- },
14
- "repository": {
15
- "url": "https://github.com/timotejroiko/sweph.git"
16
- },
17
5
  "keywords": [
18
6
  "sweph",
19
7
  "swiss",
@@ -23,17 +11,38 @@
23
11
  "swisseph",
24
12
  "node"
25
13
  ],
14
+ "homepage": "https://github.com/timotejroiko/sweph",
26
15
  "bugs": "https://github.com/timotejroiko/sweph/issues",
16
+ "repository": "github:timotejroiko/sweph",
17
+ "funding": "https://github.com/timotejroiko/sweph?sponsor=1",
18
+ "license": "(AGPL-3.0-or-later OR LGPL-3.0-or-later)",
19
+ "author": "Timotej Valentin Rojko",
20
+ "exports": {
21
+ "require": "./index.js",
22
+ "import": "./index.mjs"
23
+ },
24
+ "main": "index.js",
25
+ "types": "./index.d.ts",
26
+ "files": [
27
+ "./index.js",
28
+ "./index.mjs",
29
+ "./index.d.ts",
30
+ "./constants.js",
31
+ "./binding.gyp",
32
+ "./swisseph",
33
+ "./src/functions",
34
+ "./src/sweph.cpp",
35
+ "./src/sweph.h"
36
+ ],
37
+ "scripts": {
38
+ "preinstall": "node -e \"const { readdirSync, readFileSync, writeFileSync } = require('fs'); const file = readdirSync('./src/functions').map((x,i) => readFileSync('./src/functions/' + x, 'utf8').replace(/args/g, 'args' + i).replace('#include <sweph.h>', '')).reduce((a,b) => a + b, '#include <sweph.h>'); writeFileSync('./src/functions.cpp', file, 'utf8');\"",
39
+ "install": "node-gyp rebuild && npm run test",
40
+ "test": "node -e \"const s = require('./'); const c = s.calc(2222222,0,4); console.log('OK')\""
41
+ },
27
42
  "dependencies": {
28
43
  "node-addon-api": "*"
29
44
  },
30
- "funding": {
31
- "type": "patreon",
32
- "url": "https://patreon.com/timotejroiko"
33
- },
34
- "author": "Timotej Valentin Rojko",
35
- "license": "(AGPL-3.0-or-later OR LGPL-3.0-or-later)",
36
45
  "devDependencies": {
37
- "eslint": "^8.21.0"
46
+ "eslint": "^8.44.0"
38
47
  }
39
48
  }
@@ -13,7 +13,7 @@ Napi::Value sweph_calc(const Napi::CallbackInfo& info) {
13
13
  return env.Null();
14
14
  }
15
15
  double xx [6];
16
- char serr [AS_MAXCH];
16
+ char serr [AS_MAXCH] = "";
17
17
  int32 flag = swe_calc(
18
18
  info[0].As<Napi::Number>().DoubleValue(),
19
19
  info[1].As<Napi::Number>().Int32Value(),
@@ -14,7 +14,7 @@ Napi::Value sweph_calc_pctr(const Napi::CallbackInfo& info) {
14
14
  return env.Null();
15
15
  }
16
16
  double xx [6];
17
- char serr [AS_MAXCH];
17
+ char serr [AS_MAXCH] = "";
18
18
  int32 flag = swe_calc_pctr(
19
19
  info[0].As<Napi::Number>().DoubleValue(),
20
20
  info[1].As<Napi::Number>().Int32Value(),
@@ -13,7 +13,7 @@ Napi::Value sweph_calc_ut(const Napi::CallbackInfo& info) {
13
13
  return env.Null();
14
14
  }
15
15
  double xx [6];
16
- char serr [AS_MAXCH];
16
+ char serr [AS_MAXCH] = "";
17
17
  int32 flag = swe_calc_ut(
18
18
  info[0].As<Napi::Number>().DoubleValue(),
19
19
  info[1].As<Napi::Number>().Int32Value(),
@@ -11,7 +11,7 @@ Napi::Value sweph_deltat_ex(const Napi::CallbackInfo& info) {
11
11
  if(!sweph_type_check(args, info)) {
12
12
  return env.Null();
13
13
  }
14
- char serr [AS_MAXCH];
14
+ char serr [AS_MAXCH] = "";
15
15
  double delta = swe_deltat_ex(
16
16
  info[0].As<Napi::Number>().DoubleValue(),
17
17
  info[1].As<Napi::Number>().Int32Value(),
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar(const Napi::CallbackInfo& info) {
13
13
  return env.Null();
14
14
  }
15
15
  double xx [6];
16
- char serr [AS_MAXCH];
16
+ char serr [AS_MAXCH] = "";
17
17
  char star [AS_MAXCH];
18
18
  strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
19
  int32 flag = swe_fixstar(
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar2(const Napi::CallbackInfo& info) {
13
13
  return env.Null();
14
14
  }
15
15
  double xx [6];
16
- char serr [AS_MAXCH];
16
+ char serr [AS_MAXCH] = "";
17
17
  char star [AS_MAXCH];
18
18
  strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
19
  int32 flag = swe_fixstar2(
@@ -11,7 +11,7 @@ Napi::Value sweph_fixstar2_mag(const Napi::CallbackInfo& info) {
11
11
  return env.Null();
12
12
  }
13
13
  double mag;
14
- char serr [AS_MAXCH];
14
+ char serr [AS_MAXCH] = "";
15
15
  char star [AS_MAXCH];
16
16
  strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
17
17
  int32 flag = swe_fixstar2_mag(
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar2_ut(const Napi::CallbackInfo& info) {
13
13
  return env.Null();
14
14
  }
15
15
  double xx [6];
16
- char serr [AS_MAXCH];
16
+ char serr [AS_MAXCH] = "";
17
17
  char star [AS_MAXCH];
18
18
  strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
19
  int32 flag = swe_fixstar2_ut(
@@ -11,7 +11,7 @@ Napi::Value sweph_fixstar_mag(const Napi::CallbackInfo& info) {
11
11
  return env.Null();
12
12
  }
13
13
  double mag;
14
- char serr [AS_MAXCH];
14
+ char serr [AS_MAXCH] = "";
15
15
  char star [AS_MAXCH];
16
16
  strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
17
17
  int32 flag = swe_fixstar_mag(
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar_ut(const Napi::CallbackInfo& info) {
13
13
  return env.Null();
14
14
  }
15
15
  double xx [6];
16
- char serr [AS_MAXCH];
16
+ char serr [AS_MAXCH] = "";
17
17
  char star [AS_MAXCH];
18
18
  strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
19
19
  int32 flag = swe_fixstar_ut(
@@ -23,7 +23,7 @@ Napi::Value sweph_gauquelin_sector(const Napi::CallbackInfo& info) {
23
23
  return env.Null();
24
24
  }
25
25
  double sect;
26
- char serr [AS_MAXCH];
26
+ char serr [AS_MAXCH] = "";
27
27
  int32 flag = swe_gauquelin_sector(
28
28
  info[0].As<Napi::Number>().DoubleValue(),
29
29
  info[1].As<Napi::Number>().Int32Value(),
@@ -12,7 +12,7 @@ Napi::Value sweph_get_ayanamsa_ex(const Napi::CallbackInfo& info) {
12
12
  return env.Null();
13
13
  }
14
14
  double aya;
15
- char serr [AS_MAXCH];
15
+ char serr [AS_MAXCH] = "";
16
16
  int32 flag = swe_get_ayanamsa_ex(
17
17
  info[0].As<Napi::Number>().DoubleValue(),
18
18
  info[1].As<Napi::Number>().Int32Value(),
@@ -12,7 +12,7 @@ Napi::Value sweph_get_ayanamsa_ex_ut(const Napi::CallbackInfo& info) {
12
12
  return env.Null();
13
13
  }
14
14
  double aya;
15
- char serr [AS_MAXCH];
15
+ char serr [AS_MAXCH] = "";
16
16
  int32 flag = swe_get_ayanamsa_ex_ut(
17
17
  info[0].As<Napi::Number>().DoubleValue(),
18
18
  info[1].As<Napi::Number>().Int32Value(),
@@ -13,7 +13,7 @@ Napi::Value sweph_get_orbital_elements(const Napi::CallbackInfo& info) {
13
13
  return env.Null();
14
14
  }
15
15
  double ret [50];
16
- char serr [AS_MAXCH];
16
+ char serr [AS_MAXCH] = "";
17
17
  int32 flag = swe_get_orbital_elements(
18
18
  info[0].As<Napi::Number>().DoubleValue(),
19
19
  info[1].As<Napi::Number>().Int32Value(),
@@ -31,7 +31,7 @@ Napi::Value sweph_heliacal_pheno_ut(const Napi::CallbackInfo& info) {
31
31
  Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
32
32
  return env.Null();
33
33
  }
34
- char serr [AS_MAXCH];
34
+ char serr [AS_MAXCH] = "";
35
35
  double ret [50];
36
36
  int32 flag = swe_heliacal_pheno_ut(
37
37
  info[0].As<Napi::Number>().DoubleValue(),
@@ -31,7 +31,7 @@ Napi::Value sweph_heliacal_ut(const Napi::CallbackInfo& info) {
31
31
  Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
32
32
  return env.Null();
33
33
  }
34
- char serr [AS_MAXCH];
34
+ char serr [AS_MAXCH] = "";
35
35
  double ret [50];
36
36
  int32 flag = swe_heliacal_ut(
37
37
  info[0].As<Napi::Number>().DoubleValue(),
@@ -14,7 +14,7 @@ Napi::Value sweph_helio_cross(const Napi::CallbackInfo& info) {
14
14
  if(!sweph_type_check(args, info)) {
15
15
  return env.Null();
16
16
  }
17
- char serr [AS_MAXCH];
17
+ char serr [AS_MAXCH] = "";
18
18
  double jd_cross;
19
19
  int32 flag = swe_helio_cross(
20
20
  info[0].As<Napi::Number>().Int32Value(),
@@ -14,7 +14,7 @@ Napi::Value sweph_helio_cross_ut(const Napi::CallbackInfo& info) {
14
14
  if(!sweph_type_check(args, info)) {
15
15
  return env.Null();
16
16
  }
17
- char serr [AS_MAXCH];
17
+ char serr [AS_MAXCH] = "";
18
18
  double jd_cross;
19
19
  int32 flag = swe_helio_cross_ut(
20
20
  info[0].As<Napi::Number>().Int32Value(),
@@ -19,7 +19,7 @@ Napi::Value sweph_house_pos(const Napi::CallbackInfo& info) {
19
19
  Napi::TypeError::New(env, args[5].second).ThrowAsJavaScriptException();
20
20
  return env.Null();
21
21
  }
22
- char serr [AS_MAXCH];
22
+ char serr [AS_MAXCH] = "";
23
23
  char sys = info[3].As<Napi::String>().Utf8Value()[0];
24
24
  double house = swe_house_pos(
25
25
  info[0].As<Napi::Number>().DoubleValue(),
@@ -20,7 +20,7 @@ Napi::Value sweph_houses_armc_ex2(const Napi::CallbackInfo& info) {
20
20
  }
21
21
  double cspeed [37];
22
22
  double pspeed [10];
23
- char serr [AS_MAXCH];
23
+ char serr [AS_MAXCH] = "";
24
24
  char sys = info[3].As<Napi::String>().Utf8Value()[0];
25
25
  int g = sys == 'G' ? 37 : 13;
26
26
  int flag = swe_houses_armc_ex2(
@@ -18,7 +18,7 @@ Napi::Value sweph_houses_ex2(const Napi::CallbackInfo& info) {
18
18
  double points [10];
19
19
  double cspeed [37];
20
20
  double pspeed [10];
21
- char serr [AS_MAXCH];
21
+ char serr [AS_MAXCH] = "";
22
22
  char sys = info[4].As<Napi::String>().Utf8Value()[0];
23
23
  int flag = swe_houses_ex2(
24
24
  info[0].As<Napi::Number>().DoubleValue(),
@@ -12,7 +12,7 @@ Napi::Value sweph_lat_to_lmt(const Napi::CallbackInfo& info) {
12
12
  return env.Null();
13
13
  }
14
14
  double conv;
15
- char serr [AS_MAXCH];
15
+ char serr [AS_MAXCH] = "";
16
16
  int32 flag = swe_lat_to_lmt(
17
17
  info[0].As<Napi::Number>().DoubleValue(),
18
18
  info[1].As<Napi::Number>().DoubleValue(),
@@ -12,7 +12,7 @@ Napi::Value sweph_lmt_to_lat(const Napi::CallbackInfo& info) {
12
12
  return env.Null();
13
13
  }
14
14
  double conv;
15
- char serr [AS_MAXCH];
15
+ char serr [AS_MAXCH] = "";
16
16
  int32 flag = swe_lmt_to_lat(
17
17
  info[0].As<Napi::Number>().DoubleValue(),
18
18
  info[1].As<Napi::Number>().DoubleValue(),
@@ -18,7 +18,7 @@ Napi::Value sweph_lun_eclipse_how(const Napi::CallbackInfo& info) {
18
18
  return env.Null();
19
19
  }
20
20
  double attr [20];
21
- char serr [AS_MAXCH];
21
+ char serr [AS_MAXCH] = "";
22
22
  int32 flag = swe_lun_eclipse_how(
23
23
  info[0].As<Napi::Number>().DoubleValue(),
24
24
  info[1].As<Napi::Number>().Int32Value(),
@@ -14,7 +14,7 @@ Napi::Value sweph_lun_eclipse_when(const Napi::CallbackInfo& info) {
14
14
  return env.Null();
15
15
  }
16
16
  double ret [10];
17
- char serr [AS_MAXCH];
17
+ char serr [AS_MAXCH] = "";
18
18
  int32 flag = swe_lun_eclipse_when(
19
19
  info[0].As<Napi::Number>().DoubleValue(),
20
20
  info[1].As<Napi::Number>().Int32Value(),
@@ -20,7 +20,7 @@ Napi::Value sweph_lun_eclipse_when_loc(const Napi::CallbackInfo& info) {
20
20
  }
21
21
  double ret [10];
22
22
  double attr [20];
23
- char serr [AS_MAXCH];
23
+ char serr [AS_MAXCH] = "";
24
24
  int32 flag = swe_lun_eclipse_when_loc(
25
25
  info[0].As<Napi::Number>().DoubleValue(),
26
26
  info[1].As<Napi::Number>().Int32Value(),
@@ -16,7 +16,7 @@ Napi::Value sweph_lun_occult_when_glob(const Napi::CallbackInfo& info) {
16
16
  return env.Null();
17
17
  }
18
18
  double ret [10];
19
- char serr [AS_MAXCH];
19
+ char serr [AS_MAXCH] = "";
20
20
  int32 flag = swe_lun_occult_when_glob(
21
21
  info[0].As<Napi::Number>().DoubleValue(),
22
22
  info[1].As<Napi::Number>().Int32Value(),
@@ -22,7 +22,7 @@ Napi::Value sweph_lun_occult_when_loc(const Napi::CallbackInfo& info) {
22
22
  }
23
23
  double ret [10];
24
24
  double attr [20];
25
- char serr [AS_MAXCH];
25
+ char serr [AS_MAXCH] = "";
26
26
  int32 flag = swe_lun_occult_when_loc(
27
27
  info[0].As<Napi::Number>().DoubleValue(),
28
28
  info[1].As<Napi::Number>().Int32Value(),
@@ -15,7 +15,7 @@ Napi::Value sweph_lun_occult_where(const Napi::CallbackInfo& info) {
15
15
  }
16
16
  double geopos [10];
17
17
  double attr [20];
18
- char serr [AS_MAXCH];
18
+ char serr [AS_MAXCH] = "";
19
19
  int32 flag = swe_lun_occult_where(
20
20
  info[0].As<Napi::Number>().DoubleValue(),
21
21
  info[1].As<Napi::Number>().Int32Value(),
@@ -12,7 +12,7 @@ Napi::Value sweph_mooncross(const Napi::CallbackInfo& info) {
12
12
  if(!sweph_type_check(args, info)) {
13
13
  return env.Null();
14
14
  }
15
- char serr [AS_MAXCH];
15
+ char serr [AS_MAXCH] = "";
16
16
  double jd_et = swe_mooncross(
17
17
  info[0].As<Napi::Number>().DoubleValue(),
18
18
  info[1].As<Napi::Number>().DoubleValue(),
@@ -11,7 +11,7 @@ Napi::Value sweph_mooncross_node(const Napi::CallbackInfo& info) {
11
11
  if(!sweph_type_check(args, info)) {
12
12
  return env.Null();
13
13
  }
14
- char serr [AS_MAXCH];
14
+ char serr [AS_MAXCH] = "";
15
15
  double xlon;
16
16
  double xlat;
17
17
  double jd_et = swe_mooncross_node(
@@ -11,7 +11,7 @@ Napi::Value sweph_mooncross_node_ut(const Napi::CallbackInfo& info) {
11
11
  if(!sweph_type_check(args, info)) {
12
12
  return env.Null();
13
13
  }
14
- char serr [AS_MAXCH];
14
+ char serr [AS_MAXCH] = "";
15
15
  double xlon;
16
16
  double xlat;
17
17
  double jd_ut = swe_mooncross_node_ut(
@@ -12,7 +12,7 @@ Napi::Value sweph_mooncross_ut(const Napi::CallbackInfo& info) {
12
12
  if(!sweph_type_check(args, info)) {
13
13
  return env.Null();
14
14
  }
15
- char serr [AS_MAXCH];
15
+ char serr [AS_MAXCH] = "";
16
16
  double jd_ut = swe_mooncross_ut(
17
17
  info[0].As<Napi::Number>().DoubleValue(),
18
18
  info[1].As<Napi::Number>().DoubleValue(),
@@ -17,7 +17,7 @@ Napi::Value sweph_nod_aps(const Napi::CallbackInfo& info) {
17
17
  double dsc [6];
18
18
  double per [6];
19
19
  double aph [6];
20
- char serr [AS_MAXCH];
20
+ char serr [AS_MAXCH] = "";
21
21
  int32 flag = swe_nod_aps(
22
22
  info[0].As<Napi::Number>().DoubleValue(),
23
23
  info[1].As<Napi::Number>().Int32Value(),
@@ -17,7 +17,7 @@ Napi::Value sweph_nod_aps_ut(const Napi::CallbackInfo& info) {
17
17
  double dsc [6];
18
18
  double per [6];
19
19
  double aph [6];
20
- char serr [AS_MAXCH];
20
+ char serr [AS_MAXCH] = "";
21
21
  int32 flag = swe_nod_aps_ut(
22
22
  info[0].As<Napi::Number>().DoubleValue(),
23
23
  info[1].As<Napi::Number>().Int32Value(),
@@ -15,7 +15,7 @@ Napi::Value sweph_orbit_max_min_true_distance(const Napi::CallbackInfo& info) {
15
15
  double dmax;
16
16
  double dmin;
17
17
  double dtrue;
18
- char serr [AS_MAXCH];
18
+ char serr [AS_MAXCH] = "";
19
19
  int32 flag = swe_orbit_max_min_true_distance(
20
20
  info[0].As<Napi::Number>().DoubleValue(),
21
21
  info[1].As<Napi::Number>().Int32Value(),