in packages/sqrl/src/ast/AstTypes.ts [184:205]
function ensureObjectWithConstantKeys(ast?) {
sqrlInvariant(
ast,
ast && SqrlAst.isSimpleDataObject(ast),
"Expected argument to be object with constant keys"
);
if (ast.type === "constant" && typeof ast.value === "object") {
return Object.keys(ast.value);
}
const keys = [];
for (let idx = 0; idx < ast.args.length; idx += 2) {
const arg = ast.args[idx];
sqrlInvariant(
arg,
arg.type === "constant" && typeof arg.value === "string",
"Expected constant string key for object here"
);
keys.push(arg.value);
}
return keys;
}