FilesystemConfigSchema top-level property

ConfigSchema<FilesystemConfig> FilesystemConfigSchema
final

Filesystem configuration schema for validation

Implementation

final ConfigSchema<FilesystemConfig> FilesystemConfigSchema = _notNull((
  value,
  issues,
  path,
) {
  final obj = _object(value, path, issues);
  if (obj == null) return null;
  final disabled = _has(obj, 'disabled')
      ? _boolean(obj['disabled'], [...path, 'disabled'], issues)
      : null;
  final denyRead = _pathEntryList(obj['denyRead'], [
    ...path,
    'denyRead',
  ], issues);
  final allowRead = _has(obj, 'allowRead')
      ? _pathEntryList(obj['allowRead'], [...path, 'allowRead'], issues)
      : null;
  final allowWrite = _pathEntryList(obj['allowWrite'], [
    ...path,
    'allowWrite',
  ], issues);
  final denyWrite = _pathEntryList(obj['denyWrite'], [
    ...path,
    'denyWrite',
  ], issues);
  final allowGitConfig = _has(obj, 'allowGitConfig')
      ? _boolean(obj['allowGitConfig'], [...path, 'allowGitConfig'], issues)
      : null;
  if (denyRead == null || allowWrite == null || denyWrite == null) return null;
  return FilesystemConfig(
    disabled: disabled,
    denyRead: denyRead,
    allowRead: allowRead,
    allowWrite: allowWrite,
    denyWrite: denyWrite,
    allowGitConfig: allowGitConfig,
  );
});