
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Javascript library that makes use of the Proxy API to control objects through the use of handlers.
Created by: Alfredo Narváez, 2019
⚙️ Travis CI 🛠️
👩🔬 SonarQube 👨🔬
Rondel is a library that makes use of the JavaScript Proxy API and exposes certain functionalities to protect & control objects through the use of handlers.
Why "Rondel"?
A rondel (ˈrɒndl) is a circular piece of metal used for protection in suits of armor

First things first! You gotta install rondel as a dependency, so go ahead and run:
yarn add -D rondel
or if you're using npm:
npm install --save-dev rondel
Okay! Once that's done, you're ready to go!
Let's say you want to create a protected Object
import Rondel from 'rondel';
const rondel = new Rondel();
const myObj = rondel.create().protected({
obj: { name: 'John', lastName: 'Doe' },
modifiers: {},
});
console.log(myObj.randomProp); // unset property
How about controlling the undefined props of our objects?
import Rondel from 'rondel';
const rondel = new Rondel();
const myObj = rondel.create().protected({
obj: { name: 'John', lastName: 'Doe' },
modifiers: { exposeDefault: [] },
});
console.log(myObj.randomProp); // []
Alright... how about restricting setting properties?
import Rondel from 'rondel';
const rondel = new Rondel();
const myObj = rondel.create().protected({
obj: { name: 'John', lastName: 'Doe' },
modifiers: { exposeDefault: [], setNotAllowed: true },
});
console.log(myObj.randomProp); // []
myObj.addPropHere = 'Hello World!'; // Will throw error
Rondel has a built-in type validation that can be triggered along with validateTypes: true on the modifiers object.
We can then specify an array of the type of properties that we want to validate, so we end up getting something like this:
const myObj = rondel.create().protected({
obj: { name: 'John', lastName: 'Doe' },
modifiers: { validateTypes: true, areStrings: ['lastName', 'name'] },
});
if we then proceed to change name to a number like this:
myObj.name = 123;
A TypeError with the message Expected a string value for property name will be thrown.
Currently supported:
For more information please visit the Test file
Proxies are very powerful. They also allow us to access dynamically generated properties.
Let's look at the following snippet:
const arr = rondel.create().searchable([
{
name: 'John',
age: 30,
skills: ['React', 'Node'],
position: 'Sr Dev',
salary: 100000,
},
{ name: 'Mathew', age: 26, skills: ['JavaScript'], salary: 0 },
{
name: 'Claudia',
nationality: null,
age: 33,
skills: ['AWS', 'Azure', 'DevOps', 'JavaScript'],
salary: 80000,
},
]);
By using findWhere<Property>Equals(<String>) we'll get all the matching results
arr.findWhereNameEquals('John'); // will give us all the objects that contain John in the name property
arr.findWhereNationalityIsNull(); // will give us all the objects that contain null in the nationality property
arr.findWhereSkillsIncludes('JavaScript'); // will give us all the objects that contain JavaScript inside an array of skills.
Currently supported methods:
findWhereXEquals
Returns an array of objects of all matching objects to value.
findWhereXEquals(value: any) : [{}];
findWhereXIsNull
Returns an array of objects of all matching null objects.
findWhereXIsNull() : [{}];
findWhereXIsUndefined
Returns an array of objects of all matching undefined objects.
findWhereXIsUndefined() : [{}];
findWhereXIsEmpty
Returns an array of objects of all matching Empty objects.
findWhereXIsEmpty() : [{}];
findWhereXIsIncludes
Returns an array of objects of all matching to the value/s provided.
findWhereXIsIncludes(value: any) : [{}];
findWhereXIsLowerThan & findWhereXIsGreaterThan
Returns an array of objects of all matching wether is lower or greater than a value provided.
findWhereXIsLowerThan(value: any) : [{}];
findWhereXIsGreaterThan(value: any) : [{}];
FAQs
Javascript library that makes use of the Proxy API to control objects through the use of handlers.
We found that rondel 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.