// @ts-ignore - Prevent TypeScript from copying the JSON file to the output folder
import jsonEmployees from "../employees.json";
import { deepClone } from "./deep-clone";
import { resolve } from "./isomorphic.node";
/**
 * An array of Employee objects. Unlike the raw JSON employee data,
 * the date fields of these objects are `Date` objects rather than strings,
 * and the image paths are fully resolved.
 */
export const employees = [];
for (let jsonEmployee of jsonEmployees) {
    // Deep-clone the JSON data, so we don't modify the original objects
    // (in case the consumer wants to use both the raw and enriched objects)
    jsonEmployee = deepClone(jsonEmployee);
    employees.push(Object.assign({}, jsonEmployee, {
        dob: new Date(jsonEmployee.dob),
        hiredOn: new Date(jsonEmployee.hiredOn),
        terminatedOn: jsonEmployee.terminatedOn ? new Date(jsonEmployee.terminatedOn) : undefined,
        portrait: resolve(jsonEmployee.portrait),
        thumbnail: resolve(jsonEmployee.thumbnail),
    }));
}
//# sourceMappingURL=employees.js.map