
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
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 3 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
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.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.