mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
remove nesting options within options
This commit is contained in:
@@ -7,7 +7,7 @@ export const zodGlobalSettingsCourse = z.object({
|
||||
|
||||
export const zodGlobalSettings = z.object({
|
||||
courses: z.array(zodGlobalSettingsCourse),
|
||||
options: z.record(z.any()).optional(),
|
||||
feedbackDelims: z.record(z.string()).optional(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -36,12 +36,10 @@ describe("getFeedbackDelimitersFromSettings", () => {
|
||||
it("returns custom delimiters if options are present", () => {
|
||||
const settings: GlobalSettings = {
|
||||
courses: [],
|
||||
options: {
|
||||
feedbackDelims: {
|
||||
neutral: ":|",
|
||||
correct: ":)",
|
||||
incorrect: ":(",
|
||||
},
|
||||
feedbackDelims: {
|
||||
neutral: ":|",
|
||||
correct: ":)",
|
||||
incorrect: ":(",
|
||||
},
|
||||
};
|
||||
const expected = {
|
||||
@@ -55,10 +53,8 @@ describe("getFeedbackDelimitersFromSettings", () => {
|
||||
it("returns mixed delimiters if some options are missing", () => {
|
||||
const settings: GlobalSettings = {
|
||||
courses: [],
|
||||
options: {
|
||||
feedbackDelims: {
|
||||
correct: ":)",
|
||||
},
|
||||
feedbackDelims: {
|
||||
correct: ":)",
|
||||
},
|
||||
};
|
||||
const expected = {
|
||||
|
||||
@@ -33,7 +33,7 @@ export const getFeedbackDelimitersFromSettings = (
|
||||
): FeedbackDelimiters => {
|
||||
return overriddenDefaults(
|
||||
defaultFeedbackDelimiters,
|
||||
settings.options?.feedbackDelims ?? {} as Record<string, unknown>
|
||||
settings.feedbackDelims ?? ({} as Record<string, unknown>)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user