MCPcopy Create free account
hub / github.com/firebase/firebase-tools / parseSetArgs

Function parseSetArgs

src/functionsConfig.ts:199–224  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

197}
198
199export function parseSetArgs(args: string[]): ParsedArg[] {
200 const parsed: ParsedArg[] = [];
201 for (const arg of args) {
202 const parts = arg.split("=");
203 const key = parts[0];
204 if (parts.length < 2) {
205 throw new FirebaseError("Invalid argument " + clc.bold(arg) + ", must be in key=val format");
206 }
207 if (/[A-Z]/.test(key)) {
208 throw new FirebaseError("Invalid config name " + clc.bold(key) + ", cannot use upper case.");
209 }
210
211 const id = keyToIds(key);
212 if (isReservedNamespace(id)) {
213 throw new FirebaseError("Cannot set to reserved namespace " + clc.bold(id.config));
214 }
215
216 const val = parts.slice(1).join("="); // So that someone can have '=' within a variable value
217 parsed.push({
218 configId: id.config,
219 varId: id.variable,
220 val: val,
221 });
222 }
223 return parsed;
224}
225
226export function parseUnsetArgs(args: string[]): ParsedArg[] {
227 const parsed: ParsedArg[] = [];

Callers

nothing calls this directly

Calls 2

keyToIdsFunction · 0.85
isReservedNamespaceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…