MCPcopy Index your code
hub / github.com/CapSoftware/Cap / normalizeSoundSettings

Function normalizeSoundSettings

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

Source from the content-addressed store, hash-verified

658};
659
660const normalizeSoundSettings = (
661 value: unknown,
662): ExtensionSettings["sounds"] => {
663 const sounds =
664 value && typeof value === "object"
665 ? (value as Partial<ExtensionSettings["sounds"]>)
666 : {};
667
668 return {
669 enabled:
670 typeof sounds.enabled === "boolean"
671 ? sounds.enabled
672 : defaultSettings.sounds.enabled,
673 };
674};
675
676// Only 3/5/10 are offered in the UI, but any positive integer is accepted so a
677// hand-edited or future value is not silently reset to the default.

Callers 1

loadSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected