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

Meta tweak #98

Merged
merged 1 commit into from
Jun 24, 2022
Merged

Meta tweak #98

merged 1 commit into from
Jun 24, 2022

Conversation

Richienb
Copy link
Contributor

No description provided.

@sindresorhus
Copy link
Owner

Some of the tests use .0 too. Can you fix those too?

@Richienb
Copy link
Contributor Author

The tests intentionally use .0.

They test for when .0 refers to the key, not the array:

dot-prop/test.js

Lines 137 to 140 in 84c3233

t.false(getProperty({foo: [true]}, 'foo.0', false));
t.true(getProperty({foo: {
0: true,
}}, 'foo.0'));

And also to ensure an error is thrown when used to index an array:

dot-prop/test.js

Lines 235 to 237 in 84c3233

t.throws(() => setProperty(fixture5, '0.foo.0', true), {
message: 'Cannot use string index',
});

@sindresorhus
Copy link
Owner

Ah, ok. I simply grepped for 0....

@sindresorhus sindresorhus merged commit 1794b86 into sindresorhus:main Jun 24, 2022
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 this pull request may close these issues.

None yet

2 participants