* Load and parse a YAML file * @param {string} filePath - Path to the YAML file * @returns {object|null} Parsed YAML object or null on error
(filePath)
| 28 | * @returns {object|null} Parsed YAML object or null on error |
| 29 | */ |
| 30 | function loadYamlFile(filePath) { |
| 31 | try { |
| 32 | const content = fs.readFileSync(filePath, 'utf8'); |
| 33 | return yaml.load(content); |
| 34 | } catch (err) { |
| 35 | console.error(`Error reading ${filePath}: ${err.message}`); |
| 36 | return null; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Validate a single file |