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

_.get implementation #311

Open
jswhisperer opened this issue Apr 23, 2021 · 1 comment
Open

_.get implementation #311

jswhisperer opened this issue Apr 23, 2021 · 1 comment
Labels

Comments

@jswhisperer
Copy link

I would like to confirm the documentation, it says if the path in the object isn't found it will result in object error.
I want to clarify is not the whole point of _.get to search the unknown and paths may not exist?
https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get

@briancodes
Copy link

You're right about this one. The implementation shown doesn't match the features of _.get

  • path can be a string OR array of strings
  • returns undefined if object doesn't contain path/property
  • can return a default value if path doesn't exist
var object = { 'a': [{ 'b': { 'c': 3 } }] };
 
_.get(object, 'a[0].b.c');
// => 3
 
_.get(object, ['a', '0', 'b', 'c']);
// => 3
 
_.get(object, 'a.b.c', 'default');
// => 'default'

ozyx added a commit to nasa/openmct that referenced this issue May 25, 2022
- Disable the rule for now as the implementation they suggest doesn't match lodash `_.get()` functionality, and fails a bunch of our tests. See you-dont-need/You-Dont-Need-Lodash-Underscore#311 and you-dont-need/You-Dont-Need-Lodash-Underscore#294
unlikelyzero pushed a commit to nasa/openmct that referenced this issue May 26, 2022
)

* [e2e] Remove unnecessary step with force click

* `test.skip()` -> `test.fixme()`

* Bypass `no-wait-for-timeout` rule for visual tests

* Fail lint step if warnings > 0

* Set default value for `imageUrl`

- Resolves `vue/require-default-prop` warning

* Disable eslint rule `you-dont-need-lodash-underscore/get`

- Disable the rule for now as the implementation they suggest doesn't match lodash `_.get()` functionality, and fails a bunch of our tests. See you-dont-need/You-Dont-Need-Lodash-Underscore#311 and you-dont-need/You-Dont-Need-Lodash-Underscore#294

* Disable `no-wait-for-timeout` warning for `visual` folder

* Add rule exception and comments in logPlot test

- Add exception and FIXME for timeout

- Add comment on fixme test to discourage community contribution

* clean up tests

- remove unnecessary awaits

- update locators to use data-testid where possible

- remove unnecessary wait

* Wait for image count condition instead of timeout

* code review comments: use expect.poll()

* readability

* .fixme() + comment instead of .skip()

* disable `.skip()` warning for memleak test suite
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

3 participants