mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 13:38:38 +00:00
Add math equation parse from config
This commit is contained in:
@@ -32,7 +32,21 @@ export function parseConfigFile(config: string):
|
||||
.replace(/\t/g, "") // Remove line breaks and tabs
|
||||
|
||||
.replace(/basePath:(.*?),/g, 'basePath: "placeholder-domain",') // Replace basePath variable with placeholder
|
||||
.replace(/maxFileSize:(.*?),/g, "maxFileSize: 4194304,") // Set maxFileSize to 4MB
|
||||
.replace(/maxFileSize:(.*?),/g, (str) => {
|
||||
if (!str) return "maxFileSize: 4194304,"; // Set maxFileSize to 4MB
|
||||
const value = str.split(":")[1].split(",")[0].trim();
|
||||
return `maxFileSize: ${eval(value)},`;
|
||||
}) // Set maxFileSize to 4MB
|
||||
.replace(/streamMaxSize:(.*?),/g, (str) => {
|
||||
if (!str) return "streamMaxSize: 104857600,";
|
||||
const value = str.split(":")[1].split(",")[0].trim();
|
||||
return `streamMaxSize: ${eval(value)},`;
|
||||
}) // Set streamMaxSize to 100MB
|
||||
.replace(/temporaryTokenDuration:(.*?),/g, (str) => {
|
||||
if (!str) return "temporaryTokenDuration: 6,";
|
||||
const value = str.split(":")[1].split(",")[0].trim();
|
||||
return `temporaryTokenDuration: ${eval(value)},`;
|
||||
})
|
||||
|
||||
.replace(/([a-zA-Z]*?):\s/g, '"$1": ') // Add double quotes to keys
|
||||
.trim()
|
||||
|
||||
Reference in New Issue
Block a user