Skip to content

Commit

Permalink
fix(client): Do not use module on client
Browse files Browse the repository at this point in the history
  • Loading branch information
TasoOneAsia committed Oct 5, 2021
1 parent 257aacb commit 04f3476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/client/cl_utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { v4 as uuidv4 } from "uuid";
import { uuidV4 } from "./functions";
import { ClientUtilSettings, ClientUtilsParams, NuiCallbackFunc, RPCListenerCb } from "../types";


Expand Down Expand Up @@ -44,7 +44,7 @@ export class ClientUtils {
reject(`${eventName} has timed out after ${this._settings.promiseTimeout} ms`);
}, this._settings.promiseTimeout);

const uniqId = uuidv4();
const uniqId = uuidV4();

const listenEventName = `${eventName}:${uniqId}`;

Expand Down
3 changes: 2 additions & 1 deletion src/client/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export const RegisterNuiCB = <T = any>(event: string, callback: CallbackFn<T>):
};


// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const uuidV4 = (options, buf, offset) => {
export const uuidV4 = (options?: any, buf?: any, offset?: any) => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
const r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
Expand Down

0 comments on commit 04f3476

Please sign in to comment.