
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.
RTDS is a Typescript library to create types and data structures at runtime. In a sense it is similar to other libraries like Zod, but it has a few interesting twists. RTDS also creates reactive data structures from these types, and lets you do interestin
RTDS is a Typescript library to create types and data structures at runtime. In a sense it is similar to other libraries like Zod, but it has a few interesting twists. RTDS also creates reactive data structures from these types, and lets you do interesting things with them.
const S = new Schema();
// Create Rect runtime type
const Rect = S.map({
x: S.number(),
y: S.number(),
w: S.number(),
h: S.number(),
});
// get the typescript type for it
type RectType = typeof Rect;
// make a rect instance
const rect = Rect.clone();
// set value
rect.get("x").set(55);
const S = new Schema();
// Create Rect runtime type
const Rect = S.map({
x: S.number(),
y: S.number(),
w: S.number(100), // default value for width
h: S.number(200), // default value for height
});
const rect = Rect.cloneWith({
x: 5,
y: 6,
// w & h are missing, so they get the default value of 100
});
const S = new Schema();
// list of numbers
const Nums = S.list(S.number());
// list of strings
const Strings = S.list(S.string());
// list of booleans
const Bools = S.list(S.boolean());
// list of Points
const Point = S.map({
x: S.number(),
y: S.number(),
});
const Points = S.list(Point);
const S = new Schema();
const Point = S.map({
x: S.number(),
y: S.number(),
});
expect(Point.isValid({ x: 5, y: 3 })).toBe(true);
expect(Point.isValid({ x: 5, z: 8 })).toBe(false); // z is not a valid property of Point
import { ObjJSON } from "./json";
const S = new Schema();
const Point = S.map({
x: S.number(),
y: S.number(),
});
const some_point = Point.cloneWith({ x: 50, y: 100 });
const simple_json = ObjJSON.toFlatJSON(some_point);
// simple_json looks like { x: 50, y: 100 }
const another_point = ObjJSON.fromFlatJSON(simple_json);
import { ObjJSON } from "./json";
const S = new Schema();
const Point = S.map({
x: S.number(),
y: S.number(),
});
const some_point = Point.cloneWith({ x: 50, y: 100 });
const json_point = ObjJSON.toJSON3(S, some_point);
/* json_point looks like
{
id: 'id_88044',
typeName: 'APoint',
objType: 'map',
values: {
x: {
id: 'id_75900',
typeName: undefined,
objType: 'atom',
atomType: 'number',
value: 55
},
y: {
id: 'id_84910',
typeName: undefined,
objType: 'atom',
atomType: 'number',
value: 66
}
}
}
*/
const another_point = ObjJSON.fromJSON3(S, json_point);
const rect = Rect.cloneWith({ x: 50, y: 60, w: 70, h: 80 });
const url = objToURLSearchParams(rect);
expect(url.get("w")).toBe("70");
const S = new Schema();
const Point = S.map({
x: S.number(),
y: S.number(),
});
// make a list of three points
const points = S.list(Point, [Point.clone(), Point.clone(), Point.clone()]);
points.get(0).get("x").set(55);
// make a doc containing the list of points
const doc = API.map({
name: API.string("the name"),
points: points,
});
// create history
const history = new AHistory(doc);
// set first point x to 66
doc.get("points").get(0).get("x").set(66);
expect(doc.get("points").get(0).get("x").get()).toEqual(66);
history.doUndo();
expect(doc.get("points").get(0).get("x").get()).toEqual(55);
history.doRedo();
expect(doc.get("points").get(0).get("x").get()).toEqual(66);
When exporting json you can set an object type to be transient, meaning it will not be serialized. The challenge, then is how to un-serialize it?
FAQs
RTDS is a Typescript library to create types and data structures at runtime. In a sense it is similar to other libraries like Zod, but it has a few interesting twists. RTDS also creates reactive data structures from these types, and lets you do interestin
We found that rtds-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.