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

lodash set not working #5391

Closed
yasin459 opened this issue Feb 16, 2022 · 1 comment
Closed

lodash set not working #5391

yasin459 opened this issue Feb 16, 2022 · 1 comment
Labels
issue bankruptcy Closing the issue/PR to start fresh

Comments

@yasin459
Copy link

yasin459 commented Feb 16, 2022

i have an object which i like to change one of the nested values
let the object be foldersData
then I run this code on lodash website:
let x= _.set({categories:foldersData} , "categories.folders[0].topicData.open" , 30023)

console.log("what",_.get(x , "categories.folders[0].topicData.open" , "nabbodd"))

which results in 30023
but when i run the EXACT code on vscode i GET TRUE(which is prevous value of given path)
which means that set is not working at all
strange thing is that I try the original example of https://lodash.com/docs/4.17.15#set and I am fine.
but with my own object it is not doing anything

@yasin459
Copy link
Author

yasin459 commented Feb 16, 2022

in case you needed folderData:
export var foldersData = { topicData: { title: "1موضوع", id: 1, parentId: 0, open: true, }, folders: [ { topicData: { title: "11موضوع", id: 10, parentId: 1, open: true, }, folders: [ { topicData: { title: "121موضوع", id: 10, parentId: 1, open: false, }, folders: [], files: [{ title: "کتگوری", open: false }], }, { topicData: { title: "12موضوع2", id: 10, parentId: 1, open: true, }, folders: [], files: [ { title: "کتگوری", open: true }, { title: "کتگوری", open: false }, { title: "کتگوری", open: false }, ], }, ], files: [{ title: "کتگوری" }, { title: "کتگوری" }], }, { topicData: { title: "12موضوع", id: 10, parentId: 1, open: false, }, folders: [], files: [ { title: "کتگوری", open: true }, { title: "کتگوری", open: false }, ], }, { topicData: { title: "13موضوع", id: 10, parentId: 1, open: true, }, folders: [], files: [ { title: "کتگوری", open: false }, { title: "کتگوری", open: false }, ], }, ], files: [], };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue bankruptcy Closing the issue/PR to start fresh
Development

No branches or pull requests

2 participants