Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loop with primitive values #473

Open
alexanderkirtzel opened this issue Dec 5, 2024 · 1 comment
Open

loop with primitive values #473

alexanderkirtzel opened this issue Dec 5, 2024 · 1 comment
Labels

Comments

@alexanderkirtzel
Copy link
Collaborator

alexanderkirtzel commented Dec 5, 2024

Is your feature request related to a problem? Please describe.
getMappingValue doesn't support primitive types like string or number. Only object.

Describe the solution you'd like
getMappingValue("str", { condition: () => true }); // Return "str"

It's mainly to support the loop.

getMappingValue(
  { arr: [1, "foo", false] },
  {
    loop: [
      "arr",
      {
        fn: (i) => {
          console.log(i);
          return i;
        },
      },
    ],
  }
);

@alexanderkirtzel
Copy link
Collaborator Author

check if we also need a try-catch here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant