Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Fixd is a JavaScript library for creating reference-free, immutable (frozen) objects. It supports immutability on all native types, including deeply nested objects and arrays.
npm i fixd --save
'use strict'
const fixd = require('fixd')
// Add a new object
fixd.foo = {
fizz: 'buzz',
baz: {
quz: 'baz'
}
}
// Access object
fixd.foo // -> { fizz: 'buzz', baz: { quz: 'baz' } }
// Throws error, prevents mutations
foo.fizz = 'bazz' // -> ERROR: Cannot assign to read only property
Note: While Object.freeze
will prevent modifications, use strict
must be applied to the document in order to throw an error on attempted mutation.
Because the objects are frozen, Fixd provides the create
method for returning a new, modified instance.
fixd.create('foo', (foo) => {
foo.fizz = 'bazz'
return foo
}) // -> { fizz: 'bazz', baz: { quz: 'baz' } }
The above will not modify the foo
object, it will return a new, reference-free, frozen instance of the object based on the modification performed in the callback.
The prefered dependency manager for Fixd is Yarn. To run tests, execute the following after dependencies have been installed:
yarn test
Fixd is developed and maintained by TechnologyAdvice and released under the ISC license.
FAQs
Test fixture utility
We found that fixd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.