config.plistValue
Checks value is Info.plist data; fail reports the key at fault.
Verwendung
Validate an Info.plist value supplied to a configuration tool.
// Validate an Info.plist value supplied to a configuration tool.
import { plistValue, type PlistDictionary } from 'kuito/config';
const settings: PlistDictionary = { UIFileSharingEnabled: true };
const checked = plistValue(settings, 'ios.infoPlist', (key, message) => {
throw new Error(`${key}: ${message}`);
});
console.log(checked);Signaturen
(value: unknown, key: string, fail: (key: string, message: string) => never): PlistValueParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
value | unknown | Ja | — |
key | string | Ja | — |
fail | (key: string, message: string) => never | Ja | — |
Rückgabe
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.