Merge pull request 'Add error for when name arg in register is a pattern' (#2020) from tyow/localstrudel:registerErrorFix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/2020
This commit is contained in:
commit
f73b395648
1 changed files with 6 additions and 0 deletions
|
|
@ -1741,6 +1741,12 @@ export const func = curry((a, b) => reify(b).func(a));
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function register(name, func, patternify = true, preserveSteps = false, join = (x) => x.innerJoin()) {
|
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)) {
|
if (Array.isArray(name)) {
|
||||||
const result = {};
|
const result = {};
|
||||||
for (const name_item of name) {
|
for (const name_item of name) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue