@elite-dangerous-plugin-framework/journal 0.20250914.0 → 0.20260201.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/README.md +79 -1
- package/dist/generated/CancelledSquadronApplication.bi.d.ts +24 -0
- package/dist/generated/CancelledSquadronApplication.d.ts +24 -0
- package/dist/generated/CompleteConstruction.bi.d.ts +22 -0
- package/dist/generated/CompleteConstruction.d.ts +22 -0
- package/dist/generated/Docked.bi.d.ts +1 -1
- package/dist/generated/Docked.d.ts +1 -1
- package/dist/generated/PowerplayMerits.bi.d.ts +1 -1
- package/dist/generated/PowerplayMerits.d.ts +1 -1
- package/dist/generated/PowerplayRank.bi.d.ts +1 -1
- package/dist/generated/PowerplayRank.d.ts +1 -1
- package/dist/generated/Scan.bi.d.ts +2 -0
- package/dist/generated/Scan.d.ts +2 -0
- package/dist/generated/ScanOrganic.bi.d.ts +2 -0
- package/dist/generated/ScanOrganic.d.ts +2 -0
- package/dist/generated/SendText.bi.d.ts +5 -0
- package/dist/generated/SendText.d.ts +5 -0
- package/dist/generated/SquadronApplicationApproved.bi.d.ts +24 -0
- package/dist/generated/SquadronApplicationApproved.d.ts +24 -0
- package/dist/generated/SquadronApplicationRejected.bi.d.ts +24 -0
- package/dist/generated/SquadronApplicationRejected.d.ts +24 -0
- package/dist/generated/Status.bi.d.ts +98 -0
- package/dist/generated/Status.d.ts +98 -0
- package/dist/generated/index.d.ts +494 -486
- package/dist/index.js +16 -2
- package/dist/index.js.map +7 -4
- package/package.json +1649 -12
package/dist/index.js
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
function parseWithLossyIntegers(event) {
|
|
3
|
+
return JSON.parse(event);
|
|
4
|
+
}
|
|
5
|
+
function parseWithBigInt(event) {
|
|
6
|
+
return JSON.parse(event, (k, v, { source }) => {
|
|
7
|
+
const isInteger = /^-?\d+$/.test(source ?? "");
|
|
8
|
+
return isInteger ? BigInt(source) : v;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
parseWithLossyIntegers,
|
|
13
|
+
parseWithBigInt
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//# debugId=961FDE029D2549BE64756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { JournalEvent, JournalEvent_BI } from \"./generated/index.js\";\n\n/**\n * Use this converter if you do not care about precision of numbers - primarily if you do not need to handle IDs (e.g. System Adresses).\n *\n * It will treat **any** number as a IEEE 754 64 bit Float. This way integers are precise up to 15 digits, which is not enough for IDs. In these cases,\n * use {@link parseWithBigInt} if large Integers matter.\n */\nexport function parseWithLossyIntegers(event: string): JournalEvent {\n return JSON.parse(event);\n}\n\n/**\n * Converts a Journal Entry to a Journal Event with *all* Integers replaced with BigInts.\n * An Item is considered an integer if it consists of at least one numerical (0..9), which can be prefixed by a `-`.\n * Trailing `.` or `.0` cause the item to be treated as a regular IEEE 754 64 bit Float.\n *\n * Use this if you need to work with System Addresses. Working with BigInt's is a bit more annoying as you cannot directly use some std library functions.\n */\nexport function parseWithBigInt(event: string): JournalEvent_BI {\n return JSON.parse(event, ((k: any, v: any, { source }: any) => {\n const isInteger = /^-?\\d+$/.test(source ?? \"\");\n return isInteger ? BigInt(source) : v;\n }) as any);\n}\n\nexport { type JournalEvent, type JournalEvent_BI };\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAQO,SAAS,sBAAsB,CAAC,OAA6B;AAAA,EAClE,OAAO,KAAK,MAAM,KAAK;AAAA;AAUlB,SAAS,eAAe,CAAC,OAAgC;AAAA,EAC9D,OAAO,KAAK,MAAM,OAAQ,CAAC,GAAQ,KAAU,aAAkB;AAAA,IAC7D,MAAM,YAAY,UAAU,KAAK,UAAU,EAAE;AAAA,IAC7C,OAAO,YAAY,OAAO,MAAM,IAAI;AAAA,GAC7B;AAAA;",
|
|
8
|
+
"debugId": "961FDE029D2549BE64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|