You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get a property in an array of objects. It seems that the changes are not retrieved properly with .get(). Sadly, I don't know enough about this library to identify the problem.
Also, i didn't see examples of changeset with an array of objects in the documentation. Is it recommended ?
I made a simple reproduction test that explains the problem.
describe('arrays of objects',()=>{test('changes in array are gettable',()=>{letinitialData={contacts: []};constchangeset=Changeset(initialData);changeset.set("contacts",[{name :'william'}]);// returns undefinedexpect(changeset.get("contacts.0")).toStrictEqual({name :'william'});expect(changeset.get("contacts.0.name")).toStrictEqual('william');});});
node version : 14.19.1
validated-changeset: 1.3.3
Thank you in advance.
The text was updated successfully, but these errors were encountered:
Hello,
I'm trying to get a property in an array of objects. It seems that the changes are not retrieved properly with
.get()
. Sadly, I don't know enough about this library to identify the problem.Also, i didn't see examples of changeset with an array of objects in the documentation. Is it recommended ?
I made a simple reproduction test that explains the problem.
node version : 14.19.1
validated-changeset: 1.3.3
Thank you in advance.
The text was updated successfully, but these errors were encountered: