lenix 1.8.4 → 1.8.5

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 (2) hide show
  1. package/nui/fetch.ts +7 -4
  2. package/package.json +1 -1
package/nui/fetch.ts CHANGED
@@ -30,8 +30,11 @@ export const fetchNuiServer = async <T extends NuiFetchGeneric>(
30
30
  timeout?: number,
31
31
  ): Promise<T[0]> => {
32
32
  const { data, error } = await fetchNui<Request<{
33
- data: T[0] | null
34
- error: string | null
33
+ data: T[0]
34
+ error: null
35
+ } | {
36
+ data: null
37
+ error: string
35
38
  }, '__nuiServer', {
36
39
  id: T[1]
37
40
  data: {
@@ -46,11 +49,11 @@ export const fetchNuiServer = async <T extends NuiFetchGeneric>(
46
49
  requestData,
47
50
  }
48
51
  })
49
- if (error) {
52
+ if (error !== null) {
50
53
  const typeofError = typeof error
51
54
  if (typeofError === 'string') throw error
52
55
 
53
- console.log(palette('wine', `Expected 'error' typeof 'string', got ${error} typeof ${typeofError}`))
56
+ throw `Expected 'error' typeof 'string', got ${error} typeof ${typeofError}`
54
57
  }
55
58
 
56
59
  return data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lenix",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "Typed FiveM utilities for client, server, shared, and NUI scripts",
5
5
  "author": "Lenix",
6
6
  "license": "MIT",