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

Deleting an element from an array sets it to null instead #24

Closed
alexberriman opened this issue Aug 23, 2022 · 1 comment · Fixed by #25
Closed

Deleting an element from an array sets it to null instead #24

alexberriman opened this issue Aug 23, 2022 · 1 comment · Fixed by #25
Labels
bug Something isn't working released

Comments

@alexberriman
Copy link
Owner

When you try and delete an element from an array, rather than delete it just sets it to null

interface Lunchbox {
  color: string;
  contents: string[];
}
const $db = new Database<Lunchbox[]>([
  { color: "red", contents: ["apple", "orange", "banana"] },
]);
const $patch = $db.$.get({ color: "red" })
  .set({ contents: ["orange", "banana"] })
  .commit();
console.log(JSON.stringify($db.$.get({ color: "red" }).data));

// => {"color":"red","contents":[null,"orange","banana"]}
@alexberriman
Copy link
Owner Author

🎉 This issue has been resolved in version 0.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant