@typescriptify/sweph 1.0.0 → 1.0.1
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/package.json +6 -2
- package/originalCode/.eslintrc.json +0 -124
- package/originalCode/.gitattributes +0 -2
- package/originalCode/.github/FUNDING.yml +0 -5
- package/originalCode/.github/workflows/test.yml +0 -35
- package/originalCode/LICENSE +0 -840
- package/originalCode/README.md +0 -91
- package/originalCode/binding.gyp +0 -41
- package/originalCode/constants.js +0 -366
- package/originalCode/docs.gif +0 -0
- package/originalCode/index.d.ts +0 -5115
- package/originalCode/index.js +0 -7
- package/originalCode/index.mjs +0 -109
- package/originalCode/package.json +0 -55
- package/originalCode/src/functions/azalt.cpp +0 -39
- package/originalCode/src/functions/azalt_rev.cpp +0 -35
- package/originalCode/src/functions/calc.cpp +0 -29
- package/originalCode/src/functions/calc_pctr.cpp +0 -31
- package/originalCode/src/functions/calc_ut.cpp +0 -29
- package/originalCode/src/functions/close.cpp +0 -6
- package/originalCode/src/functions/cotrans.cpp +0 -26
- package/originalCode/src/functions/cotrans_sp.cpp +0 -26
- package/originalCode/src/functions/cs2degstr.cpp +0 -19
- package/originalCode/src/functions/cs2lonlatstr.cpp +0 -23
- package/originalCode/src/functions/cs2timestr.cpp +0 -23
- package/originalCode/src/functions/csnorm.cpp +0 -15
- package/originalCode/src/functions/csroundsec.cpp +0 -15
- package/originalCode/src/functions/d2l.cpp +0 -15
- package/originalCode/src/functions/date_conversion.cpp +0 -30
- package/originalCode/src/functions/day_of_week.cpp +0 -15
- package/originalCode/src/functions/degnorm.cpp +0 -15
- package/originalCode/src/functions/deltat.cpp +0 -15
- package/originalCode/src/functions/deltat_ex.cpp +0 -24
- package/originalCode/src/functions/difcs2n.cpp +0 -19
- package/originalCode/src/functions/difcsn.cpp +0 -19
- package/originalCode/src/functions/difdeg2n.cpp +0 -19
- package/originalCode/src/functions/difdegn.cpp +0 -19
- package/originalCode/src/functions/fixstar.cpp +0 -32
- package/originalCode/src/functions/fixstar2.cpp +0 -32
- package/originalCode/src/functions/fixstar2_mag.cpp +0 -28
- package/originalCode/src/functions/fixstar2_ut.cpp +0 -32
- package/originalCode/src/functions/fixstar_mag.cpp +0 -28
- package/originalCode/src/functions/fixstar_ut.cpp +0 -32
- package/originalCode/src/functions/gauquelin_sector.cpp +0 -44
- package/originalCode/src/functions/get_ayanamsa.cpp +0 -15
- package/originalCode/src/functions/get_ayanamsa_ex.cpp +0 -27
- package/originalCode/src/functions/get_ayanamsa_ex_ut.cpp +0 -27
- package/originalCode/src/functions/get_ayanamsa_name.cpp +0 -19
- package/originalCode/src/functions/get_ayanamsa_ut.cpp +0 -15
- package/originalCode/src/functions/get_current_file_data.cpp +0 -28
- package/originalCode/src/functions/get_library_path.cpp +0 -8
- package/originalCode/src/functions/get_orbital_elements.cpp +0 -29
- package/originalCode/src/functions/get_planet_name.cpp +0 -19
- package/originalCode/src/functions/get_tid_acc.cpp +0 -7
- package/originalCode/src/functions/heliacal_pheno_ut.cpp +0 -52
- package/originalCode/src/functions/heliacal_ut.cpp +0 -52
- package/originalCode/src/functions/helio_cross.cpp +0 -33
- package/originalCode/src/functions/helio_cross_ut.cpp +0 -33
- package/originalCode/src/functions/house_name.cpp +0 -20
- package/originalCode/src/functions/house_pos.cpp +0 -36
- package/originalCode/src/functions/houses.cpp +0 -35
- package/originalCode/src/functions/houses_armc.cpp +0 -38
- package/originalCode/src/functions/houses_armc_ex2.cpp +0 -47
- package/originalCode/src/functions/houses_ex.cpp +0 -37
- package/originalCode/src/functions/houses_ex2.cpp +0 -46
- package/originalCode/src/functions/jdet_to_utc.cpp +0 -38
- package/originalCode/src/functions/jdut1_to_utc.cpp +0 -38
- package/originalCode/src/functions/julday.cpp +0 -25
- package/originalCode/src/functions/lat_to_lmt.cpp +0 -27
- package/originalCode/src/functions/lmt_to_lat.cpp +0 -27
- package/originalCode/src/functions/lun_eclipse_how.cpp +0 -34
- package/originalCode/src/functions/lun_eclipse_when.cpp +0 -31
- package/originalCode/src/functions/lun_eclipse_when_loc.cpp +0 -39
- package/originalCode/src/functions/lun_occult_when_glob.cpp +0 -35
- package/originalCode/src/functions/lun_occult_when_loc.cpp +0 -43
- package/originalCode/src/functions/lun_occult_where.cpp +0 -34
- package/originalCode/src/functions/mooncross.cpp +0 -26
- package/originalCode/src/functions/mooncross_node.cpp +0 -30
- package/originalCode/src/functions/mooncross_node_ut.cpp +0 -30
- package/originalCode/src/functions/mooncross_ut.cpp +0 -26
- package/originalCode/src/functions/nod_aps.cpp +0 -42
- package/originalCode/src/functions/nod_aps_ut.cpp +0 -42
- package/originalCode/src/functions/orbit_max_min_true_distance.cpp +0 -37
- package/originalCode/src/functions/pheno.cpp +0 -29
- package/originalCode/src/functions/pheno_ut.cpp +0 -29
- package/originalCode/src/functions/radnorm.cpp +0 -15
- package/originalCode/src/functions/refrac.cpp +0 -23
- package/originalCode/src/functions/refrac_extended.cpp +0 -32
- package/originalCode/src/functions/revjul.cpp +0 -33
- package/originalCode/src/functions/rise_trans.cpp +0 -44
- package/originalCode/src/functions/rise_trans_true_hor.cpp +0 -46
- package/originalCode/src/functions/set_delta_t_userdef.cpp +0 -14
- package/originalCode/src/functions/set_ephe_path.cpp +0 -14
- package/originalCode/src/functions/set_jpl_file.cpp +0 -14
- package/originalCode/src/functions/set_sid_mode.cpp +0 -20
- package/originalCode/src/functions/set_tid_acc.cpp +0 -14
- package/originalCode/src/functions/set_topo.cpp +0 -20
- package/originalCode/src/functions/sidtime.cpp +0 -15
- package/originalCode/src/functions/sidtime0.cpp +0 -21
- package/originalCode/src/functions/sol_eclipse_how.cpp +0 -34
- package/originalCode/src/functions/sol_eclipse_when_glob.cpp +0 -31
- package/originalCode/src/functions/sol_eclipse_when_loc.cpp +0 -39
- package/originalCode/src/functions/sol_eclipse_where.cpp +0 -30
- package/originalCode/src/functions/solcross.cpp +0 -26
- package/originalCode/src/functions/solcross_ut.cpp +0 -26
- package/originalCode/src/functions/split_deg.cpp +0 -35
- package/originalCode/src/functions/time_equ.cpp +0 -25
- package/originalCode/src/functions/utc_time_zone.cpp +0 -48
- package/originalCode/src/functions/utc_to_jd.cpp +0 -37
- package/originalCode/src/functions/version.cpp +0 -8
- package/originalCode/src/functions/vis_limit_mag.cpp +0 -50
- package/originalCode/src/sweph.cpp +0 -150
- package/originalCode/src/sweph.h +0 -119
- package/originalCode/swisseph/swecl.c +0 -6428
- package/originalCode/swisseph/swedate.c +0 -588
- package/originalCode/swisseph/swedate.h +0 -81
- package/originalCode/swisseph/swehel.c +0 -3511
- package/originalCode/swisseph/swehouse.c +0 -3143
- package/originalCode/swisseph/swehouse.h +0 -98
- package/originalCode/swisseph/swejpl.c +0 -958
- package/originalCode/swisseph/swejpl.h +0 -103
- package/originalCode/swisseph/swemmoon.c +0 -1930
- package/originalCode/swisseph/swemplan.c +0 -967
- package/originalCode/swisseph/swemptab.h +0 -10640
- package/originalCode/swisseph/swenut2000a.h +0 -2819
- package/originalCode/swisseph/sweodef.h +0 -326
- package/originalCode/swisseph/sweph.c +0 -8614
- package/originalCode/swisseph/sweph.h +0 -849
- package/originalCode/swisseph/swephexp.h +0 -1020
- package/originalCode/swisseph/swephlib.c +0 -4634
- package/originalCode/swisseph/swephlib.h +0 -189
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 1, "Expecting 1 argument: hsys" },
|
|
5
|
-
{ STRING, "Argument 1 should be a string - house system ID" }
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
Napi::Value sweph_house_name(const Napi::CallbackInfo& info) {
|
|
9
|
-
Napi::Env env = info.Env();
|
|
10
|
-
if(!sweph_type_check(args, info)) {
|
|
11
|
-
return env.Null();
|
|
12
|
-
}
|
|
13
|
-
char sys = info[0].As<Napi::String>().Utf8Value()[0];
|
|
14
|
-
const char* name = swe_house_name(int(sys));
|
|
15
|
-
if(name == NULL) {
|
|
16
|
-
Napi::TypeError::New(env, "Invalid house system").ThrowAsJavaScriptException();
|
|
17
|
-
return env.Null();
|
|
18
|
-
}
|
|
19
|
-
return Napi::String::New(env, name);
|
|
20
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 5, "Expecting 5 arguments: armc, geolat, eps, hsys, xpin" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - ARMC" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - geographic latitude in degrees" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - obliquity of the ecliptic in degrees" },
|
|
8
|
-
{ STRING, "Argument 4 should be a string - house system ID" },
|
|
9
|
-
{ ARRAY, "Argument 5 should be an array of 2 numbers - ecliptic coordinates of the target [longitude, latitude]" }
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
Napi::Value sweph_house_pos(const Napi::CallbackInfo& info) {
|
|
13
|
-
Napi::Env env = info.Env();
|
|
14
|
-
if(!sweph_type_check(args, info)) {
|
|
15
|
-
return env.Null();
|
|
16
|
-
}
|
|
17
|
-
double planet [2];
|
|
18
|
-
if(!sweph_double_array_converter(planet, 2, info[4])) {
|
|
19
|
-
Napi::TypeError::New(env, args[5].second).ThrowAsJavaScriptException();
|
|
20
|
-
return env.Null();
|
|
21
|
-
}
|
|
22
|
-
char serr [AS_MAXCH] = "";
|
|
23
|
-
char sys = info[3].As<Napi::String>().Utf8Value()[0];
|
|
24
|
-
double house = swe_house_pos(
|
|
25
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
26
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
27
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
28
|
-
int(sys),
|
|
29
|
-
planet,
|
|
30
|
-
serr
|
|
31
|
-
);
|
|
32
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
33
|
-
obj["error"] = serr;
|
|
34
|
-
obj["data"] = house;
|
|
35
|
-
return obj;
|
|
36
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd_ut, geolat, geolon, hsys" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - geographic latitude in degrees" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - geographic longitude in degrees" },
|
|
8
|
-
{ STRING, "Argument 4 should be a string - house system ID" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_houses(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double cusps [37];
|
|
17
|
-
double points [10];
|
|
18
|
-
char sys = info[3].As<Napi::String>().Utf8Value()[0];
|
|
19
|
-
int flag = swe_houses(
|
|
20
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
21
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
23
|
-
int(sys),
|
|
24
|
-
cusps,
|
|
25
|
-
points
|
|
26
|
-
);
|
|
27
|
-
int g = sys == 'G' && flag == OK ? 37 : 13;
|
|
28
|
-
Napi::Object data = Napi::Object::New(env);
|
|
29
|
-
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
30
|
-
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
31
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
32
|
-
obj["flag"] = flag;
|
|
33
|
-
obj["data"] = data;
|
|
34
|
-
return obj;
|
|
35
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: armc, geolat, eps, hsys" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - ARMC" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - geographic latitude in degrees" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - obliquity of the ecliptic in degrees" },
|
|
8
|
-
{ STRING, "Argument 4 should be a string - house system ID" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_houses_armc(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double cusps [37];
|
|
17
|
-
double points [10];
|
|
18
|
-
if(info[4].IsNumber()) {
|
|
19
|
-
points[9] = info[4].As<Napi::Number>().DoubleValue();
|
|
20
|
-
}
|
|
21
|
-
char sys = info[3].As<Napi::String>().Utf8Value()[0];
|
|
22
|
-
int g = sys == 'G' ? 37 : 13;
|
|
23
|
-
int flag = swe_houses_armc(
|
|
24
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
25
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
26
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
27
|
-
int(sys),
|
|
28
|
-
cusps,
|
|
29
|
-
points
|
|
30
|
-
);
|
|
31
|
-
Napi::Object data = Napi::Object::New(env);
|
|
32
|
-
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
33
|
-
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
34
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
35
|
-
obj["flag"] = flag;
|
|
36
|
-
obj["data"] = data;
|
|
37
|
-
return obj;
|
|
38
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: armc, geolat, eps, hsys" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - ARMC" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - geographic latitude in degrees" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - obliquity of the ecliptic in degrees" },
|
|
8
|
-
{ STRING, "Argument 4 should be a string - house system ID" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_houses_armc_ex2(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double cusps [37];
|
|
17
|
-
double points [10];
|
|
18
|
-
if(info[4].IsNumber()) {
|
|
19
|
-
points[9] = info[4].As<Napi::Number>().DoubleValue();
|
|
20
|
-
}
|
|
21
|
-
double cspeed [37];
|
|
22
|
-
double pspeed [10];
|
|
23
|
-
char serr [AS_MAXCH] = "";
|
|
24
|
-
char sys = info[3].As<Napi::String>().Utf8Value()[0];
|
|
25
|
-
int g = sys == 'G' ? 37 : 13;
|
|
26
|
-
int flag = swe_houses_armc_ex2(
|
|
27
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
28
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
29
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
30
|
-
int(sys),
|
|
31
|
-
cusps,
|
|
32
|
-
points,
|
|
33
|
-
cspeed,
|
|
34
|
-
pspeed,
|
|
35
|
-
serr
|
|
36
|
-
);
|
|
37
|
-
Napi::Object data = Napi::Object::New(env);
|
|
38
|
-
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
39
|
-
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
40
|
-
data["housesSpeed"] = sweph_js_array_converter(&cspeed[1], g-1, env);
|
|
41
|
-
data["pointsSpeed"] = sweph_js_array_converter(pspeed, 8, env);
|
|
42
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
43
|
-
obj["flag"] = flag;
|
|
44
|
-
obj["error"] = serr;
|
|
45
|
-
obj["data"] = data;
|
|
46
|
-
return obj;
|
|
47
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 5, "Expecting 5 arguments: tjd_ut, iflag, geolat, geolon, hsys" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calculation flag" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - geographic latitude in degrees" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - geographic longitude in degrees" },
|
|
9
|
-
{ STRING, "Argument 5 should be a string - house system ID" }
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
Napi::Value sweph_houses_ex(const Napi::CallbackInfo& info) {
|
|
13
|
-
Napi::Env env = info.Env();
|
|
14
|
-
if(!sweph_type_check(args, info)) {
|
|
15
|
-
return env.Null();
|
|
16
|
-
}
|
|
17
|
-
double cusps [37];
|
|
18
|
-
double points [10];
|
|
19
|
-
char sys = info[4].As<Napi::String>().Utf8Value()[0];
|
|
20
|
-
int flag = swe_houses_ex(
|
|
21
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
23
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
24
|
-
info[3].As<Napi::Number>().DoubleValue(),
|
|
25
|
-
int(sys),
|
|
26
|
-
cusps,
|
|
27
|
-
points
|
|
28
|
-
);
|
|
29
|
-
int g = sys == 'G' && flag == OK ? 37 : 13;
|
|
30
|
-
Napi::Object data = Napi::Object::New(env);
|
|
31
|
-
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
32
|
-
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
33
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
34
|
-
obj["flag"] = flag;
|
|
35
|
-
obj["data"] = data;
|
|
36
|
-
return obj;
|
|
37
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 5, "Expecting 5 arguments: tjd_ut, iflag, geolat, geolon, hsys" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calculation flag" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - geographic latitude in degrees" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - geographic longitude in degrees" },
|
|
9
|
-
{ STRING, "Argument 5 should be a string - house system ID" }
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
Napi::Value sweph_houses_ex2(const Napi::CallbackInfo& info) {
|
|
13
|
-
Napi::Env env = info.Env();
|
|
14
|
-
if(!sweph_type_check(args, info)) {
|
|
15
|
-
return env.Null();
|
|
16
|
-
}
|
|
17
|
-
double cusps [37];
|
|
18
|
-
double points [10];
|
|
19
|
-
double cspeed [37];
|
|
20
|
-
double pspeed [10];
|
|
21
|
-
char serr [AS_MAXCH] = "";
|
|
22
|
-
char sys = info[4].As<Napi::String>().Utf8Value()[0];
|
|
23
|
-
int flag = swe_houses_ex2(
|
|
24
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
25
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
26
|
-
info[2].As<Napi::Number>().DoubleValue(),
|
|
27
|
-
info[3].As<Napi::Number>().DoubleValue(),
|
|
28
|
-
int(sys),
|
|
29
|
-
cusps,
|
|
30
|
-
points,
|
|
31
|
-
cspeed,
|
|
32
|
-
pspeed,
|
|
33
|
-
serr
|
|
34
|
-
);
|
|
35
|
-
int g = sys == 'G' && flag == OK ? 37 : 13;
|
|
36
|
-
Napi::Object data = Napi::Object::New(env);
|
|
37
|
-
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
38
|
-
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
39
|
-
data["housesSpeed"] = sweph_js_array_converter(&cspeed[1], g-1, env);
|
|
40
|
-
data["pointsSpeed"] = sweph_js_array_converter(pspeed, 8, env);
|
|
41
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
42
|
-
obj["flag"] = flag;
|
|
43
|
-
obj["error"] = serr;
|
|
44
|
-
obj["data"] = data;
|
|
45
|
-
return obj;
|
|
46
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: tjd_et, gregflag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in ephemeris/terrestrial time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calendar system, 1 for SE_GREG_CAL, 0 for SE_JUL_CAL" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_jdet_to_utc(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
int year;
|
|
15
|
-
int month;
|
|
16
|
-
int day;
|
|
17
|
-
int hour;
|
|
18
|
-
int minute;
|
|
19
|
-
double second;
|
|
20
|
-
swe_jdet_to_utc(
|
|
21
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
23
|
-
&year,
|
|
24
|
-
&month,
|
|
25
|
-
&day,
|
|
26
|
-
&hour,
|
|
27
|
-
&minute,
|
|
28
|
-
&second
|
|
29
|
-
);
|
|
30
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
31
|
-
obj["year"] = year;
|
|
32
|
-
obj["month"] = month;
|
|
33
|
-
obj["day"] = day;
|
|
34
|
-
obj["hour"] = hour;
|
|
35
|
-
obj["minute"] = minute;
|
|
36
|
-
obj["second"] = second;
|
|
37
|
-
return obj;
|
|
38
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: tjd_ut, gregflag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - calendar system, 1 for SE_GREG_CAL, 0 for SE_JUL_CAL" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_jdut1_to_utc(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
int year;
|
|
15
|
-
int month;
|
|
16
|
-
int day;
|
|
17
|
-
int hour;
|
|
18
|
-
int minute;
|
|
19
|
-
double second;
|
|
20
|
-
swe_jdut1_to_utc(
|
|
21
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
23
|
-
&year,
|
|
24
|
-
&month,
|
|
25
|
-
&day,
|
|
26
|
-
&hour,
|
|
27
|
-
&minute,
|
|
28
|
-
&second
|
|
29
|
-
);
|
|
30
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
31
|
-
obj["year"] = year;
|
|
32
|
-
obj["month"] = month;
|
|
33
|
-
obj["day"] = day;
|
|
34
|
-
obj["hour"] = hour;
|
|
35
|
-
obj["minute"] = minute;
|
|
36
|
-
obj["second"] = second;
|
|
37
|
-
return obj;
|
|
38
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 5, "Expecting 5 arguments: year, month, day, hour, gregflag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - full year" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - month 1-12" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - day 1-31" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - decimal hour 0-23.999" },
|
|
9
|
-
{ NUMBER, "Argument 5 should be a number - calendar system, 1 for SE_GREG_CAL, 0 for SE_JUL_CAL" }
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
Napi::Value sweph_julday(const Napi::CallbackInfo& info) {
|
|
13
|
-
Napi::Env env = info.Env();
|
|
14
|
-
if(!sweph_type_check(args, info)) {
|
|
15
|
-
return env.Null();
|
|
16
|
-
}
|
|
17
|
-
double time = swe_julday(
|
|
18
|
-
info[0].As<Napi::Number>().Int32Value(),
|
|
19
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
20
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
21
|
-
info[3].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[4].As<Napi::Number>().Int32Value()
|
|
23
|
-
);
|
|
24
|
-
return Napi::Number::New(env, time);
|
|
25
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: tjd_lat, geolon" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in local apparent time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - geographic longitude" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_lat_to_lmt(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
double conv;
|
|
15
|
-
char serr [AS_MAXCH] = "";
|
|
16
|
-
int32 flag = swe_lat_to_lmt(
|
|
17
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
&conv,
|
|
20
|
-
serr
|
|
21
|
-
);
|
|
22
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
23
|
-
obj["flag"] = flag;
|
|
24
|
-
obj["error"] = serr;
|
|
25
|
-
obj["data"] = conv;
|
|
26
|
-
return obj;
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 2, "Expecting 2 arguments: tjd_lmt, geolon" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in local mean time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - geographic longitude" }
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
Napi::Value sweph_lmt_to_lat(const Napi::CallbackInfo& info) {
|
|
10
|
-
Napi::Env env = info.Env();
|
|
11
|
-
if(!sweph_type_check(args, info)) {
|
|
12
|
-
return env.Null();
|
|
13
|
-
}
|
|
14
|
-
double conv;
|
|
15
|
-
char serr [AS_MAXCH] = "";
|
|
16
|
-
int32 flag = swe_lmt_to_lat(
|
|
17
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
&conv,
|
|
20
|
-
serr
|
|
21
|
-
);
|
|
22
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
23
|
-
obj["flag"] = flag;
|
|
24
|
-
obj["error"] = serr;
|
|
25
|
-
obj["data"] = conv;
|
|
26
|
-
return obj;
|
|
27
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: tjd_ut, ifl, geopos" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - ephemeris flag" },
|
|
7
|
-
{ ARRAY, "Argument 3 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_lun_eclipse_how(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
double geopos [3];
|
|
16
|
-
if(!sweph_double_array_converter(geopos, 3, info[2])) {
|
|
17
|
-
Napi::TypeError::New(env, args[3].second).ThrowAsJavaScriptException();
|
|
18
|
-
return env.Null();
|
|
19
|
-
}
|
|
20
|
-
double attr [20];
|
|
21
|
-
char serr [AS_MAXCH] = "";
|
|
22
|
-
int32 flag = swe_lun_eclipse_how(
|
|
23
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
24
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
25
|
-
geopos,
|
|
26
|
-
attr,
|
|
27
|
-
serr
|
|
28
|
-
);
|
|
29
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
30
|
-
obj["flag"] = flag;
|
|
31
|
-
obj["error"] = serr;
|
|
32
|
-
obj["data"] = sweph_js_array_converter(attr, 11, env);
|
|
33
|
-
return obj;
|
|
34
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd_start, ifl, ifltype, backward" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - ephemeris flag" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - eclipse type" },
|
|
8
|
-
{ TRUEFALSE, "Argument 4 should be a boolean - backwards search" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_lun_eclipse_when(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double ret [10];
|
|
17
|
-
char serr [AS_MAXCH] = "";
|
|
18
|
-
int32 flag = swe_lun_eclipse_when(
|
|
19
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
20
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
21
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
22
|
-
ret,
|
|
23
|
-
info[3].As<Napi::Boolean>(),
|
|
24
|
-
serr
|
|
25
|
-
);
|
|
26
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
27
|
-
obj["flag"] = flag;
|
|
28
|
-
obj["error"] = serr;
|
|
29
|
-
obj["data"] = sweph_js_array_converter(ret, 8, env);
|
|
30
|
-
return obj;
|
|
31
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd_start, ifl, geopos, backward" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - ephemeris flag" },
|
|
7
|
-
{ ARRAY, "Argument 3 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
|
|
8
|
-
{ TRUEFALSE, "Argument 4 should be a boolean - backwards search" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_lun_eclipse_when_loc(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double geopos [3];
|
|
17
|
-
if(!sweph_double_array_converter(geopos, 3, info[2])) {
|
|
18
|
-
Napi::TypeError::New(env, args[3].second).ThrowAsJavaScriptException();
|
|
19
|
-
return env.Null();
|
|
20
|
-
}
|
|
21
|
-
double ret [10];
|
|
22
|
-
double attr [20];
|
|
23
|
-
char serr [AS_MAXCH] = "";
|
|
24
|
-
int32 flag = swe_lun_eclipse_when_loc(
|
|
25
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
26
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
27
|
-
geopos,
|
|
28
|
-
ret,
|
|
29
|
-
attr,
|
|
30
|
-
info[3].As<Napi::Boolean>(),
|
|
31
|
-
serr
|
|
32
|
-
);
|
|
33
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
34
|
-
obj["flag"] = flag;
|
|
35
|
-
obj["error"] = serr;
|
|
36
|
-
obj["data"] = sweph_js_array_converter(ret, 10, env);
|
|
37
|
-
obj["attributes"] = sweph_js_array_converter(attr, 11, env);
|
|
38
|
-
return obj;
|
|
39
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 6, "Expecting 6 arguments: tjd_start, ipl, starname, ifl, ifltype, backward" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ STRINGNULL, "Argument 3 should be a string or NULL - target star name" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - ephemeris flag" },
|
|
9
|
-
{ NUMBER, "Argument 5 should be a number - eclipse type" },
|
|
10
|
-
{ TRUEFALSE, "Argument 6 should be a boolean - backwards search" }
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
Napi::Value sweph_lun_occult_when_glob(const Napi::CallbackInfo& info) {
|
|
14
|
-
Napi::Env env = info.Env();
|
|
15
|
-
if(!sweph_type_check(args, info)) {
|
|
16
|
-
return env.Null();
|
|
17
|
-
}
|
|
18
|
-
double ret [10];
|
|
19
|
-
char serr [AS_MAXCH] = "";
|
|
20
|
-
int32 flag = swe_lun_occult_when_glob(
|
|
21
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
22
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
23
|
-
info[2].IsString() ? (char*)info[2].As<Napi::String>().Utf8Value().c_str() : NULL,
|
|
24
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
25
|
-
info[4].As<Napi::Number>().Int32Value(),
|
|
26
|
-
ret,
|
|
27
|
-
info[5].As<Napi::Boolean>(),
|
|
28
|
-
serr
|
|
29
|
-
);
|
|
30
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
31
|
-
obj["flag"] = flag;
|
|
32
|
-
obj["error"] = serr;
|
|
33
|
-
obj["data"] = sweph_js_array_converter(ret, 10, env);
|
|
34
|
-
return obj;
|
|
35
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 6, "Expecting 6 arguments: tjd_start, ipl, starname, ifl, geopos, backward" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ STRINGNULL, "Argument 3 should be a string or NULL - target star name" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - ephemeris flag" },
|
|
9
|
-
{ ARRAY, "Argument 5 should be an array of 3 numbers - geographic coordinates [longitude, latitude, elevation]" },
|
|
10
|
-
{ TRUEFALSE, "Argument 6 should be a boolean - backwards search" }
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
Napi::Value sweph_lun_occult_when_loc(const Napi::CallbackInfo& info) {
|
|
14
|
-
Napi::Env env = info.Env();
|
|
15
|
-
if(!sweph_type_check(args, info)) {
|
|
16
|
-
return env.Null();
|
|
17
|
-
}
|
|
18
|
-
double geopos [3];
|
|
19
|
-
if(!sweph_double_array_converter(geopos, 3, info[0])) {
|
|
20
|
-
Napi::TypeError::New(env, args[1].second).ThrowAsJavaScriptException();
|
|
21
|
-
return env.Null();
|
|
22
|
-
}
|
|
23
|
-
double ret [10];
|
|
24
|
-
double attr [20];
|
|
25
|
-
char serr [AS_MAXCH] = "";
|
|
26
|
-
int32 flag = swe_lun_occult_when_loc(
|
|
27
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
28
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
29
|
-
info[2].IsString() ? (char*)info[2].As<Napi::String>().Utf8Value().c_str() : NULL,
|
|
30
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
31
|
-
geopos,
|
|
32
|
-
ret,
|
|
33
|
-
attr,
|
|
34
|
-
info[5].As<Napi::Boolean>(),
|
|
35
|
-
serr
|
|
36
|
-
);
|
|
37
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
38
|
-
obj["flag"] = flag;
|
|
39
|
-
obj["error"] = serr;
|
|
40
|
-
obj["data"] = sweph_js_array_converter(ret, 7, env);
|
|
41
|
-
obj["attributes"] = sweph_js_array_converter(attr, 8, env);
|
|
42
|
-
return obj;
|
|
43
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 4, "Expecting 4 arguments: tjd_ut, ipl, starname, ifl" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - julian day in universal time" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - target object ID" },
|
|
7
|
-
{ STRINGNULL, "Argument 3 should be a string or NULL - target star name" },
|
|
8
|
-
{ NUMBER, "Argument 4 should be a number - ephemeris flag" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
Napi::Value sweph_lun_occult_where(const Napi::CallbackInfo& info) {
|
|
12
|
-
Napi::Env env = info.Env();
|
|
13
|
-
if(!sweph_type_check(args, info)) {
|
|
14
|
-
return env.Null();
|
|
15
|
-
}
|
|
16
|
-
double geopos [10];
|
|
17
|
-
double attr [20];
|
|
18
|
-
char serr [AS_MAXCH] = "";
|
|
19
|
-
int32 flag = swe_lun_occult_where(
|
|
20
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
21
|
-
info[1].As<Napi::Number>().Int32Value(),
|
|
22
|
-
info[2].IsString() ? (char*)info[2].As<Napi::String>().Utf8Value().c_str() : NULL,
|
|
23
|
-
info[3].As<Napi::Number>().Int32Value(),
|
|
24
|
-
geopos,
|
|
25
|
-
attr,
|
|
26
|
-
serr
|
|
27
|
-
);
|
|
28
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
29
|
-
obj["flag"] = flag;
|
|
30
|
-
obj["error"] = serr;
|
|
31
|
-
obj["data"] = sweph_js_array_converter(geopos, 10, env);
|
|
32
|
-
obj["attributes"] = sweph_js_array_converter(attr, 8, env);
|
|
33
|
-
return obj;
|
|
34
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#include <sweph.h>
|
|
2
|
-
|
|
3
|
-
constexpr std::pair<int, const char*> args[] = {
|
|
4
|
-
{ 3, "Expecting 3 arguments: x2cross, jd_et, flag" },
|
|
5
|
-
{ NUMBER, "Argument 1 should be a number - longitude position to search for" },
|
|
6
|
-
{ NUMBER, "Argument 2 should be a number - start time in julian day in ephemeris/terrestrial time" },
|
|
7
|
-
{ NUMBER, "Argument 3 should be a number - calculation flag" }
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
Napi::Value sweph_mooncross(const Napi::CallbackInfo& info) {
|
|
11
|
-
Napi::Env env = info.Env();
|
|
12
|
-
if(!sweph_type_check(args, info)) {
|
|
13
|
-
return env.Null();
|
|
14
|
-
}
|
|
15
|
-
char serr [AS_MAXCH] = "";
|
|
16
|
-
double jd_et = swe_mooncross(
|
|
17
|
-
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
|
-
info[1].As<Napi::Number>().DoubleValue(),
|
|
19
|
-
info[2].As<Napi::Number>().Int32Value(),
|
|
20
|
-
serr
|
|
21
|
-
);
|
|
22
|
-
Napi::Object obj = Napi::Object::New(env);
|
|
23
|
-
obj["date"] = jd_et;
|
|
24
|
-
obj["error"] = serr;
|
|
25
|
-
return obj;
|
|
26
|
-
}
|