@trippler/tr_lib 2.7.4 → 2.8.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trippler/tr_lib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "A lightweight utility & helper library for FiveM developers. Designed to improve code reusability, consistency, and performance across and outcross Trippler resources.",
|
|
5
5
|
"author": "Trippler",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -28,7 +28,9 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
|
-
"patch": "
|
|
31
|
+
"patch": "npm run rebuild && npm version patch && npm publish",
|
|
32
|
+
"minor": "npm run rebuild && npm version minor && npm publish",
|
|
33
|
+
"rebuild": "rmdir /s /q client server shared web 2>nul & npm run build",
|
|
32
34
|
"build": "npm run build:shared && npm run build:client && npm run build:server && npm run build:web",
|
|
33
35
|
"build:client": "npx tsc -p src/client/tsconfig.json",
|
|
34
36
|
"build:server": "npx tsc -p src/server/tsconfig.json",
|
|
@@ -2,7 +2,7 @@ import { fatal } from "../../shared";
|
|
|
2
2
|
export default (name, Function) => {
|
|
3
3
|
const handler = (event) => {
|
|
4
4
|
const { __name, params } = event.data;
|
|
5
|
-
if (__name === name
|
|
5
|
+
if (__name === name) {
|
|
6
6
|
try {
|
|
7
7
|
Function(...params);
|
|
8
8
|
}
|
|
@@ -10,9 +10,6 @@ export default (name, Function) => {
|
|
|
10
10
|
fatal(`Error in '${name}' callback: ${error}`);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
else {
|
|
14
|
-
fatal(`Received invalid message in '${name}' callback: ${JSON.stringify(event.data)}`);
|
|
15
|
-
}
|
|
16
13
|
};
|
|
17
14
|
window.addEventListener('message', handler);
|
|
18
15
|
return () => window.removeEventListener('message', handler);
|