refactor: replace "folder" with "directory" across file handling components and tests

This commit is contained in:
Justin Lin committed 2025-04-24 21:24:55 +08:00
1 parent 7e50c8e06c
commit cdd22634e0
18 files changed
+150 -104

No files matched your search

+9 -39
View File
@@ -61,20 +61,13 @@
},
"type": {
"type": "string",
"enum": [
"file",
"folder"
]
"enum": ["file", "directory"]
},
"exists": {
"type": "boolean"
}
},
"required": [
"path",
"type",
"exists"
],
"required": ["path", "type", "exists"],
"additionalProperties": false
}
},
@@ -95,10 +88,7 @@
"properties": {
"type": {
"type": "string",
"enum": [
"narrative",
"dialogue"
],
"enum": ["narrative", "dialogue"],
"default": "narrative"
},
"content": {
@@ -108,9 +98,7 @@
"type": "string"
}
},
"required": [
"content"
],
"required": ["content"],
"additionalProperties": false
},
"exceptions": {
@@ -132,20 +120,12 @@
"default": false
}
},
"required": [
"id",
"condition",
"response"
],
"required": ["id", "condition", "response"],
"additionalProperties": false
}
}
},
"required": [
"id",
"condition",
"response"
],
"required": ["id", "condition", "response"],
"additionalProperties": false
}
},
@@ -168,22 +148,12 @@
"default": []
}
},
"required": [
"id",
"condition",
"response"
],
"required": ["id", "condition", "response"],
"additionalProperties": false
}
}
},
"required": [
"id",
"title",
"image",
"instruction",
"stages"
],
"required": ["id", "title", "image", "instruction", "stages"],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ import { z } from 'zod'
export const fileInputSchema = z.object({
path: z.string(),
type: z.enum(['file', 'folder']),
type: z.enum(['file', 'directory']),
})
export type IFileInput = z.infer<typeof fileInputSchema>
+3 -3
View File
@@ -15,7 +15,7 @@ export class MockFileChecker implements IFileExistenceChecker {
},
{
path: '/home/user/Downloads',
type: 'folder',
type: 'directory',
},
]
@@ -57,7 +57,7 @@ test('file matcher', async () => {
await checkFiles(checker, [
{
path: '/home/user/Downloads',
type: 'folder',
type: 'directory',
exists: true,
},
])
@@ -71,7 +71,7 @@ test('file matcher', async () => {
},
{
path: '/home/user/Downloads',
type: 'folder',
type: 'directory',
exists: true,
},
])