feat(packages/shared): add logger factory

- @revanced/websocket-api now also utilizes the new logger from the shared package
- @revanced/websocket-api/utils/checkEnv has been renamed to its full form
  - It also no longer returns anything as it's no longer needed
This commit is contained in:
PalmDevs
2023-11-29 00:52:17 +07:00
parent f2d85c32a4
commit 17c6be7bee
20 changed files with 179 additions and 234 deletions

View File

@@ -15,11 +15,7 @@ import {
// merge
} from 'valibot'
import DisconnectReason from '../constants/DisconnectReason.js'
import {
ClientOperation,
Operation,
ServerOperation,
} from '../constants/Operation.js'
import { ClientOperation, Operation, ServerOperation } from '../constants/Operation.js'
/**
* Schema to validate packets
@@ -59,10 +55,7 @@ export const PacketDataSchemas = {
labels: array(
object({
name: string(),
confidence: special<number>(
input =>
typeof input === 'number' && input >= 0 && input <= 1,
),
confidence: special<number>(input => typeof input === 'number' && input >= 0 && input <= 1),
}),
),
}),