(
userId: string,
path: string,
name: string,
contents: string,
)
| 244 | } |
| 245 | |
| 246 | static async update( |
| 247 | userId: string, |
| 248 | path: string, |
| 249 | name: string, |
| 250 | contents: string, |
| 251 | ): Promise<boolean> { |
| 252 | await ensureUserPathIsValidAndSecurelyAccessible(userId, join(path, name)); |
| 253 | |
| 254 | const rootPath = join(await AppConfig.getFilesRootPath(), userId, path); |
| 255 | |
| 256 | try { |
| 257 | await Deno.writeTextFile(join(rootPath, name), contents, { append: false, createNew: false }); |
| 258 | } catch (error) { |
| 259 | console.error(error); |
| 260 | return false; |
| 261 | } |
| 262 | |
| 263 | return true; |
| 264 | } |
| 265 | |
| 266 | static async get( |
| 267 | userId: string, |
nothing calls this directly
no test coverage detected