
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
Mapped is a lightweight TypeScript based library for implementing basic mapping between two objects.
Mapped is a lightweight TypeScript based library for implementing basic mapping between two objects.
A basic example is shown here:
class SourceCls {
public flag?: boolean;
public other?: string;
}
class DestCls {
public flag?: boolean;
public other?: string;
}
function mapSomething(sourceObj: SourceCls): DestCls {
const mapper = new Mapper();
mapper.register(SourceCls, DestCls)
.forMember((dest: DestCls) => dest.flag, (src: SourceCls) => src.flag)
.forMember((dest: DestCls) => dest.other, (src: SourceCls) => src.other);
const destObj = mapper.map(sourceObj, DestCls);
return destObj;
}
Child objects will be created with all mappings provided; but types will not be created from their constructors (with this being JavaScript the type cannot be obtained). Anything can be returned from the mapped source object - including a new object.
Examples of both these cases are shown here. dest.child will be created with dest.child.further being a straight forward map from src.param. dest.child.random will be set to the new object created here.
mapper.register(Source, Dest)
.forMember((dest: Dest) => dest.child!.further, (src: Source) => src.param)
.forMember(
(dest: Dest) => dest.child!.random,
(src: Source) => { return {
prop: src.other,
nope: src.param,
} as RandomClass; },
);
FAQs
Mapped is a lightweight TypeScript based library for implementing basic mapping between two objects.
The npm package mapped receives a total of 1 weekly downloads. As such, mapped popularity was classified as not popular.
We found that mapped 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
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.