
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Remapper maps one object into another using a mapping configuration overrides. By default, all properties from the source object will be remapped as-is to the destination object unless, an override is provided.
It was created to help with mapping between JavaScript objects and sql/relation database models.
Basic mapping example:
import ReMapper from 're-mapper';
const mapper = new ReMapper({
'firstName': 'first_name',
'lastName': 'last_name',
});
const source = {
id: 1,
firstName: 'John',
lastName: 'Citizen',
email: 'john@citizen.com'
};
const mapped = mapper.map(source);
// mapped:
// {
// id: 1,
// first_name: 'John',
// last_name: 'Citizen',
// email: 'john@citizen.com'
// }
Array mapping example:
const sourceList = [
{
id: 1,
firstName: 'John',
lastName: 'Citizen',
email: 'john@citizen.com'
},
{
id: 2,
firstName: 'Jane',
lastName: 'Doe',
email: 'jane@doe.com'
}
];
const mappedList = sourceList.map(mapper.map);
The reverse mapping is also available with the reversMap
method which inverts the mapping definition.
Example:
import ReMapper from 're-mapper';
const mapper = new ReMapper({
'firstName': 'first_name',
'lastName': 'last_name',
});
const mapped = {
id: 1,
first_name: 'John',
last_name: 'Citizen',
email: 'john@citizen.com'
};
const unmapped = mapper.reverseMap(source);
// unmapped:
// {
// id: 1,
// firstName: 'John',
// lastName: 'Citizen',
// email: 'john@citizen.com'
// }
FAQs
JavaScript object mapper
The npm package re-mapper receives a total of 0 weekly downloads. As such, re-mapper popularity was classified as not popular.
We found that re-mapper 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.