Add error for when name arg in register is a pattern

This commit is contained in:
tyow
2026-03-13 14:11:19 -04:00
parent 4a801ab668
commit 7294cd5443
+4
View File
@@ -1741,6 +1741,10 @@ export const func = curry((a, b) => reify(b).func(a));
*
*/
export function register(name, func, patternify = true, preserveSteps = false, join = (x) => x.innerJoin()) {
if (isPattern(name)) {
throw new Error("Name argument for register is a pattern, try using single quotes ('name') instead of double quotes (\"name\")");
}
if (Array.isArray(name)) {
const result = {};
for (const name_item of name) {