config.plistValue
Checks value is Info.plist data; fail reports the key at fault.
Utilização
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);Assinaturas
(value: unknown, key: string, fail: (key: string, message: string) => never): PlistValueParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
value | unknown | Sim | — |
key | string | Sim | — |
fail | (key: string, message: string) => never | Sim | — |
Devolve
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.