MCPcopy
hub / github.com/CapSoftware/Cap / normalizeMicrophoneSettings

Function normalizeMicrophoneSettings

apps/chrome-extension/src/shared/storage.ts:640–658  ·  view source on GitHub ↗
(
	value: unknown,
)

Source from the content-addressed store, hash-verified

638};
639
640const normalizeMicrophoneSettings = (
641 value: unknown,
642): ExtensionSettings["microphone"] => {
643 const microphone =
644 value && typeof value === "object"
645 ? (value as Partial<ExtensionSettings["microphone"]>)
646 : {};
647 return {
648 enabled:
649 typeof microphone.enabled === "boolean"
650 ? microphone.enabled
651 : defaultSettings.microphone.enabled,
652 deviceId:
653 typeof microphone.deviceId === "string" &&
654 microphone.deviceId.trim().length > 0
655 ? microphone.deviceId
656 : null,
657 };
658};
659
660const normalizeSoundSettings = (
661 value: unknown,

Callers 1

loadSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected