Skip to content

Commit

Permalink
cosmetic rename, doc touchup
Browse files Browse the repository at this point in the history
  • Loading branch information
ddooley committed Jan 18, 2025
1 parent 0fc6edc commit b52340f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/utils/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,14 @@ function processJsonBasedOnType(jsonData, handleObject, handleArray) {
}
}

// Function to import and process a JSON file
// Function to import and process a JSON data file
// Only pertains to DH files, not DH templates
export function importJsonFile(jsonData) {
return processJsonBasedOnType(
jsonData,
(data) => {
// TODO: this required fields problem is only when loading DH files, not DH templates
// Loader is doubled up?
// Check if the object has all required fields
// Validate whether data file has necessary components.
// DD note 2025-01-17 Is this doing anything?
const requiredFields = []; // ['schema', 'version', 'in_language', 'Container'];
const requiredFieldTest = (field) => typeof data[field] !== 'undefined';
const requiredFieldsFilterArray = requiredFields.map(requiredFieldTest);
Expand All @@ -320,7 +320,7 @@ export function importJsonFile(jsonData) {
}
return {
container: data.Container,
schema: data.schema,
schema_uri: data.schema,
in_language: data.in_language,
};
},
Expand Down

0 comments on commit b52340f

Please sign in to comment.