Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Omm maps between rich objects and documents.
Load rich objects instead of documents from a collection
Describe the object graph through annotation-style function calls
Declare meteor methods through annotations-style function calls
Perform collection altering operations anywhere on the object graph
Strengthens encapsulation of objects by removing persistence logic from the domain logic
Atomicity over complex operations within one document
Garden = function Garden( name, id ){
this._id = id;
this.name = name;
this.plants = [];
this.harvested = 0;
};
// declares Garden as an Entity
omm.addEntity(Garden);
// declares that the property "plants" contains objects of the type "Plant"
omm.arrayType(Garden, "plants", "Plant");
Garden.prototype.addPlant = function( t ){
this.plants.push( new Plant( t, this ) );
};
omm.collectionUpdate( Garden, "addPlant" );
Garden.prototype.growPlants = function(){
this.plants.forEach( function(p){
p.grow();
});
};
omm.collectionUpdate( Garden, "growPlants" );
Plant = function Plant( type, garden ){
//this._id = "id"+garden.plants.length;
this.type = type;
this.height = 1;
this.garden = garden;
};
// declares that Plant is an Entity
omm.addEntity(Plant);
// declares that the property garden contains object of the class "Garden"
omm.type(Plant, "garden", "Garden");
// declares that the value of the property should be stored as a key (string) rather than the actual object
omm.asForeignKey(Plant, "garden");
Plant.prototype.grow = function(){
if( this.height<20 )
this.height++;
if( this.height==10 || this.height==15 ){
this.garden.addPlant(this.type,this.garden);
}
};
Plant.prototype.harvest = function(){
var i = this.garden.plants.indexOf(this);
this.garden.plants.splice(i,1);
this.garden.harvested+=this.height;
};
// declares that the function "harvest" should also be invoked on the object in the collection.
omm.collectionUpdate( Plant, "harvest");
MIT
FAQs
Omm maps between rich objects and documents.
We found that o-m-m 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.