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

deepKeys doesn't work with sparsed arrays: ".for is not iterable" #108

Closed
AuthorProxy opened this issue Jun 29, 2023 · 1 comment · Fixed by #110
Closed

deepKeys doesn't work with sparsed arrays: ".for is not iterable" #108

AuthorProxy opened this issue Jun 29, 2023 · 1 comment · Fixed by #110

Comments

@AuthorProxy
Copy link
Contributor

AuthorProxy commented Jun 29, 2023

deepKeys doesn't work with sparsed arrays

it("deepKeys should not cause an error with sparsed arrays", () => {
  // fixture setup
  const mockedEntity = {
    // eslint-disable-next-line no-sparse-arrays
    open_hours: [1, , 3],
  };

  const sut = () => {
    deepKeys(mockedEntity);
  };

  // exercise system
  // verify outcome
  expect(sut).not.toThrow();
});

Error name: "TypeError"
Error message: ".for is not iterable"

@AuthorProxy AuthorProxy changed the title .for is not iterable deepKeys doesn't work with sparsed arrays: ".for is not iterable" Jun 29, 2023
@AuthorProxy
Copy link
Contributor Author

AuthorProxy commented Jun 30, 2023

@sindresorhus you fixed it but it doesn't work correctly, check #110

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

Successfully merging a pull request may close this issue.

1 participant