MCPcopy Create free account
hub / github.com/HKUDS/AgentSpace / parseSmokeEnvFileValue

Function parseSmokeEnvFileValue

scripts/feishu/smoke.ts:1149–1169  ·  view source on GitHub ↗
(value: string, lineNumber: number)

Source from the content-addressed store, hash-verified

1147}
1148
1149function parseSmokeEnvFileValue(value: string, lineNumber: number): string {
1150 if (!value) {
1151 return "";
1152 }
1153
1154 const quote = value[0];
1155 if (quote === "\"" || quote === "'") {
1156 if (!value.endsWith(quote)) {
1157 throw new SmokeCliError({
1158 code: "feishu.smoke.invalid_env_file",
1159 message: `Invalid --env-file line ${lineNumber}: unterminated quoted value.`,
1160 reason: "unterminated_quoted_value",
1161 });
1162 }
1163 const inner = value.slice(1, -1);
1164 return quote === "\"" ? unescapeDoubleQuotedEnvValue(inner) : inner;
1165 }
1166
1167 const commentIndex = value.search(/\s#/);
1168 return (commentIndex === -1 ? value : value.slice(0, commentIndex)).trim();
1169}
1170
1171function unescapeDoubleQuotedEnvValue(value: string): string {
1172 return value

Callers 1

parseSmokeEnvFileFunction · 0.85

Calls 1

Tested by

no test coverage detected