ootk 2.0.1 → 3.0.0
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/.eslintrc.json +4 -4
- package/.prettierrc +17 -0
- package/babel.config.js +16 -0
- package/dist/objects/detailed-sat.d.ts +3 -3
- package/dist/objects/sat.d.ts +4 -4
- package/dist/objects/sensor.d.ts +8 -2
- package/dist/objects/star.d.ts +8 -8
- package/dist/ootk.d.ts +0 -1
- package/dist/ootk.js +1 -1
- package/dist/sgp4/sgp4.d.ts +9 -9
- package/dist/tle/tle.d.ts +25 -24
- package/dist/transforms/transforms.d.ts +40 -1
- package/dist/types/types.d.ts +417 -92
- package/dist/utils/moon-math.d.ts +18 -18
- package/dist/utils/sun-math.d.ts +118 -118
- package/dist/utils/utils.d.ts +6 -6
- package/jest.config.ts +30 -0
- package/lib/objects/base-object.js +33 -63
- package/lib/objects/base-object.js.map +1 -1
- package/lib/objects/detailed-sat.d.ts +3 -3
- package/lib/objects/detailed-sat.js.map +1 -1
- package/lib/objects/sat.d.ts +4 -4
- package/lib/objects/sat.js +1 -1
- package/lib/objects/sat.js.map +1 -1
- package/lib/objects/sensor.d.ts +8 -2
- package/lib/objects/sensor.js +51 -33
- package/lib/objects/sensor.js.map +1 -1
- package/lib/objects/space-object.js.map +1 -1
- package/lib/objects/star.d.ts +8 -8
- package/lib/objects/star.js +4 -4
- package/lib/objects/star.js.map +1 -1
- package/lib/ootk.d.ts +0 -1
- package/lib/ootk.js +0 -1
- package/lib/ootk.js.map +1 -1
- package/lib/sgp4/sgp4.d.ts +9 -9
- package/lib/sgp4/sgp4.js +15 -27
- package/lib/sgp4/sgp4.js.map +1 -1
- package/lib/tle/tle.d.ts +25 -24
- package/lib/tle/tle.js +4 -4
- package/lib/tle/tle.js.map +1 -1
- package/lib/transforms/transforms.d.ts +40 -1
- package/lib/transforms/transforms.js +100 -1
- package/lib/transforms/transforms.js.map +1 -1
- package/lib/types/types.d.ts +417 -92
- package/lib/types/types.js +3 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/moon-math.d.ts +18 -18
- package/lib/utils/moon-math.js +45 -45
- package/lib/utils/moon-math.js.map +1 -1
- package/lib/utils/sun-math.d.ts +118 -118
- package/lib/utils/sun-math.js +237 -237
- package/lib/utils/sun-math.js.map +1 -1
- package/lib/utils/utils.d.ts +6 -6
- package/lib/utils/utils.js +17 -15
- package/lib/utils/utils.js.map +1 -1
- package/package.json +19 -35
- package/tsconfig.base.json +31 -0
- package/tsconfig.build.json +14 -0
- package/dist/sgp4/Sgp4Assembly.d.ts +0 -5
- package/lib/sgp4/Sgp4Assembly.d.ts +0 -5
- package/lib/sgp4/Sgp4Assembly.js +0 -75
- package/lib/sgp4/Sgp4Assembly.js.map +0 -1
package/lib/utils/utils.js
CHANGED
|
@@ -26,6 +26,13 @@ import { SunMath } from './sun-math';
|
|
|
26
26
|
var Utils = /** @class */ (function () {
|
|
27
27
|
function Utils() {
|
|
28
28
|
}
|
|
29
|
+
Utils.createVec = function (start, stop, step) {
|
|
30
|
+
var array = [];
|
|
31
|
+
for (var i = start; i <= stop; i += step) {
|
|
32
|
+
array.push(i);
|
|
33
|
+
}
|
|
34
|
+
return array;
|
|
35
|
+
};
|
|
29
36
|
Utils.distance = function (pos1, pos2) {
|
|
30
37
|
return Math.sqrt(Math.pow((pos1.x - pos2.x), 2) + Math.pow((pos1.y - pos2.y), 2) + Math.pow((pos1.z - pos2.z), 2));
|
|
31
38
|
};
|
|
@@ -44,14 +51,7 @@ var Utils = /** @class */ (function () {
|
|
|
44
51
|
z: velocity.z,
|
|
45
52
|
};
|
|
46
53
|
var rangeRate = (range.x * rangeVel.x + range.y * rangeVel.y + range.z * rangeVel.z) / distance;
|
|
47
|
-
return (1 + (rangeRate / c) * Utils.
|
|
48
|
-
};
|
|
49
|
-
Utils.createVec = function (start, stop, step) {
|
|
50
|
-
var array = [];
|
|
51
|
-
for (var i = start; i <= stop; i += step) {
|
|
52
|
-
array.push(i);
|
|
53
|
-
}
|
|
54
|
-
return array;
|
|
54
|
+
return (1 + (rangeRate / c) * Utils.sign_(rangeRate));
|
|
55
55
|
};
|
|
56
56
|
Utils.getDayOfYear = function (date) {
|
|
57
57
|
date = date || new Date();
|
|
@@ -59,12 +59,15 @@ var Utils = /** @class */ (function () {
|
|
|
59
59
|
var mn = date.getMonth();
|
|
60
60
|
var dn = date.getUTCDate();
|
|
61
61
|
var dayOfYear = dayCount[mn] + dn;
|
|
62
|
-
if (mn > 1 && Utils.
|
|
62
|
+
if (mn > 1 && Utils.isLeapYear_(date)) {
|
|
63
63
|
dayOfYear++;
|
|
64
64
|
}
|
|
65
65
|
return dayOfYear;
|
|
66
66
|
};
|
|
67
|
-
Utils.
|
|
67
|
+
Utils.roundToNDecimalPlaces = function (value, places) {
|
|
68
|
+
return Math.round(value * Math.pow(10, places)) / Math.pow(10, places);
|
|
69
|
+
};
|
|
70
|
+
Utils.isLeapYear_ = function (dateIn) {
|
|
68
71
|
var year = dateIn.getUTCFullYear();
|
|
69
72
|
// eslint-disable-next-line no-bitwise
|
|
70
73
|
if ((year & 3) !== 0) {
|
|
@@ -72,11 +75,12 @@ var Utils = /** @class */ (function () {
|
|
|
72
75
|
}
|
|
73
76
|
return year % 100 !== 0 || year % 400 === 0;
|
|
74
77
|
};
|
|
75
|
-
Utils.
|
|
76
|
-
return
|
|
78
|
+
Utils.sign_ = function (value) {
|
|
79
|
+
return value >= 0 ? 1 : -1;
|
|
77
80
|
};
|
|
81
|
+
Utils.MoonMath = MoonMath;
|
|
82
|
+
Utils.SunMath = SunMath;
|
|
78
83
|
Utils.Types = Types;
|
|
79
|
-
Utils.sign = function (value) { return (value >= 0 ? 1 : -1); };
|
|
80
84
|
// eslint-disable-next-line max-params
|
|
81
85
|
Utils.jday = function (year, mon, day, hr, minute, sec) {
|
|
82
86
|
if (!year) {
|
|
@@ -92,8 +96,6 @@ var Utils = /** @class */ (function () {
|
|
|
92
96
|
1721013.5 +
|
|
93
97
|
((sec / 60.0 + minute) / 60.0 + hr) / 24.0);
|
|
94
98
|
};
|
|
95
|
-
Utils.SunMath = SunMath;
|
|
96
|
-
Utils.MoonMath = MoonMath;
|
|
97
99
|
return Utils;
|
|
98
100
|
}());
|
|
99
101
|
export { Utils };
|
package/lib/utils/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;IAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;IAAA;IA8FA,CAAC;IArEQ,eAAS,GAAhB,UAAiB,KAAa,EAAE,IAAY,EAAE,IAAY;QACxD,IAAM,KAAK,GAAG,EAAE,CAAC;QAEjB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE;YACxC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACf;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,cAAQ,GAAf,UAAgB,IAAa,EAAE,IAAa;QAC1C,OAAmB,IAAI,CAAC,IAAI,CAAC,SAAA,CAAC,IAAI,CA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"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Orbital Object Toolkit including SGP4 Propagator and Coordinate Transforms",
|
|
5
5
|
"main": "dist/ootk.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "node ./scripts/cleanup.js && tsc -p tsconfig.json && node --openssl-legacy-provider node_modules/webpack/bin/webpack.js --config ./scripts/webpack.js",
|
|
8
|
-
"build:legacy": "node ./scripts/cleanup.js && tsc && node node_modules/webpack/bin/webpack.js --config ./scripts/webpack.js",
|
|
9
|
-
"
|
|
10
|
-
"asbuild:release": "asc src/sgp4/asc/assembly/index.ts --target release",
|
|
11
|
-
"asbuild": "npm run asbuild:debug && npm run asbuild:release",
|
|
7
|
+
"build": "node ./scripts/cleanup.js && tsc -p tsconfig.build.json && node --openssl-legacy-provider node_modules/webpack/bin/webpack.js --config ./scripts/webpack.js",
|
|
8
|
+
"build:legacy": "node ./scripts/cleanup.js && tsc -p tsconfig.build.json && node node_modules/webpack/bin/webpack.js --config ./scripts/webpack.js",
|
|
9
|
+
"lcov": "node ./scripts/openLcov.mjs",
|
|
12
10
|
"lint": "eslint src",
|
|
13
11
|
"lint:fix": "eslint src --fix",
|
|
14
12
|
"lint:test": "eslint test",
|
|
15
13
|
"sandbox": "http-server ./",
|
|
16
|
-
"test": "jest
|
|
17
|
-
"test:coverage": "jest --coverage
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"test:coverage": "jest --coverage",
|
|
18
16
|
"test:performance": "node test/performance/timing.test.mjs",
|
|
19
17
|
"version": "auto-changelog -p && git add CHANGELOG.md"
|
|
20
18
|
},
|
|
@@ -34,41 +32,28 @@
|
|
|
34
32
|
"bugs": {
|
|
35
33
|
"url": "https://github.com/thkruz/ootk/issues"
|
|
36
34
|
},
|
|
37
|
-
"prettier": {
|
|
38
|
-
"printWidth": 120,
|
|
39
|
-
"tabWidth": 2,
|
|
40
|
-
"useTabs": false,
|
|
41
|
-
"semi": true,
|
|
42
|
-
"singleQuote": true,
|
|
43
|
-
"quoteProps": "consistent",
|
|
44
|
-
"trailingComma": "all",
|
|
45
|
-
"bracketSpacing": true,
|
|
46
|
-
"arrowParens": "always",
|
|
47
|
-
"requirePragma": false,
|
|
48
|
-
"insertPragma": false,
|
|
49
|
-
"proseWrap": "never",
|
|
50
|
-
"htmlWhitespaceSensitivity": "ignore",
|
|
51
|
-
"endOfLine": "lf",
|
|
52
|
-
"embeddedLanguageFormatting": "off"
|
|
53
|
-
},
|
|
54
35
|
"devDependencies": {
|
|
55
|
-
"@babel/core": "^7.
|
|
56
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
57
|
-
"@babel/preset-env": "^7.
|
|
58
|
-
"@
|
|
36
|
+
"@babel/core": "^7.22.9",
|
|
37
|
+
"@babel/plugin-transform-runtime": "^7.22.9",
|
|
38
|
+
"@babel/preset-env": "^7.22.9",
|
|
39
|
+
"@babel/preset-typescript": "^7.22.5",
|
|
40
|
+
"@types/jest": "^28.1.8",
|
|
59
41
|
"@types/node-fetch": "^2.6.2",
|
|
60
42
|
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
61
43
|
"@typescript-eslint/parser": "^5.54.0",
|
|
62
|
-
"assemblyscript": "^0.20.19",
|
|
63
44
|
"auto-changelog": "^2.2.1",
|
|
64
45
|
"babel-eslint": "^10.1.0",
|
|
65
|
-
"babel-loader": "^8.
|
|
46
|
+
"babel-loader": "^8.3.0",
|
|
66
47
|
"codecov": "^3.8.1",
|
|
67
48
|
"copy-webpack-plugin": "^11.0.0",
|
|
68
49
|
"eslint": "^7.32.0",
|
|
69
|
-
"
|
|
50
|
+
"imports-loader": "^4.0.1",
|
|
51
|
+
"jest": "^28.1.3",
|
|
70
52
|
"node-fetch": "^2.6.7",
|
|
71
|
-
"
|
|
53
|
+
"opener": "^1.5.2",
|
|
54
|
+
"prettier": "^2.8.8",
|
|
55
|
+
"prettier-plugin-organize-imports": "^3.2.3",
|
|
56
|
+
"ts-node": "^10.9.1",
|
|
72
57
|
"typescript": "^4.9.5",
|
|
73
58
|
"webpack": "^5.11.1",
|
|
74
59
|
"webpack-cli": "^4.10.0"
|
|
@@ -77,7 +62,6 @@
|
|
|
77
62
|
"directories": {
|
|
78
63
|
"lib": "lib",
|
|
79
64
|
"src": "src",
|
|
80
|
-
"test": "test"
|
|
81
|
-
"wasm": "asc/build"
|
|
65
|
+
"test": "test"
|
|
82
66
|
}
|
|
83
67
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"typeAcquisition": {
|
|
3
|
+
"enable": true
|
|
4
|
+
},
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"target": "es5",
|
|
7
|
+
"module": "es6",
|
|
8
|
+
"lib": ["esnext"],
|
|
9
|
+
"declaration": true,
|
|
10
|
+
// "noImplicitAny": true,
|
|
11
|
+
// "removeComments": true,
|
|
12
|
+
"baseUrl": ".",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@lib/*": ["lib/*"],
|
|
15
|
+
"@dist/*": ["dist/*"],
|
|
16
|
+
"@src/*": ["src/*"],
|
|
17
|
+
"@test/*": ["test/*"]
|
|
18
|
+
},
|
|
19
|
+
"allowJs": true,
|
|
20
|
+
"experimentalDecorators": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"sourceMap": true,
|
|
23
|
+
"listFiles": true,
|
|
24
|
+
"newLine": "LF",
|
|
25
|
+
"skipLibCheck": true,
|
|
26
|
+
// "noEmitOnError": true,
|
|
27
|
+
"types": ["jest", "node"],
|
|
28
|
+
"moduleResolution": "Node",
|
|
29
|
+
"esModuleInterop": true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the tsconfig extension that only applies to webpack.
|
|
3
|
+
*/
|
|
4
|
+
{
|
|
5
|
+
"extends": "./tsconfig.base.json",
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"outDir": "./lib" /* Redirect output structure to the directory. */,
|
|
8
|
+
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
9
|
+
},
|
|
10
|
+
"include": ["./src/**/*.ts"],
|
|
11
|
+
"filesGlob": ["./src/**/*.ts"],
|
|
12
|
+
"ignorePatterns": ["./src/sgp4/asc/**/*.ts"],
|
|
13
|
+
"exclude": ["./src/sgp4/asc/assembly/index.ts"]
|
|
14
|
+
}
|
package/lib/sgp4/Sgp4Assembly.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { Sgp4 } from './sgp4';
|
|
38
|
-
var Sgp4Assembly = /** @class */ (function () {
|
|
39
|
-
function Sgp4Assembly() {
|
|
40
|
-
}
|
|
41
|
-
Sgp4Assembly.prototype.propagateWasm = function () {
|
|
42
|
-
var TLE1 = '1 25544U 98067A 21284.51782528 .00016738 00000-0 10270-3 0 9033';
|
|
43
|
-
var TLE2 = '2 25544 51.6443 82.9991 0004256 95.9687 15.0739 15.48978733306954';
|
|
44
|
-
var satrec = Sgp4.createSatrec(TLE1, TLE2);
|
|
45
|
-
var propagate = this.module.instance.exports.propagate;
|
|
46
|
-
var tsince = 30;
|
|
47
|
-
// eslint-disable-next-line no-console
|
|
48
|
-
console.log(propagate(satrec.a, satrec.am, satrec.alta, satrec.altp, satrec.argpdot, satrec.argpo, satrec.aycof, satrec.bstar, satrec.cc1, satrec.cc4, satrec.cc5, satrec.con41, satrec.d2, satrec.d3, satrec.d4, satrec.d5232, satrec.d5421, satrec.d5433, satrec.dedt, satrec.delmo, satrec.del1, satrec.ecco, satrec.em, satrec.epochdays, satrec.epochyr, satrec.error, satrec.eta, satrec.gsto, satrec.im, satrec.inclo, satrec.init, satrec.isimp, satrec.jdsatepoch, satrec.mdot, satrec.method, satrec.mo, satrec.mm, satrec.nddot, satrec.ndot, satrec.no, satrec.nodecf, satrec.nodedot, satrec.nodeo, satrec.om, satrec.Om, satrec.omgcof, satrec.operationmode, satrec.satnum, satrec.sinmao, satrec.t, satrec.t2cof, satrec.t3cof, satrec.t4cof, satrec.t5cof, satrec.x1mth2, satrec.x7thm1, satrec.xlcof, satrec.xmcof, satrec.xfact, satrec.xlamo, satrec.xli, satrec.xgh4, satrec.xgh3, satrec.xh2, satrec.xi2, satrec.xi3, satrec.xl2, satrec.xl3, satrec.xl4, satrec.zmol, satrec.zmos, satrec.dmdt, satrec.dnodt, satrec.domdt, satrec.e3, satrec.ee2, satrec.peo, satrec.pgho, satrec.pho, satrec.PInco, satrec.plo, satrec.se2, satrec.se3, satrec.sgh2, satrec.sgh3, satrec.sgh4, satrec.sh2, satrec.sh3, satrec.si2, satrec.si3, satrec.sl2, satrec.sl3, satrec.sl4, satrec.xgh2, satrec.xh3, satrec.tumin, satrec.radiusearthkm, satrec.irez, satrec.d3210, satrec.d3222, satrec.d4410, satrec.d4422, satrec.d5220, satrec.del2, satrec.del3, satrec.didt, satrec.atime, satrec.j2, satrec.j3, satrec.j4, satrec.mus, satrec.xke, satrec.j3oj2, satrec.xni, satrec.d2201, satrec.d2211, satrec.nm, tsince));
|
|
49
|
-
};
|
|
50
|
-
Sgp4Assembly.prototype.loadWasm = function (path) {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
52
|
-
var imports, _a;
|
|
53
|
-
return __generator(this, function (_b) {
|
|
54
|
-
switch (_b.label) {
|
|
55
|
-
case 0:
|
|
56
|
-
imports = {
|
|
57
|
-
env: {
|
|
58
|
-
abort: function (_msg, _file, line, column) {
|
|
59
|
-
throw Error("abort called at ".concat(line, ":").concat(column));
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
_a = this;
|
|
64
|
-
return [4 /*yield*/, WebAssembly.instantiateStreaming(fetch(path), imports)];
|
|
65
|
-
case 1:
|
|
66
|
-
_a.module = (_b.sent());
|
|
67
|
-
return [2 /*return*/];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
return Sgp4Assembly;
|
|
73
|
-
}());
|
|
74
|
-
export { Sgp4Assembly };
|
|
75
|
-
//# sourceMappingURL=Sgp4Assembly.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sgp4Assembly.js","sourceRoot":"","sources":["../../src/sgp4/Sgp4Assembly.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAyI9B;IAAA;IAqJA,CAAC;IAlJQ,oCAAa,GAApB;QACE,IAAM,IAAI,GAAG,uEAAuE,CAAC;QACrF,IAAM,IAAI,GAAG,uEAAuE,CAAC;QAErF,IAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAErC,IAAA,SAAS,GAAK,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,UAAjC,CAAkC;QAEnD,IAAM,MAAM,GAAG,EAAE,CAAC;QAElB,sCAAsC;QACtC,OAAO,CAAC,GAAG,CACT,SAAS,CACP,MAAM,CAAC,CAAC,EACR,MAAM,CAAC,EAAE,EACT,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,KAAK,EACZ,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