Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@florianb/rec
Advanced tools
Minimal ECMAScript-module facilitating model-framework to support a straight-forward workflow without magic.
Features:
npm i --save @florianb/rec
import Base from '@florianb/rec'
class FellowShipOfTheRing extends Base {
static get schema() {
return {
properties: {
boromir: {
type: 'integer'
}
}
}
}
}
const sourceObject = {boromir: false}
let fellowship = FellowShipOfTheRing.newFrom(sourceObject)
// TypeError: Schema validation for FellowShipOfTheRing failed at: .boromir: should be integer
fellowship = FellowShipOfTheRing.newFrom({boromir: 0})
// success!
Instantiate a class from a plain object using the static method newFrom()
. If the schema
-property is defined, its value is used as JSONSchema and the plain object is validated against it. If the validation fails a TypeError is raised.
static newFrom(Object source) -> Object
Returns a new instance of the class having the source
merged in. If the schema
property is defined, the source wil be validated before being merged.
Object
- instantiated class with merged in properties from source
TypeError
- if schema
is set and validation failsget static schema() -> Object
Overrride to provide a JSONSchema for the class. If set the schema will be used to validate any new instantiation of the Class.
Object
- JSONSchema object according to the schema-version 7FAQs
Primitive model toolset delivered as base class for your models.
The npm package @florianb/rec receives a total of 0 weekly downloads. As such, @florianb/rec popularity was classified as not popular.
We found that @florianb/rec 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.