![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@blazingedge/update
Advanced tools
Yet another utility for immutable object updates.
npm install @blazingedge/update --save
import update from '@blazingedge/update'
const newState = update(state, 'path.to.users[7].data', {
email: 'some.email@example.com',
balance: {
amount: n => n + 100
}
})
More examples in the article.
update(data, [path], change)
Updated data. When no effective changes are made, returns the same data
.
REMOVE
Special value to use in a change to remove part(s) of data.
import update, { REMOVE } from '@blazingedge/update'
// Remove entire player
update(state, 'path.to.playersById[7]', REMOVE)
// Removing and setting
update(state, 'path.to.playersById', {
[killedPlayerId]: REMOVE,
[killedBy]: {
kills: n => n + 1,
}
})
*
"To apply a change to all values of an array/object, we can use "*
".
update(state, 'path.to.users[*].data.balance', n => n + 100)
update(state, 'path.to.users[*]', (user) => {
if (Math.random() < 8) {
return REMOVE
}
// Mark others as lucky and double the balance amount
return update(user, {
lucky: true,
balance: {
amount: n => n * 2
}
})
})
When path is passed as an array, it can also contain "filters" to selectively change values of an array/object.
update(state, ['path', 'to', 'users', { lucky: true }, 'balance'], {
limit: REMOVE,
amount: n => n + 1000
})
A filter can be a:
user => user.lucky
,{ lucky: true }
(use {}
for "all"),[2, 4, 6, 8]
FAQs
Utility for immutable deep updates of objects.
The npm package @blazingedge/update receives a total of 11 weekly downloads. As such, @blazingedge/update popularity was classified as not popular.
We found that @blazingedge/update demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.