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

Doesn't handle passing array reference as path #27

Open
mariomc opened this issue May 4, 2020 · 1 comment
Open

Doesn't handle passing array reference as path #27

mariomc opened this issue May 4, 2020 · 1 comment

Comments

@mariomc
Copy link

mariomc commented May 4, 2020

This example

import { get } from 'lodash';

const obj = { a: { b: { c: { d: 1 }}}};
const path = ['a','b','c','d'];

get(obj, path);

Turns into:

const obj = { a: { b: { c: { d: 1 }}}};
const path = ['a','b','c','d'];

obj?.[path];

Which is incorrect, obv. Will try to do a follow-up PR to tackle this issue.

@villesau
Copy link
Owner

villesau commented May 6, 2020

Thanks for trying to fix this @mariomc! In the meanwhile --skipVariables should skip this behaviour since it is rather unsafe. It's not easy to understand the type of the variable in JS :)

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

No branches or pull requests

2 participants