chamesu
Version:
This package contains all packages of the chat application.
32 lines (27 loc) • 674 B
text/typescript
/*
* Copyright (c) 2022.
* Author Peter Placzek (tada5hi)
* For the full copyright and license information,
* view the LICENSE file that was distributed with this source code.
*/
export function createSocketErrorResponse(callback: CallableFunction, message?: string, code?: string) {
if(typeof callback === 'undefined') {
return;
}
callback({
success: false,
error: {
message,
code
}
});
}
export function createSocketResponse(callback: CallableFunction, data?: any) {
if(typeof callback === 'undefined') {
return;
}
callback({
success: true,
data
})
}