mirror of
https://github.com/directus/directus.git
synced 2026-01-30 19:37:55 -05:00
* Declare return types on functions And a very few other type related minor fixes * Minor syntax fixes * Remove unnecessary escape chars in regexes * Remove unnecessary awaits * Replace deprecated req.connection with req.socket * Replace deprecated upload with uploadOne * Remove unnecessary eslint-disable-next-line comments * Comment empty functions / catch or finally clauses * Fix irregular whitespaces * Add missing returns (null) * Remove unreachable code * A few logical fixes * Remove / Handle non-null assertions which are certainly unnecessary (e.g. in tests)
9 lines
233 B
TypeScript
9 lines
233 B
TypeScript
import fse from 'fs-extra';
|
|
import yaml from 'js-yaml';
|
|
|
|
export function requireYAML(filepath: string): Record<string, any> {
|
|
const yamlRaw = fse.readFileSync(filepath, 'utf8');
|
|
|
|
return yaml.load(yamlRaw) as Record<string, any>;
|
|
}
|