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.
@buggyorg/dynatype
Advanced tools
A dynamic datatype is a meta construct that abstracts the data represented by a datatype. It is possible to define datatypes and define relations between those.
The API is separated into descriptors and translators.
The descriptor API is usable via
var descriptor = require('dynatype').descriptor
It offers the following functions
function | description |
---|---|
create(name, data) | Create a new dynatype descriptor. It always must have a unique name. The data object contains information about the structure of the type. It is a JS object. |
typename(dynatype) | Get the name of a dynatype descriptor instance |
hasProperty(dynatype, property) | Returns whether the dynatype defines the property property |
datatype(dynatype, property) | Returns the datatype of the dynatype property. |
The data object for a descriptor has a special structure. It is a mapping between the name of the property and its type. They type can be one of the following
"number"
"bool"
"string"
"array"
this requires the extra field arraytype
for the array datatype. We don't support mixed arrays.A descriptor could look like this:
var pointXY = descriptor.create('PointXY', {
'x': 'number',
'y': 'number'
})
A translator defines a method of translating one datatype into another. Consider this example:
var pointXY = /*...*/
var pointRPhi = descriptor.create('PointRPhi', {
'r': 'number',
'phi': 'number'
})
var translator = translator.create(pointXY, pointRPhi, {/*...*/})
this creates a translator that defines some way of translating a point given in XY coordinates into a point given in polar coordinates. The data that describes the translation is specific to the system it is used in. The dynatype libraries do only store this information but never touch it.
FAQs
A dynamic type implementation.
We found that @buggyorg/dynatype 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.