Fix whitespaces in config strings
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
const specialOptions: Record<string, (text: string) => string> = {
|
||||
$__file: (arg: string) => readFileSync(arg, 'utf8')
|
||||
$__file: (arg: string) => readFileSync(arg, 'utf8').trim()
|
||||
};
|
||||
|
||||
export const enhancedStringConfig = (value: string) => {
|
||||
@@ -9,7 +9,7 @@ export const enhancedStringConfig = (value: string) => {
|
||||
|
||||
for(const opt of Object.keys(specialOptions)) {
|
||||
if(trimmed.startsWith(`${opt}:`) && opt in specialOptions) {
|
||||
return specialOptions[opt](trimmed.slice(opt.length + 1));
|
||||
return specialOptions[opt](trimmed.slice(opt.length + 1).trim());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user